Lines Matching +full:baikal +full:- +full:t1
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2020 BAIKAL ELECTRONICS, JSC
8 * Baikal-T1 Physically Mapped Internal ROM driver
22 #include "physmap-bt1-rom.h"
25 * Baikal-T1 SoC ROMs are only accessible by the dword-aligned instructions.
26 * We have to take this into account when implementing the data read-methods.
27 * Note there is no need in bothering with endianness, since both Baikal-T1
33 void __iomem *src = map->virt + ofs; in bt1_rom_map_read()
40 data = readl_relaxed(src - shift); in bt1_rom_map_read()
48 shift = 4 - shift; in bt1_rom_map_read()
49 if (ofs + shift >= map->size) in bt1_rom_map_read()
62 void __iomem *src = map->virt + from; in bt1_rom_map_copy_from()
66 if (len <= 0 || from >= map->size) in bt1_rom_map_copy_from()
70 len = min_t(ssize_t, map->size - from, len); in bt1_rom_map_copy_from()
80 chunk = min_t(ssize_t, 4 - shift, len); in bt1_rom_map_copy_from()
81 data = readl_relaxed(src - shift); in bt1_rom_map_copy_from()
85 len -= chunk; in bt1_rom_map_copy_from()
93 len -= 4; in bt1_rom_map_copy_from()
106 struct device *dev = &pdev->dev; in of_flash_probe_bt1_rom()
108 /* It's supposed to be read-only MTD. */ in of_flash_probe_bt1_rom()
109 if (!of_device_is_compatible(np, "mtd-rom")) { in of_flash_probe_bt1_rom()
110 dev_info(dev, "No mtd-rom compatible string\n"); in of_flash_probe_bt1_rom()
115 if (!of_device_is_compatible(np, "baikal,bt1-int-rom")) in of_flash_probe_bt1_rom()
119 if (map->bankwidth != 4) in of_flash_probe_bt1_rom()
122 map->read = bt1_rom_map_read; in of_flash_probe_bt1_rom()
123 map->copy_from = bt1_rom_map_copy_from; in of_flash_probe_bt1_rom()