Rework MPC82xx hooks in 2.6
RFC 1/1 Rework MPC82xx hooks in 2.6
Hi. I've done a slight re-org of how m8260_setup.c is supposed to be used. Before I push this out, I'd like comments from others actually using the code. The way this works now, boards such as the rpx8260 and est8260 only need to provide a header file with the various defines (almost all of which they have been already). Other platforms such as sbc82xx or pq2ads only need to provide their own version of already provided hooks to do things such as setup late_time_init or setup the 2nd UART, or so on. I've compile-tested this on 8540 and it works on my rpx8260.
arch/ppc/platforms/Makefile +0 -2
@@ -21,7 +21,6 @@ endif obj-$(CONFIG_PMAC_BACKLIGHT) += pmac_backlight.o obj-$(CONFIG_PREP_RESIDUAL) += residual.o obj-$(CONFIG_ADIR) += adir_setup.o adir_pic.o adir_pci.o -obj-$(CONFIG_EST8260) += est8260_setup.o obj-$(CONFIG_PQ2ADS) += pq2ads.o obj-$(CONFIG_TQM8260) += tqm8260_setup.o obj-$(CONFIG_EV64260) += ev64260_setup.o
@@ -37,7 +36,6 @@ obj-$(CONFIG_POWERPMC250) += powerpmc250 obj-$(CONFIG_PPLUS) += pplus.o obj-$(CONFIG_PRPMC750) += prpmc750.o obj-$(CONFIG_PRPMC800) += prpmc800.o -obj-$(CONFIG_RPX8260) += rpx8260.o obj-$(CONFIG_SANDPOINT) += sandpoint.o obj-$(CONFIG_SBC82xx) += sbc82xx.o obj-$(CONFIG_SPRUCE) += spruce.o
arch/ppc/platforms/est8260.h +3 -0
@@ -10,6 +10,9 @@#define BOOTROM_RESTART_ADDR ((uint)0xff000104) +/* For our show_cpuinfo hooks. */ +#define CPUINFO_VENDOR "EST Corporation" +#define CPUINFO_MACHINE "SBC8260 PowerPC"/* A Board Information structure that is given to a program when * prom starts it up.
arch/ppc/platforms/est8260_setup.c +0 -65
65 lines not on this page · raw message
arch/ppc/platforms/pq2ads.c +4 -44
57 lines not on this page · raw message
arch/ppc/platforms/pq2ads.h +4 -0
@@ -23,6 +23,10 @@#define BOOTROM_RESTART_ADDR ((uint)0xff000104) +/* For our show_cpuinfo hooks. */ +#define CPUINFO_VENDOR "Motorola" +#define CPUINFO_MACHINE "PQ2 ADS PowerPC" +/* The ADS8260 has 16, 32-bit wide control/status registers, accessed * only on word boundaries. * Not all are used (yet), or are interesting to us (yet).
arch/ppc/platforms/rpx8260.c +0 -65
65 lines not on this page · raw message
arch/ppc/platforms/rpx8260.h +7 -0
@@ -70,5 +70,12 @@ extern volatile u_char *rpx6_csr_addr;#define PHY_INTERRUPT SIU_INT_IRQ7 +/* For our show_cpuinfo hooks. */ +#define CPUINFO_VENDOR "Embedded Planet" +#define CPUINFO_MACHINE "EP8260 PowerPC" + +/* Warm reset vector. */ +#define BOOTROM_RESTART_ADDR ((uint)0xfff00104) +#endif /* __ASM_PLATFORMS_RPX8260_H__ */ #endif /* __KERNEL__ */
arch/ppc/platforms/sbc82xx.c +2 -38
@@ -16,10 +16,10 @@*/ #include <linux/config.h> -#include <linux/seq_file.h> #include <linux/stddef.h> #include <linux/interrupt.h> #include <linux/irq.h> +#include <linux/init.h> #include <asm/mpc8260.h> #include <asm/machdep.h>
@@ -28,39 +28,12 @@#include <asm/immap_cpm2.h> #include <asm/pci.h> -static void (*callback_setup_arch)(void );static void (*callback_init_IRQ)(void );extern unsigned char __res[sizeof (bd_t)]; -extern void m8260_init (unsigned long r3,unsigned long r4, -unsigned long r5,unsigned long r6,unsigned long r7); -extern void (*late_time_init)(void ); -static int -sbc82xx_show_cpuinfo (struct seq_file *m) -{ -bd_t *binfo = (bd_t *)__res; - -seq_printf (m,"vendor\t\t: Wind River\n" -"machine\t\t: SBC PowerQUICC II\n" -"\n" -"mem size\t\t: 0x%08lx\n" -"console baud\t\t: %ld\n" -"\n" , - binfo->bi_memsize, - binfo->bi_baudrate); -return 0 ; -} - -static void __init -sbc82xx_setup_arch (void ) -{ -printk ("SBC PowerQUICC II Port\n" ); -callback_setup_arch (); -} -#ifdef CONFIG_GEN_RTC TODC_ALLOC ();
@@ -236,23 +209,14 @@ static int sbc82xx_pci_map_irq(struct pcreturn PCI_IRQ_TABLE_LOOKUP ; } - -void __init -platform_init (unsigned long r3,unsigned long r4,unsigned long r5, -unsigned long r6,unsigned long r7) +m82xx_board_init (void ) { -/* Generic 8260 platform initialization */ -m8260_init (r3, r4, r5, r6, r7); -/* u-boot may be using one of the FCC Ethernet devices. Use the MAC address to the SCC. */ __res[offsetof(bd_t, bi_enetaddr[5])] &= ~3;/* Anything special for this platform */ - ppc_md.show_cpuinfo = sbc82xx_show_cpuinfo; - - callback_setup_arch = ppc_md.setup_arch; callback_init_IRQ = ppc_md.init_IRQ; ppc_md.setup_arch = sbc82xx_setup_arch;
arch/ppc/platforms/sbc82xx.h +4 -0
@@ -18,6 +18,10 @@#define SBC82xx_MACADDR_NVRAM_FCC2 0x220000d5/* JP7A */ #define SBC82xx_MACADDR_NVRAM_FCC3 0x220000db/* JP7B */ +/* For our show_cpuinfo hooks. */ +#define CPUINFO_VENDOR "Wind River" +#define CPUINFO_MACHINE "SBC PowerQUICC II" +#define BOOTROM_RESTART_ADDR ((uint)0x40000104)#define SBC82xx_PC_IRQA (NR_SIU_INTS+0)
arch/ppc/platforms/tqm8260.h +4 -0
@@ -14,6 +14,10 @@#define CPM_MAP_ADDR ((uint)0xFFF00000)#define PHY_INTERRUPT 25 +/* For our show_cpuinfo hooks. */ +#define CPUINFO_VENDOR "IN2 Systems" +#define CPUINFO_MACHINE "TQM8260 PowerPC" +#define BOOTROM_RESTART_ADDR ((uint)0x40000104)#endif /* __TQM8260_PLATFORM */
arch/ppc/platforms/tqm8260_setup.c +3 -38
60 lines not on this page · raw message
arch/ppc/syslib/cpm2_pic.c +12 -13
@@ -1,12 +1,3 @@ -#include <linux/stddef.h> -#include <linux/init.h> -#include <linux/sched.h> -#include <linux/signal.h> -#include <asm/irq.h> -#include <asm/immap_cpm2.h> -#include <asm/mpc8260.h> -#include "cpm2_pic.h" -/* The CPM2 internal interrupt controller. It is usually * the only interrupt controller. * There are two 32-bit registers (high/low) for up to 64
@@ -18,6 +9,18 @@* We create two tables, indexed by vector number, to indicate * which register to use and which bit in the register to use. */ + +#include <linux/stddef.h> +#include <linux/init.h> +#include <linux/sched.h> +#include <linux/signal.h> +#include <linux/irq.h> + +#include <asm/immap_cpm2.h> +#include <asm/mpc8260.h> + +#include "cpm2_pic.h" +static u_char irq_to_siureg[] = {1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,
@@ -123,9 +126,5 @@ cpm2_get_irq(struct pt_regs *regs)if (irq ==0 )return (-1 ); -#if 0 - irq += ppc8260_pic.irq_offset; -#endif return irq; } -
arch/ppc/syslib/cpm2_pic.h +1 -7
@@ -1,13 +1,7 @@#ifndef _PPC_KERNEL_CPM2_H#define _PPC_KERNEL_CPM2_H -#include <linux/irq.h> -extern struct hw_interrupt_type cpm2_pic; - -void cpm2_pic_init (void ); -void cpm2_do_IRQ (struct pt_regs *regs, -int cpu); -int cpm2_get_irq (struct pt_regs *regs); +extern int cpm2_get_irq (struct pt_regs *regs);#endif /* _PPC_KERNEL_CPM2_H */
arch/ppc/syslib/m8260_setup.c +33 -45
165 lines not on this page · raw message
--
Tom Rini
http://gate.crashing.org/~trini/
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/