Skip to contentSkip to conversation

2.4 stuff.

DISCUSSION Erwin Authried 2 participants 2 messages Nov 21, 2000 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

I had to make a few changes to the inter_module stuff to get MTD working for uClinux.The changes are explained below. They are not yet comitted, please let me know what you think.

-Erwin

* map_rom.c
There is a im_name member used in map_rom.c, line 51. Has this been added by mistake? In mtd.h, there's no such member.

* compatmac.h:
For 2.0, the inter_module_* functions are defined as empty macros if CONFIG_MODULES is not defined. If CONFIG_MODULES is defined (for 2.0), compilation is stopped with #error saying that it's not possible to use MTD in 2.0 kernels with module support enabled.

* I have removed the "static" for the cfi_cmdset_0001/0002 probe functions.

* I have added a switch statement for compilation without module support in cfi_probe.c:

+#ifdef CONFIG_MODULES

        sprintf(probename, "cfi_cmdset_%4.4X", type);

        probe_function = inter_module_get_request(probename, probename);
@@ -743,6 +747,20 @@
                (*probe_function)(map, primary, base);
                return;
        }

+#else
+ switch(type){
+#ifdef CONFIG_MTD_CFI_INTELEXT
+ case 0x0001:
+ cfi_cmdset_0001(map,primary,base);
+ return;
+#endif
+#ifdef CONFIG_MTD_CFI_AMDSTD
+ case 0x0002:
+ cfi_cmdset_0002(map,primary,base);
+ return;
+#endif
+ }
+#endif /* CONFIG_MODULES */

To unsubscribe, send "unsubscribe mtd" to [email protected]

#1 lore raw
Quoted 2 lines · [email protected] said:

* map_rom.c There is a im_name member used in map_rom.c, line 51. Has
this been added by mistake? In mtd.h, there's no such member.

Mea Culpa. Should be map->im_name, not mtd->im_name. Fixed. Thanks.

Quoted 4 lines · [email protected] said:

* compatmac.h: For 2.0, the inter_module_* functions are defined as empty macros if CONFIG_MODULES is not defined. If CONFIG_MODULES is defined (for 2.0), compilation is stopped with #error saying that it's not possible to use MTD in 2.0 kernels with module support enabled.

Careful not to make the #error break stuff that does actually work. If you're compiling in all the stuff that you're actually going to need, but also have CONFIG_MODULES, it should all work, shouldn't it?

It might be better to define the inter_module_get() functions to return NULL but printk a warning that they've been used - which should explain to the user why it's not actually working for them.

Quoted 2 lines · [email protected] said:

* I have removed the "static" for the cfi_cmdset_0001/0002 probe
functions.

OK.

Quoted 2 lines · [email protected] said:

* I have added a switch statement for compilation without module
support in cfi_probe.c:

Looks sensible, and could also help to get rid of the ugly link order dependencies that the inter_module_xxx stuff has introduced. I've modified it to:

	switch(type){
#ifdef CONFIG_MTD_CFI_INTELEXT
	case 0x0001:
		cfi_cmdset_0001(map,primary,base);
		return;
#endif
#ifdef CONFIG_MTD_CFI_AMDSTD
	case 0x0002:
		cfi_cmdset_0002(map,primary,base);
		return;
#endif
	default:
#ifdef CONFIG_MODULES
		sprintf(probename, "cfi_cmdset_%4.4X", type);
		
		probe_function = inter_module_get_request(probename, probename);
		if (probe_function) {
			(*probe_function)(map, primary, base);
			return;
		}	
#endif
	}

--
dwmw2

To unsubscribe, send "unsubscribe mtd" to [email protected]