10 #include <linux/device.h>
12 #include <linux/kernel.h>
17 #include <linux/resource.h>
48 .name =
"Root Filesystem",
49 .offset = 64 * 64 * 2048,
50 .size = 432 * 64 * 2048,
53 .name =
"Home Filesystem",
62 .parts = xlr_nor_parts,
66 static struct resource xlr_nor_res[] = {
73 .name =
"physmap-flash",
78 .resource = xlr_nor_res,
97 static void xlr_nand_ctrl(
struct mtd_info *mtd,
int cmd,
101 nlm_write_reg(nand_priv.flash_mmio,
104 nlm_write_reg(nand_priv.flash_mmio,
113 .partitions = xlr_nand_parts,
117 .cmd_ctrl = xlr_nand_ctrl,
121 static struct resource xlr_nand_res[] = {
131 .resource = xlr_nand_res,
146 static void setup_flash_resource(
uint64_t flash_mmio,
154 res->
start = flash_map_base + ((
unsigned long)base << 16);
155 res->
end = res->
start + (mask + 1) * 64 * 1024;
158 static int __init xlr_flash_init(
void)
160 uint64_t gpio_mmio, flash_mmio, flash_map_base;
161 u32 gpio_resetcfg, flash_bar;
162 int cs, boot_nand, boot_nor;
166 flash_map_base = (flash_bar & 0xffff0000) << 8;
175 boot_nor = boot_nand = 0;
176 if (nlm_chip_is_xls()) {
178 if (gpio_resetcfg & (1 << 16))
182 if ((gpio_resetcfg & (1 << 15)) == 0)
186 if ((gpio_resetcfg & (1 << 16)) == 0)
195 nand_priv.flash_mmio = flash_mmio;
196 setup_flash_resource(flash_mmio, flash_map_base, cs,
207 pr_info(
"ChipSelect %d: NAND Flash %pR\n", cs, xlr_nand_res);
212 setup_flash_resource(flash_mmio, flash_map_base, cs,
214 pr_info(
"ChipSelect %d: NOR Flash %pR\n", cs, xlr_nor_res);