Skip to contentSkip to conversation

MTD: Add support for the MPC8xxADS boards

PATCH In review Vitaly Bordug 3 participants 3 messages Nov 28, 2005 – Nov 29, 2005 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MTD: Add support for the MPC8xxADS boards

The following patch adds support for the JEDEC-compatible flashes on the MPC8xxADS boards. Currently verified with MPC885ADS and MPC 866ADS. The patch is against MTD git tree.

Signature · 1 line
Sincerely, Vitaly
drivers/mtd/maps/Kconfig +8 -0
index 846a533..1ece64c 100644
@@ -284,6 +284,14 @@ config MTD_MBX860
 	  MBX860 board. If you have one of these boards and would like
 	  to use the flash chips on it, say 'Y'.
 
+config MTD_MPC8xxADS
+	tristate "JEDEC flash SIMM mapped on MPC8xxADS boards"
+	depends on (MPC885ADS || MPC86XADS) && MTD_PARTITIONS && MTD_JEDECPROBE && MTD_PHYSMAP && MTD_CFI_GEOMETRY && MTD_CFI_INTELEXT
+	help
+	  This enables access routines for the flash chips on the Freescale
+	  MPC8xxADS boards. If you have this board and would like
+	  to use the flash chips on it, say 'Y'.
+
 config MTD_DBOX2
 	tristate "CFI Flash device mapped on D-Box2"
 	depends on DBOX2 && MTD_CFI_INTELSTD && MTD_CFI_INTELEXT && MTD_CFI_AMDSTD
drivers/mtd/maps/Makefile +1 -0
index 7d9e940..913def2 100644
@@ -73,3 +73,4 @@ obj-$(CONFIG_MTD_OMAP_NOR)	+= omap_nor.o
 obj-$(CONFIG_MTD_PQ2FADS)	+= pq2fads.o
 obj-$(CONFIG_MTD_MTX1)		+= mtx-1_flash.o
 obj-$(CONFIG_MTD_TQM834x)	+= tqm834x.o
+obj-$(CONFIG_MTD_MPC8xxADS)	+= mpc8xxads.o
drivers/mtd/maps/mpc8xxads.c new file +63 -0

63 lines not on this page · raw message

#1 lore raw
Quoted 2 lines · Vitaly Bordug

The following patch adds support for the JEDEC-compatible flashes on the MPC8xxADS boards.

Can you please explain how this is supposed to work ?

In any case whether compiled as module or compiled in the init code of the physmap driver is called before the init code of your board driver. The physmap_configure() call is just bogus as it overwrites the compiled in values of the physmap_map structure in physmap.c after the flash was detected (or not detected) with the compiled in defaults.

Also this code was never compiled and used as a module.

Quoted 2 lines

Currently verified with MPC885ADS and MPC 866ADS. The patch is against MTD git tree.

Currently verified means: it compiles when the config switch is equal "Y" and the resulting kernel does not oops, right ?

The physmap driver has to be either used with the compiled in address, size and bankwidth settings or the values have to be set by the early boot code of the board. Grep through arch/mips to find the two lonely, but correct, users of physmap_configure().

The same applies for the pq2fads driver. The pq2fads driver is hereby scheduled for removal.

tglx

#2 lore raw
In reply to Vitaly Bordug

Hi Vitaly (no, I'm not talking to myself! :) ),

drivers/mtd/maps/mpc8xxads.c line 46

Quoted 8 lines · Vitaly Bordug
drivers/mtd/maps/mpc8xxads.c new file +6 -0
+/* pointer to MPC885ADS board info data */
+extern unsigned char __res[];
+
+static int __init init_mpc8xxads_mtd(void)
+{
+	bd_t *bd = (bd_t *)__res;

I'd like to suggest using platform_data here instead of this global. Please see how mainstone-flash.c is organized as an example.

Best regards,
Vitaly