axisflashmap.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  1. /*
  2. * Physical mapping layer for MTD using the Axis partitiontable format
  3. *
  4. * Copyright (c) 2001-2007 Axis Communications AB
  5. *
  6. * This file is under the GPL.
  7. *
  8. * First partition is always sector 0 regardless of if we find a partitiontable
  9. * or not. In the start of the next sector, there can be a partitiontable that
  10. * tells us what other partitions to define. If there isn't, we use a default
  11. * partition split defined below.
  12. *
  13. */
  14. #include <linux/module.h>
  15. #include <linux/types.h>
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/slab.h>
  19. #include <linux/mtd/concat.h>
  20. #include <linux/mtd/map.h>
  21. #include <linux/mtd/mtd.h>
  22. #include <linux/mtd/mtdram.h>
  23. #include <linux/mtd/partitions.h>
  24. #include <asm/axisflashmap.h>
  25. #include <asm/mmu.h>
  26. #define MEM_CSE0_SIZE (0x04000000)
  27. #define MEM_CSE1_SIZE (0x04000000)
  28. #define FLASH_UNCACHED_ADDR KSEG_E
  29. #define FLASH_CACHED_ADDR KSEG_F
  30. #define PAGESIZE (512)
  31. #if CONFIG_ETRAX_FLASH_BUSWIDTH==1
  32. #define flash_data __u8
  33. #elif CONFIG_ETRAX_FLASH_BUSWIDTH==2
  34. #define flash_data __u16
  35. #elif CONFIG_ETRAX_FLASH_BUSWIDTH==4
  36. #define flash_data __u32
  37. #endif
  38. /* From head.S */
  39. extern unsigned long romfs_in_flash; /* 1 when romfs_start, _length in flash */
  40. extern unsigned long romfs_start, romfs_length;
  41. extern unsigned long nand_boot; /* 1 when booted from nand flash */
  42. struct partition_name {
  43. char name[6];
  44. };
  45. /* The master mtd for the entire flash. */
  46. struct mtd_info* axisflash_mtd = NULL;
  47. /* Map driver functions. */
  48. static map_word flash_read(struct map_info *map, unsigned long ofs)
  49. {
  50. map_word tmp;
  51. tmp.x[0] = *(flash_data *)(map->map_priv_1 + ofs);
  52. return tmp;
  53. }
  54. static void flash_copy_from(struct map_info *map, void *to,
  55. unsigned long from, ssize_t len)
  56. {
  57. memcpy(to, (void *)(map->map_priv_1 + from), len);
  58. }
  59. static void flash_write(struct map_info *map, map_word d, unsigned long adr)
  60. {
  61. *(flash_data *)(map->map_priv_1 + adr) = (flash_data)d.x[0];
  62. }
  63. /*
  64. * The map for chip select e0.
  65. *
  66. * We run into tricky coherence situations if we mix cached with uncached
  67. * accesses to we only use the uncached version here.
  68. *
  69. * The size field is the total size where the flash chips may be mapped on the
  70. * chip select. MTD probes should find all devices there and it does not matter
  71. * if there are unmapped gaps or aliases (mirrors of flash devices). The MTD
  72. * probes will ignore them.
  73. *
  74. * The start address in map_priv_1 is in virtual memory so we cannot use
  75. * MEM_CSE0_START but must rely on that FLASH_UNCACHED_ADDR is the start
  76. * address of cse0.
  77. */
  78. static struct map_info map_cse0 = {
  79. .name = "cse0",
  80. .size = MEM_CSE0_SIZE,
  81. .bankwidth = CONFIG_ETRAX_FLASH_BUSWIDTH,
  82. .read = flash_read,
  83. .copy_from = flash_copy_from,
  84. .write = flash_write,
  85. .map_priv_1 = FLASH_UNCACHED_ADDR
  86. };
  87. /*
  88. * The map for chip select e1.
  89. *
  90. * If there was a gap between cse0 and cse1, map_priv_1 would get the wrong
  91. * address, but there isn't.
  92. */
  93. static struct map_info map_cse1 = {
  94. .name = "cse1",
  95. .size = MEM_CSE1_SIZE,
  96. .bankwidth = CONFIG_ETRAX_FLASH_BUSWIDTH,
  97. .read = flash_read,
  98. .copy_from = flash_copy_from,
  99. .write = flash_write,
  100. .map_priv_1 = FLASH_UNCACHED_ADDR + MEM_CSE0_SIZE
  101. };
  102. #define MAX_PARTITIONS 7
  103. #ifdef CONFIG_ETRAX_NANDBOOT
  104. #define NUM_DEFAULT_PARTITIONS 4
  105. #define DEFAULT_ROOTFS_PARTITION_NO 2
  106. #define DEFAULT_MEDIA_SIZE 0x2000000 /* 32 megs */
  107. #else
  108. #define NUM_DEFAULT_PARTITIONS 3
  109. #define DEFAULT_ROOTFS_PARTITION_NO (-1)
  110. #define DEFAULT_MEDIA_SIZE 0x800000 /* 8 megs */
  111. #endif
  112. #if (MAX_PARTITIONS < NUM_DEFAULT_PARTITIONS)
  113. #error MAX_PARTITIONS must be >= than NUM_DEFAULT_PARTITIONS
  114. #endif
  115. /* Initialize the ones normally used. */
  116. static struct mtd_partition axis_partitions[MAX_PARTITIONS] = {
  117. {
  118. .name = "part0",
  119. .size = CONFIG_ETRAX_PTABLE_SECTOR,
  120. .offset = 0
  121. },
  122. {
  123. .name = "part1",
  124. .size = 0,
  125. .offset = 0
  126. },
  127. {
  128. .name = "part2",
  129. .size = 0,
  130. .offset = 0
  131. },
  132. {
  133. .name = "part3",
  134. .size = 0,
  135. .offset = 0
  136. },
  137. {
  138. .name = "part4",
  139. .size = 0,
  140. .offset = 0
  141. },
  142. {
  143. .name = "part5",
  144. .size = 0,
  145. .offset = 0
  146. },
  147. {
  148. .name = "part6",
  149. .size = 0,
  150. .offset = 0
  151. },
  152. };
  153. /* If no partition-table was found, we use this default-set.
  154. * Default flash size is 8MB (NOR). CONFIG_ETRAX_PTABLE_SECTOR is most
  155. * likely the size of one flash block and "filesystem"-partition needs
  156. * to be >=5 blocks to be able to use JFFS.
  157. */
  158. static struct mtd_partition axis_default_partitions[NUM_DEFAULT_PARTITIONS] = {
  159. {
  160. .name = "boot firmware",
  161. .size = CONFIG_ETRAX_PTABLE_SECTOR,
  162. .offset = 0
  163. },
  164. {
  165. .name = "kernel",
  166. .size = 10 * CONFIG_ETRAX_PTABLE_SECTOR,
  167. .offset = CONFIG_ETRAX_PTABLE_SECTOR
  168. },
  169. #define FILESYSTEM_SECTOR (11 * CONFIG_ETRAX_PTABLE_SECTOR)
  170. #ifdef CONFIG_ETRAX_NANDBOOT
  171. {
  172. .name = "rootfs",
  173. .size = 10 * CONFIG_ETRAX_PTABLE_SECTOR,
  174. .offset = FILESYSTEM_SECTOR
  175. },
  176. #undef FILESYSTEM_SECTOR
  177. #define FILESYSTEM_SECTOR (21 * CONFIG_ETRAX_PTABLE_SECTOR)
  178. #endif
  179. {
  180. .name = "rwfs",
  181. .size = DEFAULT_MEDIA_SIZE - FILESYSTEM_SECTOR,
  182. .offset = FILESYSTEM_SECTOR
  183. }
  184. };
  185. #ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE
  186. /* Main flash device */
  187. static struct mtd_partition main_partition = {
  188. .name = "main",
  189. .size = 0,
  190. .offset = 0
  191. };
  192. #endif
  193. /* Auxiliary partition if we find another flash */
  194. static struct mtd_partition aux_partition = {
  195. .name = "aux",
  196. .size = 0,
  197. .offset = 0
  198. };
  199. /*
  200. * Probe a chip select for AMD-compatible (JEDEC) or CFI-compatible flash
  201. * chips in that order (because the amd_flash-driver is faster).
  202. */
  203. static struct mtd_info *probe_cs(struct map_info *map_cs)
  204. {
  205. struct mtd_info *mtd_cs = NULL;
  206. printk(KERN_INFO
  207. "%s: Probing a 0x%08lx bytes large window at 0x%08lx.\n",
  208. map_cs->name, map_cs->size, map_cs->map_priv_1);
  209. #ifdef CONFIG_MTD_CFI
  210. mtd_cs = do_map_probe("cfi_probe", map_cs);
  211. #endif
  212. #ifdef CONFIG_MTD_JEDECPROBE
  213. if (!mtd_cs)
  214. mtd_cs = do_map_probe("jedec_probe", map_cs);
  215. #endif
  216. return mtd_cs;
  217. }
  218. /*
  219. * Probe each chip select individually for flash chips. If there are chips on
  220. * both cse0 and cse1, the mtd_info structs will be concatenated to one struct
  221. * so that MTD partitions can cross chip boundries.
  222. *
  223. * The only known restriction to how you can mount your chips is that each
  224. * chip select must hold similar flash chips. But you need external hardware
  225. * to do that anyway and you can put totally different chips on cse0 and cse1
  226. * so it isn't really much of a restriction.
  227. */
  228. extern struct mtd_info* __init crisv32_nand_flash_probe (void);
  229. static struct mtd_info *flash_probe(void)
  230. {
  231. struct mtd_info *mtd_cse0;
  232. struct mtd_info *mtd_cse1;
  233. struct mtd_info *mtd_total;
  234. struct mtd_info *mtds[2];
  235. int count = 0;
  236. if ((mtd_cse0 = probe_cs(&map_cse0)) != NULL)
  237. mtds[count++] = mtd_cse0;
  238. if ((mtd_cse1 = probe_cs(&map_cse1)) != NULL)
  239. mtds[count++] = mtd_cse1;
  240. if (!mtd_cse0 && !mtd_cse1) {
  241. /* No chip found. */
  242. return NULL;
  243. }
  244. if (count > 1) {
  245. /* Since the concatenation layer adds a small overhead we
  246. * could try to figure out if the chips in cse0 and cse1 are
  247. * identical and reprobe the whole cse0+cse1 window. But since
  248. * flash chips are slow, the overhead is relatively small.
  249. * So we use the MTD concatenation layer instead of further
  250. * complicating the probing procedure.
  251. */
  252. mtd_total = mtd_concat_create(mtds, count, "cse0+cse1");
  253. if (!mtd_total) {
  254. printk(KERN_ERR "%s and %s: Concatenation failed!\n",
  255. map_cse0.name, map_cse1.name);
  256. /* The best we can do now is to only use what we found
  257. * at cse0. */
  258. mtd_total = mtd_cse0;
  259. map_destroy(mtd_cse1);
  260. }
  261. } else
  262. mtd_total = mtd_cse0 ? mtd_cse0 : mtd_cse1;
  263. return mtd_total;
  264. }
  265. /*
  266. * Probe the flash chip(s) and, if it succeeds, read the partition-table
  267. * and register the partitions with MTD.
  268. */
  269. static int __init init_axis_flash(void)
  270. {
  271. struct mtd_info *main_mtd;
  272. struct mtd_info *aux_mtd = NULL;
  273. int err = 0;
  274. int pidx = 0;
  275. struct partitiontable_head *ptable_head = NULL;
  276. struct partitiontable_entry *ptable;
  277. int ptable_ok = 0;
  278. static char page[PAGESIZE];
  279. size_t len;
  280. int ram_rootfs_partition = -1; /* -1 => no RAM rootfs partition */
  281. int part;
  282. struct mtd_partition *partition;
  283. /* We need a root fs. If it resides in RAM, we need to use an
  284. * MTDRAM device, so it must be enabled in the kernel config,
  285. * but its size must be configured as 0 so as not to conflict
  286. * with our usage.
  287. */
  288. #if !defined(CONFIG_MTD_MTDRAM) || (CONFIG_MTDRAM_TOTAL_SIZE != 0) || (CONFIG_MTDRAM_ABS_POS != 0)
  289. if (!romfs_in_flash && !nand_boot) {
  290. printk(KERN_EMERG "axisflashmap: Cannot create an MTD RAM "
  291. "device; configure CONFIG_MTD_MTDRAM with size = 0!\n");
  292. panic("This kernel cannot boot from RAM!\n");
  293. }
  294. #endif
  295. main_mtd = flash_probe();
  296. if (main_mtd)
  297. printk(KERN_INFO "%s: 0x%08llx bytes of NOR flash memory.\n",
  298. main_mtd->name, main_mtd->size);
  299. #ifdef CONFIG_ETRAX_NANDFLASH
  300. aux_mtd = crisv32_nand_flash_probe();
  301. if (aux_mtd)
  302. printk(KERN_INFO "%s: 0x%08x bytes of NAND flash memory.\n",
  303. aux_mtd->name, aux_mtd->size);
  304. #ifdef CONFIG_ETRAX_NANDBOOT
  305. {
  306. struct mtd_info *tmp_mtd;
  307. printk(KERN_INFO "axisflashmap: Set to boot from NAND flash, "
  308. "making NAND flash primary device.\n");
  309. tmp_mtd = main_mtd;
  310. main_mtd = aux_mtd;
  311. aux_mtd = tmp_mtd;
  312. }
  313. #endif /* CONFIG_ETRAX_NANDBOOT */
  314. #endif /* CONFIG_ETRAX_NANDFLASH */
  315. if (!main_mtd && !aux_mtd) {
  316. /* There's no reason to use this module if no flash chip can
  317. * be identified. Make sure that's understood.
  318. */
  319. printk(KERN_INFO "axisflashmap: Found no flash chip.\n");
  320. }
  321. #if 0 /* Dump flash memory so we can see what is going on */
  322. if (main_mtd) {
  323. int sectoraddr;
  324. for (sectoraddr = 0; sectoraddr < 2*65536+4096;
  325. sectoraddr += PAGESIZE) {
  326. main_mtd->read(main_mtd, sectoraddr, PAGESIZE, &len,
  327. page);
  328. printk(KERN_INFO
  329. "Sector at %d (length %d):\n",
  330. sectoraddr, len);
  331. print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 1, page, PAGESIZE, false);
  332. }
  333. }
  334. #endif
  335. if (main_mtd) {
  336. loff_t ptable_sector = CONFIG_ETRAX_PTABLE_SECTOR;
  337. main_mtd->owner = THIS_MODULE;
  338. axisflash_mtd = main_mtd;
  339. /* First partition (rescue) is always set to the default. */
  340. pidx++;
  341. #ifdef CONFIG_ETRAX_NANDBOOT
  342. /* We know where the partition table should be located,
  343. * it will be in first good block after that.
  344. */
  345. int blockstat;
  346. do {
  347. blockstat = mtd_block_isbad(main_mtd, ptable_sector);
  348. if (blockstat < 0)
  349. ptable_sector = 0; /* read error */
  350. else if (blockstat)
  351. ptable_sector += main_mtd->erasesize;
  352. } while (blockstat && ptable_sector);
  353. #endif
  354. if (ptable_sector) {
  355. mtd_read(main_mtd, ptable_sector, PAGESIZE, &len,
  356. page);
  357. ptable_head = &((struct partitiontable *) page)->head;
  358. }
  359. #if 0 /* Dump partition table so we can see what is going on */
  360. printk(KERN_INFO
  361. "axisflashmap: flash read %d bytes at 0x%08x, data: %8ph\n",
  362. len, CONFIG_ETRAX_PTABLE_SECTOR, page);
  363. printk(KERN_INFO
  364. "axisflashmap: partition table offset %d, data: %8ph\n",
  365. PARTITION_TABLE_OFFSET, page + PARTITION_TABLE_OFFSET);
  366. #endif
  367. }
  368. if (ptable_head && (ptable_head->magic == PARTITION_TABLE_MAGIC)
  369. && (ptable_head->size <
  370. (MAX_PARTITIONS * sizeof(struct partitiontable_entry) +
  371. PARTITIONTABLE_END_MARKER_SIZE))
  372. && (*(unsigned long*)((void*)ptable_head + sizeof(*ptable_head) +
  373. ptable_head->size -
  374. PARTITIONTABLE_END_MARKER_SIZE)
  375. == PARTITIONTABLE_END_MARKER)) {
  376. /* Looks like a start, sane length and end of a
  377. * partition table, lets check csum etc.
  378. */
  379. struct partitiontable_entry *max_addr =
  380. (struct partitiontable_entry *)
  381. ((unsigned long)ptable_head + sizeof(*ptable_head) +
  382. ptable_head->size);
  383. unsigned long offset = CONFIG_ETRAX_PTABLE_SECTOR;
  384. unsigned char *p;
  385. unsigned long csum = 0;
  386. ptable = (struct partitiontable_entry *)
  387. ((unsigned long)ptable_head + sizeof(*ptable_head));
  388. /* Lets be PARANOID, and check the checksum. */
  389. p = (unsigned char*) ptable;
  390. while (p <= (unsigned char*)max_addr) {
  391. csum += *p++;
  392. csum += *p++;
  393. csum += *p++;
  394. csum += *p++;
  395. }
  396. ptable_ok = (csum == ptable_head->checksum);
  397. /* Read the entries and use/show the info. */
  398. printk(KERN_INFO "axisflashmap: "
  399. "Found a%s partition table at 0x%p-0x%p.\n",
  400. (ptable_ok ? " valid" : "n invalid"), ptable_head,
  401. max_addr);
  402. /* We have found a working bootblock. Now read the
  403. * partition table. Scan the table. It ends with 0xffffffff.
  404. */
  405. while (ptable_ok
  406. && ptable->offset != PARTITIONTABLE_END_MARKER
  407. && ptable < max_addr
  408. && pidx < MAX_PARTITIONS - 1) {
  409. axis_partitions[pidx].offset = offset + ptable->offset;
  410. #ifdef CONFIG_ETRAX_NANDFLASH
  411. if (main_mtd->type == MTD_NANDFLASH) {
  412. axis_partitions[pidx].size =
  413. (((ptable+1)->offset ==
  414. PARTITIONTABLE_END_MARKER) ?
  415. main_mtd->size :
  416. ((ptable+1)->offset + offset)) -
  417. (ptable->offset + offset);
  418. } else
  419. #endif /* CONFIG_ETRAX_NANDFLASH */
  420. axis_partitions[pidx].size = ptable->size;
  421. #ifdef CONFIG_ETRAX_NANDBOOT
  422. /* Save partition number of jffs2 ro partition.
  423. * Needed if RAM booting or root file system in RAM.
  424. */
  425. if (!nand_boot &&
  426. ram_rootfs_partition < 0 && /* not already set */
  427. ptable->type == PARTITION_TYPE_JFFS2 &&
  428. (ptable->flags & PARTITION_FLAGS_READONLY_MASK) ==
  429. PARTITION_FLAGS_READONLY)
  430. ram_rootfs_partition = pidx;
  431. #endif /* CONFIG_ETRAX_NANDBOOT */
  432. pidx++;
  433. ptable++;
  434. }
  435. }
  436. /* Decide whether to use default partition table. */
  437. /* Only use default table if we actually have a device (main_mtd) */
  438. partition = &axis_partitions[0];
  439. if (main_mtd && !ptable_ok) {
  440. memcpy(axis_partitions, axis_default_partitions,
  441. sizeof(axis_default_partitions));
  442. pidx = NUM_DEFAULT_PARTITIONS;
  443. ram_rootfs_partition = DEFAULT_ROOTFS_PARTITION_NO;
  444. }
  445. /* Add artificial partitions for rootfs if necessary */
  446. if (romfs_in_flash) {
  447. /* rootfs is in directly accessible flash memory = NOR flash.
  448. Add an overlapping device for the rootfs partition. */
  449. printk(KERN_INFO "axisflashmap: Adding partition for "
  450. "overlapping root file system image\n");
  451. axis_partitions[pidx].size = romfs_length;
  452. axis_partitions[pidx].offset = romfs_start - FLASH_CACHED_ADDR;
  453. axis_partitions[pidx].name = "romfs";
  454. axis_partitions[pidx].mask_flags |= MTD_WRITEABLE;
  455. ram_rootfs_partition = -1;
  456. pidx++;
  457. } else if (romfs_length && !nand_boot) {
  458. /* romfs exists in memory, but not in flash, so must be in RAM.
  459. * Configure an MTDRAM partition. */
  460. if (ram_rootfs_partition < 0) {
  461. /* None set yet, put it at the end */
  462. ram_rootfs_partition = pidx;
  463. pidx++;
  464. }
  465. printk(KERN_INFO "axisflashmap: Adding partition for "
  466. "root file system image in RAM\n");
  467. axis_partitions[ram_rootfs_partition].size = romfs_length;
  468. axis_partitions[ram_rootfs_partition].offset = romfs_start;
  469. axis_partitions[ram_rootfs_partition].name = "romfs";
  470. axis_partitions[ram_rootfs_partition].mask_flags |=
  471. MTD_WRITEABLE;
  472. }
  473. #ifdef CONFIG_ETRAX_AXISFLASHMAP_MTD0WHOLE
  474. if (main_mtd) {
  475. main_partition.size = main_mtd->size;
  476. err = mtd_device_register(main_mtd, &main_partition, 1);
  477. if (err)
  478. panic("axisflashmap: Could not initialize "
  479. "partition for whole main mtd device!\n");
  480. }
  481. #endif
  482. /* Now, register all partitions with mtd.
  483. * We do this one at a time so we can slip in an MTDRAM device
  484. * in the proper place if required. */
  485. for (part = 0; part < pidx; part++) {
  486. if (part == ram_rootfs_partition) {
  487. /* add MTDRAM partition here */
  488. struct mtd_info *mtd_ram;
  489. mtd_ram = kmalloc(sizeof(struct mtd_info), GFP_KERNEL);
  490. if (!mtd_ram)
  491. panic("axisflashmap: Couldn't allocate memory "
  492. "for mtd_info!\n");
  493. printk(KERN_INFO "axisflashmap: Adding RAM partition "
  494. "for rootfs image.\n");
  495. err = mtdram_init_device(mtd_ram,
  496. (void *)(u_int32_t)partition[part].offset,
  497. partition[part].size,
  498. partition[part].name);
  499. if (err)
  500. panic("axisflashmap: Could not initialize "
  501. "MTD RAM device!\n");
  502. /* JFFS2 likes to have an erasesize. Keep potential
  503. * JFFS2 rootfs happy by providing one. Since image
  504. * was most likely created for main mtd, use that
  505. * erasesize, if available. Otherwise, make a guess. */
  506. mtd_ram->erasesize = (main_mtd ? main_mtd->erasesize :
  507. CONFIG_ETRAX_PTABLE_SECTOR);
  508. } else {
  509. err = mtd_device_register(main_mtd, &partition[part],
  510. 1);
  511. if (err)
  512. panic("axisflashmap: Could not add mtd "
  513. "partition %d\n", part);
  514. }
  515. }
  516. if (aux_mtd) {
  517. aux_partition.size = aux_mtd->size;
  518. err = mtd_device_register(aux_mtd, &aux_partition, 1);
  519. if (err)
  520. panic("axisflashmap: Could not initialize "
  521. "aux mtd device!\n");
  522. }
  523. return err;
  524. }
  525. /* This adds the above to the kernels init-call chain. */
  526. module_init(init_axis_flash);
  527. EXPORT_SYMBOL(axisflash_mtd);