NatSemi SCx200 Support
Subsystems (6)
PATCH 1/1 NatSemi SCx200 Support
Hi,
this is a patch to add support for the National Semiconductor SC1200, SC2200 and SC3200 families of processors to the Linux kernel. I hope this is suitable for the mainstream kernel.
The drivers adds a generic file, arch/i386/kernel/scx200.c that probes for a SCx200 CPU and allocates resources. This file also provides support for the GPIO pins on the CPU. Then there are drivers for individual features of the CPU such as the on chip watchdog timer, using two GPIO pins as an I2C bus and using a flash chip connected directly to the CPU.
Finally, there is one file arch/i386/kernel/scx200_nano.c which is very specific for our hardware. This file configures the chipset, doing some hardware specific pin remappings and fixups for the BIOS. You might want to skip this file, but in my opinion the file isn't large and only touches the rest of the code to add a call to the init functions so I belive it belongs in the mainstream kernel too. Please tell me if you want a patch without the nano-specific part.
/Christer
MAINTAINERS renamed from MAINTAINERS.orig +6 -0
@@ -1355,6 +1355,12 @@ L: [email protected] S: Maintained +SCx200 CPU SUPPORT +P: Christer Weinigel +M: [email protected] +W: http://www.nano-system.com +S: Supported + SGI VISUAL WORKSTATION 320 AND 540 P: Bent Hagemark M: [email protected]
Documentation/Configure.help +60 -0
66 lines not on this page · raw message
arch/i386/config.in +3 -0
@@ -235,6 +235,9 @@ fi fi +tristate 'National Geode SCx200 support' CONFIG_ARCH_SCx200 +dep_tristate ' Nano Computer support' CONFIG_ARCH_SCx200_NANO $CONFIG_ARCH_SCx200 + source drivers/pci/Config.in bool 'EISA support' CONFIG_EISA
arch/i386/kernel/Makefile +4 -0
@@ -41,4 +41,8 @@ obj-$(CONFIG_X86_IO_APIC) += io_apic.o acpitable.o obj-$(CONFIG_X86_VISWS_APIC) += visws_apic.o +export-objs += scx200.o +obj-$(CONFIG_ARCH_SCx200) += scx200.o +obj-$(CONFIG_ARCH_SCx200_NANO) += scx200_nano.o + include $(TOPDIR)/Rules.make
arch/i386/kernel/scx200.c new file +240 -0
240 lines not on this page · raw message
arch/i386/kernel/scx200_nano.c new file +192 -0
192 lines not on this page · raw message
drivers/char/Config.in +1 -0
@@ -168,6 +168,7 @@ tristate ' IB700 SBC Watchdog Timer' CONFIG_IB700_WDT tristate ' Intel i810 TCO timer / Watchdog' CONFIG_I810_TCO tristate ' Mixcom Watchdog' CONFIG_MIXCOMWD + dep_tristate ' NatSemi SCx200 Watchdog' CONFIG_SCx200_WATCHDOG $CONFIG_ARCH_SCx200 tristate ' SBC-60XX Watchdog Timer' CONFIG_60XX_WDT tristate ' W83877F (EMACS) Watchdog Timer' CONFIG_W83877F_WDT tristate ' ZF MachZ Watchdog' CONFIG_MACHZ_WDT
drivers/char/Makefile +1 -0
@@ -235,6 +235,7 @@ obj-$(CONFIG_SH_WDT) += shwdt.o obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o +obj-$(CONFIG_SCx200_WATCHDOG) += scx200_watchdog.o subdir-$(CONFIG_MWAVE) += mwave ifeq ($(CONFIG_MWAVE),y)
drivers/char/scx200_watchdog.c new file +263 -0
263 lines not on this page · raw message
drivers/i2c/Config.in +5 -0
@@ -13,6 +13,11 @@ dep_tristate ' Philips style parallel port adapter' CONFIG_I2C_PHILIPSPAR $CONFIG_I2C_ALGOBIT $CONFIG_PARPORT dep_tristate ' ELV adapter' CONFIG_I2C_ELV $CONFIG_I2C_ALGOBIT dep_tristate ' Velleman K9000 adapter' CONFIG_I2C_VELLEMAN $CONFIG_I2C_ALGOBIT + dep_tristate ' NatSemi SCx200 I2C using GPIO pins' CONFIG_I2C_SCx200 $CONFIG_ARCH_SCx200 $CONFIG_I2C_ALGOBIT + if [ "$CONFIG_I2C_SCx200" != "n" ]; then + int ' GPIO pin used for SCL' CONFIG_I2C_SCx200_SCL -1 + int ' GPIO pin used for SDA' CONFIG_I2C_SCx200_SDA -1 + fi fi dep_tristate 'I2C PCF 8584 interfaces' CONFIG_I2C_ALGOPCF $CONFIG_I2C
drivers/i2c/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_ITE_I2C_ALGO) += i2c-algo-ite.o obj-$(CONFIG_ITE_I2C_ADAP) += i2c-adap-ite.o obj-$(CONFIG_I2C_PROC) += i2c-proc.o +obj-$(CONFIG_I2C_SCx200) += scx200_i2c.o obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest.o # This is needed for automatic patch generation: sensors code starts here
drivers/i2c/scx200_i2c.c new file +151 -0
151 lines not on this page · raw message
drivers/mtd/maps/Config.in +1 -0
@@ -27,6 +27,7 @@ dep_tristate ' JEDEC Flash device mapped on Octagon 5066 SBC' CONFIG_MTD_OCTAGON $CONFIG_MTD_JEDEC dep_tristate ' JEDEC Flash device mapped on Tempustech VMAX SBC301' CONFIG_MTD_VMAX $CONFIG_MTD_JEDEC dep_tristate ' BIOS flash chip on Intel L440GX boards' CONFIG_MTD_L440GX $CONFIG_I386 $CONFIG_MTD_JEDEC + dep_tristate ' Flash device mapped with DOCCS on NatSemi SCx200' CONFIG_MTD_SCx200_DOCFLASH $CONFIG_ARCH_SCx200 $CONFIG_MTD_CFI $CONFIG_MTD_PARTITIONS fi if [ "$CONFIG_PPC" = "y" ]; then
drivers/mtd/maps/Makefile +1 -0
@@ -29,5 +29,6 @@ obj-$(CONFIG_MTD_DBOX2) += dbox2-flash.o obj-$(CONFIG_MTD_OCELOT) += ocelot.o obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o +obj-$(CONFIG_MTD_SCx200_DOCFLASH)+= scx200_docflash.o include $(TOPDIR)/Rules.make
drivers/mtd/maps/scx200_docflash.c new file +177 -0
177 lines not on this page · raw message
include/linux/pci_ids.h +6 -0
@@ -287,6 +287,12 @@#define PCI_DEVICE_ID_NS_87560_USB 0x0012#define PCI_DEVICE_ID_NS_83815 0x0020#define PCI_DEVICE_ID_NS_83820 0x0022 +#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500 +#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501 +#define PCI_DEVICE_ID_NS_SCx200_IDE 0x0502 +#define PCI_DEVICE_ID_NS_SCx200_AUDIO 0x0503 +#define PCI_DEVICE_ID_NS_SCx200_VIDEO 0x0504 +#define PCI_DEVICE_ID_NS_SCx200_XBUS 0x0505#define PCI_DEVICE_ID_NS_87410 0xd001#define PCI_VENDOR_ID_TSENG 0x100c
include/linux/scx200.h new file +110 -0
110 lines not on this page · raw message
init/main.c +4 -0
@@ -94,6 +94,7 @@extern void sysctl_init (void );extern void signals_init (void );extern int init_pcmcia_ds (void ); +extern int scx200_init (void );extern void free_initmem (void );
@@ -729,6 +730,9 @@#endif #ifdef CONFIG_TC tc_init (); +#endif +#ifdef CONFIG_ARCH_SCx200 +scx200_init ();#endif /* Networking initialization needs a process context */
Signature · 1 line
"Just how much can I get away with and still go to heaven?"
Christer,
Your patch does not apply cleanly to my tree, probably due to some already applied patches.
Please regenerate your patch against -pre2 as soon as its released.
Quoted 5 lines · Christer Weinigel
Hi,
this is a patch to add support for the National Semiconductor SC1200, SC2200 and SC3200 families of processors to the Linux kernel. I hope this is suitable for the mainstream kernel.
Quoted 4 lines · Marcelo Tosatti
Your patch does not apply cleanly to my tree, probably due to some already applied patches.
Please regenerate your patch against -pre2 as soon as its released.
This is an updated patch for SCx200 support. This patch is against linux-2.4.19-pre2 and adds support for some SCx200 specific features such as the GPIO pins, the watchdog and flash mapping via the DOCCS pin. Compared to the earlier patch, I've cleaned up a few more things, and have also added a driver for the ACCESS.bus found in the SCx200 CPUs.
BTW, what format do you preferr the patches in? Should I place them inline in the body of the mail or as an attachment as here?
/Christer
Signature · 1 line
"Just how much can I get away with and still go to heaven?"
Documentation/Configure.help +68 -0
@@ -24451,6 +24451,74 @@ information: http://www.candelatech.com/~greear/vlan.html If unsure, you can safely say 'N'. +National Geode SCx200 support +CONFIG_ARCH_SCx200 + This provides basic support for the features of a National + Semiconductor SCx200 processor. + + If you don't know what to do here, say N. + + This support is also available as a module. You probably don't want + to do this unless you are a developer modifying this driver. If + compiled as a module, it will be called scx200.o. + +Nano Computer support +CONFIG_ARCH_SCx200_NANO + The Nano Computer is a SC2200 based computer from Nano Computer + Systems AB, URL: <http://www.nano-system.com>. Say Y here to create + a kernel that will have support for the Nano Computer. + + WARNING! Do NOT run a kernel compiled for the Nano Computer on any + other SC2200 platform; doing so could potentially do bad things to + your computer, such as fry your TFT screen. + + This support is also available as a module. You probably don't want + to do this unless you are a developer modifying this driver. If + compiled as a module, it will be called scx200_nano.o. + +NatSemi SCx200 Watchdog +CONFIG_SCx200_WATCHDOG + Enable the built-in watchdog timer support on SCx200 processors. + + If compiled as a module, it will be called scx200_watchdog.o. + +NatSemi SCx200 I2C using GPIO pins +CONFIG_SCx200_I2C + Enable the use of two GPIO pins of a SCx200 processor as an I2C bus. + + If you don't know what to do here, say N. + + If compiled as a module, it will be called scx200_i2c.o. + +GPIO pin used for SCL +CONFIG_SCx200_I2C_SCL + Enter the GPIO pin number used for the SCL signal. This value can + also be specified with a module parameter, if you want to do that, + leave the value as -1. + +GPIO pin used for SDA +CONFIG_SCx200_I2C_SDA + Enter the GPIO pin number used for the SSA signal. This value can + also be specified with a module parameter, if you want to do that, + leave the value as -1. + +NatSemi SCx200 ACCESS.bus +CONFIG_SCx200_AB + Enable the use of the ACCESS.bus controllers of a SCx200 processor. + + If you don't know what to do here, say N. + + If compiled as a module, it will be called scx200_ab.o. + +Flash device mapped with DOCCS on NatSemi SCx200 +CONFIG_MTD_SCx200_DOCFLASH + Enable support for an CFI flash mapped using the DOCCS signal on a + SCx200 processor. + + If you don't know what to do here, say N. + + If compiled as a module, it will be called scx200_docflash.o. + # # A couple of things I keep forgetting: # capitalize: AppleTalk, Ethernet, DOS, DMA, FAT, FTP, Internet,
MAINTAINERS +6 -0
@@ -1375,6 +1375,12 @@ L: [email protected] S: Maintained +SCx200 CPU SUPPORT +P: Christer Weinigel +M: [email protected] +W: http://www.nano-system.com +S: Supported + SGI VISUAL WORKSTATION 320 AND 540 P: Bent Hagemark M: [email protected]
arch/i386/config.in +3 -0
@@ -238,6 +238,9 @@ fi fi +tristate 'National Geode SCx200 support' CONFIG_ARCH_SCx200 +dep_tristate ' Nano Computer support' CONFIG_ARCH_SCx200_NANO $CONFIG_ARCH_SCx200 + source drivers/pci/Config.in bool 'EISA support' CONFIG_EISA
arch/i386/kernel/Makefile +4 -0
@@ -41,4 +41,8 @@ obj-$(CONFIG_X86_IO_APIC) += io_apic.o acpitable.o obj-$(CONFIG_X86_VISWS_APIC) += visws_apic.o +export-objs += scx200.o +obj-$(CONFIG_ARCH_SCx200) += scx200.o +obj-$(CONFIG_ARCH_SCx200_NANO) += scx200_nano.o + include $(TOPDIR)/Rules.make
arch/i386/kernel/scx200.c +241 -0
241 lines not on this page · raw message
arch/i386/kernel/scx200_nano.c +197 -0
197 lines not on this page · raw message
Binary files linux-2.4.19-pre2/core and linux/core differ
drivers/char/Config.in +1 -0
@@ -196,6 +196,7 @@ tristate ' IB700 SBC Watchdog Timer' CONFIG_IB700_WDT tristate ' Intel i810 TCO timer / Watchdog' CONFIG_I810_TCO tristate ' Mixcom Watchdog' CONFIG_MIXCOMWD + dep_tristate ' NatSemi SCx200 Watchdog' CONFIG_SCx200_WATCHDOG $CONFIG_ARCH_SCx200 tristate ' SBC-60XX Watchdog Timer' CONFIG_60XX_WDT tristate ' W83877F (EMACS) Watchdog Timer' CONFIG_W83877F_WDT tristate ' ZF MachZ Watchdog' CONFIG_MACHZ_WDT
drivers/char/Makefile +1 -0
@@ -247,6 +247,7 @@ obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o obj-$(CONFIG_INDYDOG) += indydog.o +obj-$(CONFIG_SCx200_WATCHDOG) += scx200_watchdog.o subdir-$(CONFIG_MWAVE) += mwave ifeq ($(CONFIG_MWAVE),y)
drivers/char/scx200_watchdog.c +263 -0
263 lines not on this page · raw message
drivers/i2c/Config.in +6 -0
@@ -13,6 +13,12 @@ dep_tristate ' Philips style parallel port adapter' CONFIG_I2C_PHILIPSPAR $CONFIG_I2C_ALGOBIT $CONFIG_PARPORT dep_tristate ' ELV adapter' CONFIG_I2C_ELV $CONFIG_I2C_ALGOBIT dep_tristate ' Velleman K9000 adapter' CONFIG_I2C_VELLEMAN $CONFIG_I2C_ALGOBIT + dep_tristate ' NatSemi SCx200 I2C using GPIO pins' CONFIG_SCx200_I2C $CONFIG_ARCH_SCx200 $CONFIG_I2C_ALGOBIT + if [ "$CONFIG_I2C_SCx200" != "n" ]; then + int ' GPIO pin used for SCL' CONFIG_SCx200_I2C_SCL -1 + int ' GPIO pin used for SDA' CONFIG_SCx200_I2C_SDA -1 + fi + dep_tristate ' NatSemi SCx200 ACCESS.bus' CONFIG_SCx200_AB $CONFIG_ARCH_SCx200 fi dep_tristate 'I2C PCF 8584 interfaces' CONFIG_I2C_ALGOPCF $CONFIG_I2C
drivers/i2c/Makefile +2 -0
@@ -18,6 +18,8 @@ obj-$(CONFIG_ITE_I2C_ALGO) += i2c-algo-ite.o obj-$(CONFIG_ITE_I2C_ADAP) += i2c-adap-ite.o obj-$(CONFIG_I2C_PROC) += i2c-proc.o +obj-$(CONFIG_SCx200_I2C) += scx200_i2c.o +obj-$(CONFIG_SCx200_AB) += scx200_ab.o obj-$(CONFIG_I2C_KEYWEST) += i2c-keywest.o # This is needed for automatic patch generation: sensors code starts here
drivers/i2c/scx200_ab.c +583 -0
583 lines not on this page · raw message
drivers/i2c/scx200_i2c.c +153 -0
153 lines not on this page · raw message
drivers/mtd/maps/Config.in +1 -0
@@ -27,6 +27,7 @@ dep_tristate ' JEDEC Flash device mapped on Octagon 5066 SBC' CONFIG_MTD_OCTAGON $CONFIG_MTD_JEDEC dep_tristate ' JEDEC Flash device mapped on Tempustech VMAX SBC301' CONFIG_MTD_VMAX $CONFIG_MTD_JEDEC dep_tristate ' BIOS flash chip on Intel L440GX boards' CONFIG_MTD_L440GX $CONFIG_I386 $CONFIG_MTD_JEDEC + dep_tristate ' Flash device mapped with DOCCS on NatSemi SCx200' CONFIG_MTD_SCx200_DOCFLASH $CONFIG_ARCH_SCx200 $CONFIG_MTD_CFI $CONFIG_MTD_PARTITIONS fi if [ "$CONFIG_PPC" = "y" ]; then
drivers/mtd/maps/Makefile +1 -0
@@ -31,5 +31,6 @@ obj-$(CONFIG_MTD_SOLUTIONENGINE)+= solutionengine.o obj-$(CONFIG_MTD_PB1000) += pb1xxx-flash.o obj-$(CONFIG_MTD_PB1500) += pb1xxx-flash.o +obj-$(CONFIG_MTD_SCx200_DOCFLASH)+= scx200_docflash.o include $(TOPDIR)/Rules.make
drivers/mtd/maps/scx200_docflash.c +177 -0
177 lines not on this page · raw message
include/linux/pci_ids.h +6 -0
@@ -287,6 +287,12 @@#define PCI_DEVICE_ID_NS_87560_USB 0x0012#define PCI_DEVICE_ID_NS_83815 0x0020#define PCI_DEVICE_ID_NS_83820 0x0022 +#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500 +#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501 +#define PCI_DEVICE_ID_NS_SCx200_IDE 0x0502 +#define PCI_DEVICE_ID_NS_SCx200_AUDIO 0x0503 +#define PCI_DEVICE_ID_NS_SCx200_VIDEO 0x0504 +#define PCI_DEVICE_ID_NS_SCx200_XBUS 0x0505#define PCI_DEVICE_ID_NS_87410 0xd001#define PCI_VENDOR_ID_TSENG 0x100c
include/linux/scx200.h +110 -0
110 lines not on this page · raw message
init/main.c +4 -0
@@ -94,6 +94,7 @@extern void sysctl_init (void );extern void signals_init (void );extern int init_pcmcia_ds (void ); +extern int scx200_init (void );extern void free_initmem (void );
@@ -514,6 +515,9 @@#endif #ifdef CONFIG_TC tc_init (); +#endif +#ifdef CONFIG_ARCH_SCx200 +scx200_init ();#endif /* Networking initialization needs a process context */
On Sat, 2 Mar 2002 17:01:10 +0100 (CET) Christer Weinigel <[email protected]> wrote:
| Marcelo Tosatti <[email protected]> wrote: | > Your patch does not apply cleanly to my tree, probably due to some | > already applied patches. | > | > Please regenerate your patch against -pre2 as soon as its released. | | This is an updated patch for SCx200 support. This patch is against | linux-2.4.19-pre2 and adds support for some SCx200 specific features | such as the GPIO pins, the watchdog and flash mapping via the DOCCS | pin. Compared to the earlier patch, I've cleaned up a few more | things, and have also added a driver for the ACCESS.bus found in the | SCx200 CPUs.
There's a typo in drivers/i2c/Config.in. CONFIG_SCx200_I2C is defined but CONFIG_I2C_SCx200 is tested...
+ dep_tristate ' NatSemi SCx200 I2C using GPIO pins' CONFIG_SCx200_I2C $CONFIG_ARCH_SCx200 $CONFIG_I2C_ALGOBIT
+ if [ "$CONFIG_I2C_SCx200" != "n" ]; then
^^^^^^^^^^^^^^^^^
this should be CONFIG_SCx200_I2C
Regards,
Thibaut
Review
Quoted 7 lines · Thibaut Laurent
There's a typo in
drivers/i2c/Config.in.CONFIG_SCx200_I2Cis defined butCONFIG_I2C_SCx200is tested...(quoted diff) +2
-0+ dep_tristate ' NatSemi SCx200 I2C using GPIO pins' CONFIG_SCx200_I2C $CONFIG_ARCH_SCx200 $CONFIG_I2C_ALGOBIT + if [ "$CONFIG_I2C_SCx200" != "n" ]; then ^^^^^^^^^^^^^^^^^ this should be CONFIG_SCx200_I2C
You are absolutely correct. I switched the names around and must have missed that. A patch is attached.
Thanks,
/Christer
drivers/i2c/Config.in renamed from drivers/i2c/Config.in.orig +1 -1
@@ -14,7 +14,7 @@ dep_tristate ' ELV adapter' CONFIG_I2C_ELV $CONFIG_I2C_ALGOBIT dep_tristate ' Velleman K9000 adapter' CONFIG_I2C_VELLEMAN $CONFIG_I2C_ALGOBIT dep_tristate ' NatSemi SCx200 I2C using GPIO pins' CONFIG_SCx200_I2C $CONFIG_ARCH_SCx200 $CONFIG_I2C_ALGOBIT - if [ "$CONFIG_I2C_SCx200" != "n" ]; then + if [ "$CONFIG_SCx200_I2C" != "n" ]; then int ' GPIO pin used for SCL' CONFIG_SCx200_I2C_SCL -1 int ' GPIO pin used for SDA' CONFIG_SCx200_I2C_SDA -1 fi
Signature · 1 line
"Just how much can I get away with and still go to heaven?"