make swarm compile and run again
PATCH 1/1 make swarm compile and run again
Ralf,
This patch makes swarm compile and run again on 2.6.
I had to introduce a global function pointer, board_pcibios_init. This setup needs ioremap() which is too early for any other board setup hooks.
I think other boards will need this hookup too (e.g., NEC vr7701)
Does the patch look ok?
Jun
arch/mips/pci/pci.c renamed from arch/mips/pci/pci.c.orig +5 -0
@@ -28,6 +28,8 @@unsigned int pci_probe =PCI_ASSIGN_ALL_BUSSES ; +void (*board_pcibios_init)(void )__initdata ; +/* * The PCI controller list. */
@@ -118,6 +120,9 @@int next_busno;int need_domain_info =0 ; +if (board_pcibios_init) +board_pcibios_init (); +/* Scan all of the recorded PCI controllers. */ for (next_busno =0 , hose = hose_head; hose; hose = hose->next) {
arch/mips/pci/pci-sb1250.c renamed from arch/mips/pci/pci-sb1250.c.orig +14 -1
@@ -84,6 +84,11 @@ *(u32 *) (cfg_space + (addr & ~3 )) = data; } +int pcibios_map_irq (struct pci_dev *dev,u8 slot,u8 pin) +{ +return dev->irq; +} +/* * Some checks before doing config cycles: * In PCI Device Mode, hide everything on bus 0 except the LDT host
@@ -194,10 +199,18 @@ .io_resource = &sb1250_io_resource }; -int __init pcibios_init(void) xxx This needs to be called somehow ... +int __init sb1250_pcibios_init (void ) {uint32_t cmdreg;uint64_t reg; +extern int pci_probe_only; + +/* CFE will assign PCI resources */ + pci_probe_only =1 ; + +/* fake resource limit to avoid errors */ + iomem_resource.end =0xffffffff ; + ioport_resource.end =0xffffffff ; cfg_space =ioremap (A_PHYS_LDTPCI_CFG_MATCH_BITS ,16 *1024 *1024 );
arch/mips/sibyte/swarm/setup.c renamed from arch/mips/sibyte/swarm/setup.c.orig +9 -1
@@ -34,12 +34,14 @@#include <asm/reboot.h> #include <asm/time.h> #include <asm/traps.h> +#include <asm/pci_channel.h> #include <asm/sibyte/sb1250.h> #include <asm/sibyte/sb1250_regs.h> #include <asm/sibyte/sb1250_genbus.h> #include <asm/sibyte/board.h> extern void sb1250_setup (void ); +extern void sb1250_pcibios_init (void );extern int xicor_probe (void );extern int xicor_set_time (unsigned long );
@@ -80,7 +82,7 @@return (is_fixup ?MIPS_BE_FIXUP :MIPS_BE_FATAL ); } -static void __init swarm_setup (void ) +static int __init swarm_setup (void ) {extern int panic_timeout;
@@ -131,6 +133,12 @@ };/* XXXKW for CFE, get lines/cols from environment */ #endif + +#ifdef CONFIG_SIBYTE_HAS_PCI + board_pcibios_init = sb1250_pcibios_init; +#endif + +return 0 ; }early_initcall (swarm_setup);
diff -Nru linux/drivers/net/sb1250-mac.c.orig linux/drivers/net/sb1250-mac.c
include/asm-mips/sibyte/board.h renamed from include/asm-mips/sibyte/board.h.orig +0 -2
@@ -56,8 +56,6 @@#else -void swarm_setup (void ); -#ifdef LEDS_PHYS extern void setleds (char *str);#else
include/asm-mips/pci_channel.h renamed from include/asm-mips/pci_channel.h.orig +6 -0
@@ -43,4 +43,10 @@*/ extern int pcibios_map_irq (struct pci_dev *dev,u8 slot,u8 pin); +/* +* board pci initialization routine. If set, it is called at the beginning +* of pcibios_init(). +*/ +extern void (*board_pcibios_init)(void ); +#endif /* __ASM_PCI_CHANNEL_H */
Quoted 9 lines · Jun Sun
Ralf,
This patch makes swarm compile and run again on 2.6.
I had to introduce a global function pointer,
board_pcibios_init. This setup needsioremap()which is too early for any other board setup hooks.
Quoted 6 lines
I think other boards will need this hookup too (e.g., NEC vr7701)
Does the patch look ok?
Jun
Looks like my snapshot is a couple of days old. Here is the updated patch with update config as well.
I will check in if no objections.
Jun
arch/mips/configs/sb1250-swarm_defconfig renamed from arch/mips/configs/sb1250-swarm_defconfig.orig +12 -8
@@ -82,12 +82,13 @@ # CONFIG_SIBYTE_UNKNOWN is not set CONFIG_SIBYTE_BOARD=y CONFIG_SIBYTE_SB1250=y -CONFIG_CPU_SB1_PASS_1=y -# CONFIG_CPU_SB1_PASS_2_1250 is not set +# CONFIG_CPU_SB1_PASS_1 is not set +CONFIG_CPU_SB1_PASS_2_1250=y # CONFIG_CPU_SB1_PASS_2_2 is not set # CONFIG_CPU_SB1_PASS_4 is not set # CONFIG_CPU_SB1_PASS_2_112x is not set # CONFIG_CPU_SB1_PASS_3 is not set +CONFIG_CPU_SB1_PASS_2=y CONFIG_SIBYTE_HAS_PCI=y CONFIG_SIBYTE_HAS_LDT=y # CONFIG_SIMULATION is not set
@@ -132,9 +133,9 @@ # CONFIG_PAGE_SIZE_16KB is not set # CONFIG_PAGE_SIZE_64KB is not set # CONFIG_SIBYTE_DMA_PAGEOPS is not set -# CONFIG_CPU_HAS_PREFETCH is not set CONFIG_VTAG_ICACHE=y -CONFIG_SB1_PASS_1_WORKAROUNDS=y +CONFIG_SB1_PASS_2_WORKAROUNDS=y +CONFIG_SB1_PASS_2_1_WORKAROUNDS=y # CONFIG_64BIT_PHYS_ADDR is not set # CONFIG_CPU_ADVANCED is not set CONFIG_CPU_HAS_LLSC=y
@@ -316,7 +317,7 @@ # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y -# CONFIG_MII is not set +CONFIG_MII=y CONFIG_NET_SB1250_MAC=y # CONFIG_HAPPYMEAL is not set # CONFIG_SUNGEM is not set
@@ -409,7 +410,7 @@ # CONFIG_GAMEPORT is not set CONFIG_SOUND_GAMEPORT=y CONFIG_SERIO=y -CONFIG_SERIO_I8042=y +# CONFIG_SERIO_I8042 is not set CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PCIPS2 is not set
@@ -439,7 +440,8 @@ # # Non-8250 serial port support # -# CONFIG_UNIX98_PTYS is not set +CONFIG_UNIX98_PTYS=y +CONFIG_UNIX98_PTY_COUNT=256 # # Mice
@@ -542,6 +544,8 @@ CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y # CONFIG_DEVFS_FS is not set +CONFIG_DEVPTS_FS=y +# CONFIG_DEVPTS_FS_XATTR is not set # CONFIG_TMPFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y
@@ -631,6 +635,6 @@ # # Library routines # -# CONFIG_CRC32 is not set +CONFIG_CRC32=y CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=y
arch/mips/pci/pci.c renamed from arch/mips/pci/pci.c.orig +5 -0
@@ -28,6 +28,8 @@unsigned int pci_probe =PCI_ASSIGN_ALL_BUSSES ; +void (*board_pcibios_init)(void )__initdata ; +/* * The PCI controller list. */
@@ -118,6 +120,9 @@int next_busno;int need_domain_info =0 ; +if (board_pcibios_init) +board_pcibios_init (); +/* Scan all of the recorded PCI controllers. */ for (next_busno =0 , hose = hose_head; hose; hose = hose->next) {
arch/mips/pci/pci-sb1250.c renamed from arch/mips/pci/pci-sb1250.c.orig +14 -1
@@ -84,6 +84,11 @@ *(u32 *) (cfg_space + (addr & ~3 )) = data; } +int pcibios_map_irq (struct pci_dev *dev,u8 slot,u8 pin) +{ +return dev->irq; +} +/* * Some checks before doing config cycles: * In PCI Device Mode, hide everything on bus 0 except the LDT host
@@ -194,10 +199,18 @@ .io_resource = &sb1250_io_resource }; -int __init pcibios_init(void) xxx This needs to be called somehow ... +int __init sb1250_pcibios_init (void ) {uint32_t cmdreg;uint64_t reg; +extern int pci_probe_only; + +/* CFE will assign PCI resources */ + pci_probe_only =1 ; + +/* fake resource limit to avoid errors */ + iomem_resource.end =0xffffffff ; + ioport_resource.end =0xffffffff ; cfg_space =ioremap (A_PHYS_LDTPCI_CFG_MATCH_BITS ,16 *1024 *1024 );
arch/mips/sibyte/sb1250/smp.c renamed from arch/mips/sibyte/sb1250/smp.c.orig +1 -1
@@ -94,5 +94,5 @@*/ if (action &SMP_CALL_FUNCTION ) -smp_call_function_interrupt (0 ,NULL , regs); +smp_call_function_interrupt (); }
arch/mips/sibyte/swarm/setup.c renamed from arch/mips/sibyte/swarm/setup.c.orig +9 -1
@@ -34,12 +34,14 @@#include <asm/reboot.h> #include <asm/time.h> #include <asm/traps.h> +#include <asm/pci_channel.h> #include <asm/sibyte/sb1250.h> #include <asm/sibyte/sb1250_regs.h> #include <asm/sibyte/sb1250_genbus.h> #include <asm/sibyte/board.h> extern void sb1250_setup (void ); +extern void sb1250_pcibios_init (void );extern int xicor_probe (void );extern int xicor_set_time (unsigned long );
@@ -80,7 +82,7 @@return (is_fixup ?MIPS_BE_FIXUP :MIPS_BE_FATAL ); } -static void __init swarm_setup (void ) +static int __init swarm_setup (void ) {extern int panic_timeout;
@@ -131,6 +133,12 @@ };/* XXXKW for CFE, get lines/cols from environment */ #endif + +#ifdef CONFIG_SIBYTE_HAS_PCI + board_pcibios_init = sb1250_pcibios_init; +#endif + +return 0 ; }early_initcall (swarm_setup);
diff -Nru linux/drivers/net/sb1250-mac.c.orig linux/drivers/net/sb1250-mac.c
include/asm-mips/sibyte/board.h renamed from include/asm-mips/sibyte/board.h.orig +0 -2
@@ -56,8 +56,6 @@#else -void swarm_setup (void ); -#ifdef LEDS_PHYS extern void setleds (char *str);#else
include/asm-mips/pci_channel.h renamed from include/asm-mips/pci_channel.h.orig +6 -0
@@ -43,4 +43,10 @@*/ extern int pcibios_map_irq (struct pci_dev *dev,u8 slot,u8 pin); +/* +* board pci initialization routine. If set, it is called at the beginning +* of pcibios_init(). +*/ +extern void (*board_pcibios_init)(void ); +#endif /* __ASM_PCI_CHANNEL_H */