linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Please pull from 'for_paulus' branch of powerpc
@ 2006-03-31  5:43 Kumar Gala
  0 siblings, 0 replies; 20+ messages in thread
From: Kumar Gala @ 2006-03-31  5:43 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linux-kernel

Please pull from 'for_paulus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git

to receive the following updates:

 arch/powerpc/kernel/setup_32.c            |    6 ----
 arch/powerpc/kernel/traps.c               |    9 ++----
 arch/powerpc/platforms/83xx/mpc834x_sys.c |   40 +++++++++++++++---------------
 arch/powerpc/platforms/85xx/mpc85xx_ads.c |   40 +++++++++++++++---------------
 4 files changed, 43 insertions(+), 52 deletions(-)

Kumar Gala:
      powerpc: merge machine_check_exception between ppc32 & ppc64
      powerpc: converted embedded platforms to use new define_machine support

diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index a72bf5d..69ac257 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -50,7 +50,6 @@
 #include <asm/kgdb.h>
 #endif
 
-extern void platform_init(void);
 extern void bootx_init(unsigned long r4, unsigned long phys);
 
 boot_infos_t *boot_infos;
@@ -138,12 +137,7 @@ void __init machine_init(unsigned long d
 		strlcpy(cmd_line, CONFIG_CMDLINE, sizeof(cmd_line));
 #endif /* CONFIG_CMDLINE */
 
-#ifdef CONFIG_PPC_MULTIPLATFORM
 	probe_machine();
-#else
-	/* Base init based on machine type. Obsoloete, please kill ! */
-	platform_init();
-#endif
 
 #ifdef CONFIG_6xx
 	if (cpu_has_feature(CPU_FTR_CAN_DOZE) ||
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 4cbde21..064a525 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -228,7 +228,7 @@ void system_reset_exception(struct pt_re
  */
 static inline int check_io_access(struct pt_regs *regs)
 {
-#ifdef CONFIG_PPC_PMAC
+#if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32)
 	unsigned long msr = regs->msr;
 	const struct exception_table_entry *entry;
 	unsigned int *nip = (unsigned int *)regs->nip;
@@ -261,7 +261,7 @@ static inline int check_io_access(struct
 			return 1;
 		}
 	}
-#endif /* CONFIG_PPC_PMAC */
+#endif /* CONFIG_PPC_PMAC && CONFIG_PPC32 */
 	return 0;
 }
 
@@ -308,8 +308,8 @@ platform_machine_check(struct pt_regs *r
 
 void machine_check_exception(struct pt_regs *regs)
 {
-#ifdef CONFIG_PPC64
 	int recover = 0;
+	unsigned long reason = get_mc_reason(regs);
 
 	/* See if any machine dependent calls */
 	if (ppc_md.machine_check_exception)
@@ -317,8 +317,6 @@ void machine_check_exception(struct pt_r
 
 	if (recover)
 		return;
-#else
-	unsigned long reason = get_mc_reason(regs);
 
 	if (user_mode(regs)) {
 		regs->msr |= MSR_RI;
@@ -462,7 +460,6 @@ void machine_check_exception(struct pt_r
 	 * additional info, e.g. bus error registers.
 	 */
 	platform_machine_check(regs);
-#endif /* CONFIG_PPC64 */
 
 	if (debugger_fault_handler(regs))
 		return;
diff --git a/arch/powerpc/platforms/83xx/mpc834x_sys.c b/arch/powerpc/platforms/83xx/mpc834x_sys.c
index 7c18b4c..7e789d2 100644
--- a/arch/powerpc/platforms/83xx/mpc834x_sys.c
+++ b/arch/powerpc/platforms/83xx/mpc834x_sys.c
@@ -158,25 +158,25 @@ static int __init mpc834x_rtc_hookup(voi
 late_initcall(mpc834x_rtc_hookup);
 #endif
 
-void __init platform_init(void)
+/*
+ * Called very early, MMU is off, device-tree isn't unflattened
+ */
+static int __init mpc834x_sys_probe(void)
 {
-	/* setup the PowerPC module struct */
-	ppc_md.setup_arch = mpc834x_sys_setup_arch;
-
-	ppc_md.init_IRQ = mpc834x_sys_init_IRQ;
-	ppc_md.get_irq = ipic_get_irq;
-
-	ppc_md.restart = mpc83xx_restart;
-
-	ppc_md.time_init = mpc83xx_time_init;
-	ppc_md.set_rtc_time = NULL;
-	ppc_md.get_rtc_time = NULL;
-	ppc_md.calibrate_decr = generic_calibrate_decr;
-
-	ppc_md.progress = udbg_progress;
-
-	if (ppc_md.progress)
-		ppc_md.progress("mpc834x_sys_init(): exit", 0);
-
-	return;
+	/* We always match for now, eventually we should look at the flat
+	   dev tree to ensure this is the board we are suppose to run on
+	*/
+	return 1;
 }
+
+define_machine(mpc834x_sys) {
+	.name			= "MPC834x SYS",
+	.probe			= mpc834x_sys_probe,
+	.setup_arch		= mpc834x_sys_setup_arch,
+	.init_IRQ		= mpc834x_sys_init_IRQ,
+	.get_irq		= ipic_get_irq,
+	.restart		= mpc83xx_restart,
+	.time_init		= mpc83xx_time_init,
+	.calibrate_decr		= generic_calibrate_decr,
+	.progress		= udbg_progress,
+};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ads.c b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
index b7821db..5eeff37 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ads.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ads.c
@@ -220,25 +220,25 @@ void mpc85xx_ads_show_cpuinfo(struct seq
 	seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
 }
 
-void __init platform_init(void)
+/*
+ * Called very early, device-tree isn't unflattened
+ */
+static int __init mpc85xx_ads_probe(void)
 {
-	ppc_md.setup_arch = mpc85xx_ads_setup_arch;
-	ppc_md.show_cpuinfo = mpc85xx_ads_show_cpuinfo;
-
-	ppc_md.init_IRQ = mpc85xx_ads_pic_init;
-	ppc_md.get_irq = mpic_get_irq;
-
-	ppc_md.restart = mpc85xx_restart;
-	ppc_md.power_off = NULL;
-	ppc_md.halt = NULL;
-
-	ppc_md.time_init = NULL;
-	ppc_md.set_rtc_time = NULL;
-	ppc_md.get_rtc_time = NULL;
-	ppc_md.calibrate_decr = generic_calibrate_decr;
-
-	ppc_md.progress = udbg_progress;
-
-	if (ppc_md.progress)
-		ppc_md.progress("mpc85xx_ads platform_init(): exit", 0);
+	/* We always match for now, eventually we should look at the flat
+	   dev tree to ensure this is the board we are suppose to run on
+	*/
+	return 1;
 }
+
+define_machine(mpc85xx_ads) {
+	.name			= "MPC85xx ADS",
+	.probe			= mpc85xx_ads_probe,
+	.setup_arch		= mpc85xx_ads_setup_arch,
+	.init_IRQ		= mpc85xx_ads_pic_init,
+	.show_cpuinfo		= mpc85xx_ads_show_cpuinfo,
+	.get_irq		= mpic_get_irq,
+	.restart		= mpc85xx_restart,
+	.calibrate_decr		= generic_calibrate_decr,
+	.progress		= udbg_progress,
+};

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Please pull from 'for_paulus' branch of powerpc
@ 2006-04-04 21:14 Kumar Gala
  2006-04-05  0:28 ` Stephen Rothwell
  0 siblings, 1 reply; 20+ messages in thread
From: Kumar Gala @ 2006-04-04 21:14 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linux-kernel

Please pull from 'for_paulus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git

to receive the following updates:

 arch/powerpc/configs/mpc85xx_cds_defconfig |  846 +++++++++++++++++++++++++++++
 arch/powerpc/kernel/ppc_ksyms.c            |    1 
 arch/powerpc/platforms/85xx/Kconfig        |    9 
 arch/powerpc/platforms/85xx/Makefile       |    1 
 arch/powerpc/platforms/85xx/mpc85xx_cds.c  |  359 ++++++++++++
 arch/powerpc/platforms/85xx/mpc85xx_cds.h  |   43 +
 arch/ppc/kernel/ppc_ksyms.c                |    1 
 include/asm-ppc/mpc85xx.h                  |    3 
 8 files changed, 1262 insertions(+), 1 deletion(-)

Andy Fleming:
      Add 85xx CDS to arch/powerpc

Kumar Gala:
      powerpc/ppc: export strncasecmp

diff --git a/arch/powerpc/configs/mpc85xx_cds_defconfig b/arch/powerpc/configs/mpc85xx_cds_defconfig
new file mode 100644
index 0000000..9bb022a
--- /dev/null
+++ b/arch/powerpc/configs/mpc85xx_cds_defconfig
@@ -0,0 +1,846 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.16
+# Sun Apr  2 11:23:42 2006
+#
+# CONFIG_PPC64 is not set
+CONFIG_PPC32=y
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_PPC=y
+CONFIG_EARLY_PRINTK=y
+CONFIG_GENERIC_NVRAM=y
+CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
+CONFIG_ARCH_MAY_HAVE_PC_FDC=y
+CONFIG_PPC_OF=y
+CONFIG_PPC_UDBG_16550=y
+# CONFIG_GENERIC_TBSYNC is not set
+# CONFIG_DEFAULT_UIMAGE is not set
+
+#
+# Processor support
+#
+# CONFIG_CLASSIC32 is not set
+# CONFIG_PPC_52xx is not set
+# CONFIG_PPC_82xx is not set
+# CONFIG_PPC_83xx is not set
+CONFIG_PPC_85xx=y
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_8xx is not set
+# CONFIG_E200 is not set
+CONFIG_85xx=y
+CONFIG_E500=y
+CONFIG_BOOKE=y
+CONFIG_FSL_BOOKE=y
+# CONFIG_PHYS_64BIT is not set
+CONFIG_SPE=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+
+#
+# General setup
+#
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+# CONFIG_RELAY is not set
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_EMBEDDED=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SHMEM=y
+CONFIG_SLAB=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_SLOB is not set
+
+#
+# Loadable module support
+#
+# CONFIG_MODULES is not set
+
+#
+# Block layer
+#
+# CONFIG_LBD is not set
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_MPIC=y
+# CONFIG_WANT_EARLY_SERIAL is not set
+
+#
+# Platform support
+#
+# CONFIG_MPC8540_ADS is not set
+CONFIG_MPC85xx_CDS=y
+CONFIG_MPC8540=y
+CONFIG_PPC_INDIRECT_PCI_BE=y
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=250
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+CONFIG_MATH_EMULATION=y
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_SELECT_MEMORY_MODEL=y
+CONFIG_FLATMEM_MANUAL=y
+# CONFIG_DISCONTIGMEM_MANUAL is not set
+# CONFIG_SPARSEMEM_MANUAL is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+# CONFIG_SOFTWARE_SUSPEND is not set
+# CONFIG_SECCOMP is not set
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_PPC_I8259=y
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_FSL_SOC=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+# CONFIG_PCI_DEBUG is not set
+
+#
+# PCCARD (PCMCIA/CardBus) support
+#
+# CONFIG_PCCARD is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+
+#
+# Advanced setup
+#
+# CONFIG_ADVANCED_OPTIONS is not set
+
+#
+# Default settings for advanced configuration options are used
+#
+CONFIG_HIGHMEM_START=0xfe000000
+CONFIG_LOWMEM_SIZE=0x30000000
+CONFIG_KERNEL_START=0xc0000000
+CONFIG_TASK_SIZE=0x80000000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+# CONFIG_NETDEBUG is not set
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_FIB_HASH=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_IP_MROUTE is not set
+# CONFIG_ARPD is not set
+CONFIG_SYN_COOKIES=y
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_BIC=y
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETFILTER is not set
+
+#
+# DCCP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_DCCP is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+
+#
+# TIPC Configuration (EXPERIMENTAL)
+#
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_IEEE80211 is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_DEBUG_DRIVER is not set
+
+#
+# Connector - unified userspace <-> kernelspace linker
+#
+# CONFIG_CONNECTOR is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Plug and Play support
+#
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+# CONFIG_BLK_DEV_UMEM is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+CONFIG_BLK_DEV_LOOP=y
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=32768
+CONFIG_BLK_DEV_INITRD=y
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=y
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+# CONFIG_BLK_DEV_IDEDISK is not set
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+CONFIG_BLK_DEV_IDEPCI=y
+CONFIG_IDEPCI_SHARE_IRQ=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+# CONFIG_BLK_DEV_SL82C105 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
+# CONFIG_IDEDMA_PCI_AUTO is not set
+# CONFIG_BLK_DEV_AEC62XX is not set
+# CONFIG_BLK_DEV_ALI15X3 is not set
+# CONFIG_BLK_DEV_AMD74XX is not set
+# CONFIG_BLK_DEV_CMD64X is not set
+# CONFIG_BLK_DEV_TRIFLEX is not set
+# CONFIG_BLK_DEV_CY82C693 is not set
+# CONFIG_BLK_DEV_CS5520 is not set
+# CONFIG_BLK_DEV_CS5530 is not set
+# CONFIG_BLK_DEV_HPT34X is not set
+# CONFIG_BLK_DEV_HPT366 is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_IT821X is not set
+# CONFIG_BLK_DEV_NS87415 is not set
+# CONFIG_BLK_DEV_PDC202XX_OLD is not set
+# CONFIG_BLK_DEV_PDC202XX_NEW is not set
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+CONFIG_BLK_DEV_VIA82CXXX=y
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Macintosh device drivers
+#
+# CONFIG_WINDFARM is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# PHY device support
+#
+CONFIG_PHYLIB=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_CICADA_PHY is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_CASSINI is not set
+# CONFIG_NET_VENDOR_3COM is not set
+
+#
+# Tulip family network device support
+#
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_PCI is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+CONFIG_E1000=y
+CONFIG_E1000_NAPI=y
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+CONFIG_GIANFAR=y
+CONFIG_GFAR_NAPI=y
+
+#
+# Ethernet (10000 Mbit)
+#
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_PCI=y
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+# CONFIG_SERIAL_8250_EXTENDED is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_NVRAM is not set
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# TPM devices
+#
+# CONFIG_TCG_TPM is not set
+# CONFIG_TELCLOCK is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+
+#
+# Dallas's 1-wire bus
+#
+# CONFIG_W1 is not set
+
+#
+# Hardware Monitoring support
+#
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+
+#
+# Misc devices
+#
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# Graphics support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+# CONFIG_USB is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# LED devices
+#
+# CONFIG_NEW_LEDS is not set
+
+#
+# InfiniBand support
+#
+# CONFIG_INFINIBAND is not set
+
+#
+# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
+#
+
+#
+# Real Time Clock
+#
+# CONFIG_RTC_CLASS is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+# CONFIG_EXT2_FS_XIP is not set
+CONFIG_EXT3_FS=y
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_FS_POSIX_ACL is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_INOTIFY=y
+# CONFIG_QUOTA is not set
+CONFIG_DNOTIFY=y
+# CONFIG_AUTOFS_FS is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_KCORE=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+# CONFIG_CONFIGFS_FS is not set
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=y
+# CONFIG_NFS_V3 is not set
+# CONFIG_NFS_V4 is not set
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_ROOT_NFS=y
+CONFIG_LOCKD=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+# CONFIG_RPCSEC_GSS_KRB5 is not set
+# CONFIG_RPCSEC_GSS_SPKM3 is not set
+# CONFIG_SMB_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+# CONFIG_9P_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+# CONFIG_MSDOS_PARTITION is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+# CONFIG_NLS is not set
+
+#
+# Library routines
+#
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+
+#
+# Instrumentation Support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_DEBUG_KERNEL=y
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_DETECT_SOFTLOCKUP=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_DEBUG_VM is not set
+# CONFIG_UNWIND_INFO is not set
+CONFIG_FORCED_INLINING=y
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_DEBUGGER is not set
+# CONFIG_BDI_SWITCH is not set
+# CONFIG_BOOTX_TEXT is not set
+# CONFIG_PPC_EARLY_DEBUG_LPAR is not set
+# CONFIG_PPC_EARLY_DEBUG_G5 is not set
+# CONFIG_PPC_EARLY_DEBUG_RTAS is not set
+# CONFIG_PPC_EARLY_DEBUG_MAPLE is not set
+# CONFIG_PPC_EARLY_DEBUG_ISERIES is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+# CONFIG_CRYPTO is not set
+
+#
+# Hardware crypto devices
+#
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index dfa5398..4b052ae 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -81,6 +81,7 @@ EXPORT_SYMBOL(strcat);
 EXPORT_SYMBOL(strlen);
 EXPORT_SYMBOL(strcmp);
 EXPORT_SYMBOL(strcasecmp);
+EXPORT_SYMBOL(strncasecmp);
 
 EXPORT_SYMBOL(csum_partial);
 EXPORT_SYMBOL(csum_partial_copy_generic);
diff --git a/arch/powerpc/platforms/85xx/Kconfig b/arch/powerpc/platforms/85xx/Kconfig
index 06e3712..454fc53 100644
--- a/arch/powerpc/platforms/85xx/Kconfig
+++ b/arch/powerpc/platforms/85xx/Kconfig
@@ -11,13 +11,20 @@ config MPC8540_ADS
 	help
 	  This option enables support for the MPC 8540 ADS board
 
+config MPC85xx_CDS
+	bool "Freescale MPC85xx CDS"
+	select DEFAULT_UIMAGE
+	select PPC_I8259 if PCI
+	help
+	  This option enables support for the MPC85xx CDS board
+
 endchoice
 
 config MPC8540
 	bool
 	select PPC_UDBG_16550
 	select PPC_INDIRECT_PCI
-	default y if MPC8540_ADS
+	default y if MPC8540_ADS || MPC85xx_CDS
 
 config PPC_INDIRECT_PCI_BE
 	bool
diff --git a/arch/powerpc/platforms/85xx/Makefile b/arch/powerpc/platforms/85xx/Makefile
index ffc4139..7615aa5 100644
--- a/arch/powerpc/platforms/85xx/Makefile
+++ b/arch/powerpc/platforms/85xx/Makefile
@@ -3,3 +3,4 @@
 #
 obj-$(CONFIG_PPC_85xx)	+= misc.o pci.o
 obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o
+obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
new file mode 100644
index 0000000..18e6e11
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c
@@ -0,0 +1,359 @@
+/*
+ * MPC85xx setup and early boot code plus other random bits.
+ *
+ * Maintained by Kumar Gala (see MAINTAINERS for contact information)
+ *
+ * Copyright 2005 Freescale Semiconductor Inc.
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ */
+
+#include <linux/config.h>
+#include <linux/stddef.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/errno.h>
+#include <linux/reboot.h>
+#include <linux/pci.h>
+#include <linux/kdev_t.h>
+#include <linux/major.h>
+#include <linux/console.h>
+#include <linux/delay.h>
+#include <linux/seq_file.h>
+#include <linux/root_dev.h>
+#include <linux/initrd.h>
+#include <linux/module.h>
+#include <linux/fsl_devices.h>
+
+#include <asm/system.h>
+#include <asm/pgtable.h>
+#include <asm/page.h>
+#include <asm/atomic.h>
+#include <asm/time.h>
+#include <asm/io.h>
+#include <asm/machdep.h>
+#include <asm/ipic.h>
+#include <asm/bootinfo.h>
+#include <asm/pci-bridge.h>
+#include <asm/mpc85xx.h>
+#include <asm/irq.h>
+#include <mm/mmu_decl.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <asm/mpic.h>
+#include <asm/i8259.h>
+
+#include <sysdev/fsl_soc.h>
+#include "mpc85xx.h"
+
+#ifndef CONFIG_PCI
+unsigned long isa_io_base = 0;
+unsigned long isa_mem_base = 0;
+#endif
+
+static int cds_pci_slot = 2;
+static volatile u8 *cadmus;
+
+/*
+ * Internal interrupts are all Level Sensitive, and Positive Polarity
+ *
+ * Note:  Likely, this table and the following function should be
+ *        obtained and derived from the OF Device Tree.
+ */
+static u_char mpc85xx_cds_openpic_initsenses[] __initdata = {
+	MPC85XX_INTERNAL_IRQ_SENSES,
+#if defined(CONFIG_PCI)
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_POSITIVE),	/* Ext 0: PCI slot 0 */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* Ext 1: PCI slot 1 */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* Ext 2: PCI slot 2 */
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* Ext 3: PCI slot 3 */
+#else
+	0x0,				/* External  0: */
+	0x0,				/* External  1: */
+	0x0,				/* External  2: */
+	0x0,				/* External  3: */
+#endif
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),	/* External 5: PHY */
+	0x0,				/* External  6: */
+	0x0,				/* External  7: */
+	0x0,				/* External  8: */
+	0x0,				/* External  9: */
+	0x0,				/* External 10: */
+#ifdef CONFIG_PCI
+	(IRQ_SENSE_LEVEL | IRQ_POLARITY_NEGATIVE),    /* Ext 11: PCI2 slot 0 */
+#else
+	0x0,				/* External 11: */
+#endif
+};
+
+
+#ifdef CONFIG_PCI
+/*
+ * interrupt routing
+ */
+int
+mpc85xx_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
+{
+	struct pci_controller *hose = pci_bus_to_hose(dev->bus->number);
+
+	if (!hose->index)
+	{
+		/* Handle PCI1 interrupts */
+		char pci_irq_table[][4] =
+			/*
+			 *      PCI IDSEL/INTPIN->INTLINE
+			 *        A      B      C      D
+			 */
+
+			/* Note IRQ assignment for slots is based on which slot the elysium is
+			 * in -- in this setup elysium is in slot #2 (this PIRQA as first
+			 * interrupt on slot */
+		{
+			{ 0, 1, 2, 3 }, /* 16 - PMC */
+			{ 0, 1, 2, 3 }, /* 17 P2P (Tsi320) */
+			{ 0, 1, 2, 3 }, /* 18 - Slot 1 */
+			{ 1, 2, 3, 0 }, /* 19 - Slot 2 */
+			{ 2, 3, 0, 1 }, /* 20 - Slot 3 */
+			{ 3, 0, 1, 2 }, /* 21 - Slot 4 */
+		};
+
+		const long min_idsel = 16, max_idsel = 21, irqs_per_slot = 4;
+		int i, j;
+
+		for (i = 0; i < 6; i++)
+			for (j = 0; j < 4; j++)
+				pci_irq_table[i][j] =
+					((pci_irq_table[i][j] + 5 -
+					  cds_pci_slot) & 0x3) + PIRQ0A;
+
+		return PCI_IRQ_TABLE_LOOKUP;
+	} else {
+		/* Handle PCI2 interrupts (if we have one) */
+		char pci_irq_table[][4] =
+		{
+			/*
+			 * We only have one slot and one interrupt
+			 * going to PIRQA - PIRQD */
+			{ PIRQ1A, PIRQ1A, PIRQ1A, PIRQ1A }, /* 21 - slot 0 */
+		};
+
+		const long min_idsel = 21, max_idsel = 21, irqs_per_slot = 4;
+
+		return PCI_IRQ_TABLE_LOOKUP;
+	}
+}
+
+#define ARCADIA_HOST_BRIDGE_IDSEL	17
+#define ARCADIA_2ND_BRIDGE_IDSEL	3
+
+extern int mpc85xx_pci2_busno;
+
+int
+mpc85xx_exclude_device(u_char bus, u_char devfn)
+{
+	if (bus == 0 && PCI_SLOT(devfn) == 0)
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	if (mpc85xx_pci2_busno)
+		if (bus == (mpc85xx_pci2_busno) && PCI_SLOT(devfn) == 0)
+			return PCIBIOS_DEVICE_NOT_FOUND;
+	/* We explicitly do not go past the Tundra 320 Bridge */
+	if ((bus == 1) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	if ((bus == 0) && (PCI_SLOT(devfn) == ARCADIA_2ND_BRIDGE_IDSEL))
+		return PCIBIOS_DEVICE_NOT_FOUND;
+	else
+		return PCIBIOS_SUCCESSFUL;
+}
+
+void __init
+mpc85xx_cds_pcibios_fixup(void)
+{
+	struct pci_dev *dev;
+	u_char		c;
+
+	if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
+					PCI_DEVICE_ID_VIA_82C586_1, NULL))) {
+		/*
+		 * U-Boot does not set the enable bits
+		 * for the IDE device. Force them on here.
+		 */
+		pci_read_config_byte(dev, 0x40, &c);
+		c |= 0x03; /* IDE: Chip Enable Bits */
+		pci_write_config_byte(dev, 0x40, c);
+
+		/*
+		 * Since only primary interface works, force the
+		 * IDE function to standard primary IDE interrupt
+		 * w/ 8259 offset
+		 */
+		dev->irq = 14;
+		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq);
+		pci_dev_put(dev);
+	}
+
+	/*
+	 * Force legacy USB interrupt routing
+	 */
+	if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
+					PCI_DEVICE_ID_VIA_82C586_2, NULL))) {
+		dev->irq = 10;
+		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 10);
+		pci_dev_put(dev);
+	}
+
+	if ((dev = pci_get_device(PCI_VENDOR_ID_VIA,
+					PCI_DEVICE_ID_VIA_82C586_2, dev))) {
+		dev->irq = 11;
+		pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11);
+		pci_dev_put(dev);
+	}
+}
+#endif /* CONFIG_PCI */
+
+void __init mpc85xx_cds_pic_init(void)
+{
+	struct mpic *mpic1;
+	phys_addr_t OpenPIC_PAddr;
+
+	/* Determine the Physical Address of the OpenPIC regs */
+	OpenPIC_PAddr = get_immrbase() + MPC85xx_OPENPIC_OFFSET;
+
+	mpic1 = mpic_alloc(OpenPIC_PAddr,
+			MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
+			4, MPC85xx_OPENPIC_IRQ_OFFSET, 0, 250,
+			mpc85xx_cds_openpic_initsenses,
+			sizeof(mpc85xx_cds_openpic_initsenses), " OpenPIC  ");
+	BUG_ON(mpic1 == NULL);
+	mpic_assign_isu(mpic1, 0, OpenPIC_PAddr + 0x10200);
+	mpic_assign_isu(mpic1, 1, OpenPIC_PAddr + 0x10280);
+	mpic_assign_isu(mpic1, 2, OpenPIC_PAddr + 0x10300);
+	mpic_assign_isu(mpic1, 3, OpenPIC_PAddr + 0x10380);
+	mpic_assign_isu(mpic1, 4, OpenPIC_PAddr + 0x10400);
+	mpic_assign_isu(mpic1, 5, OpenPIC_PAddr + 0x10480);
+	mpic_assign_isu(mpic1, 6, OpenPIC_PAddr + 0x10500);
+	mpic_assign_isu(mpic1, 7, OpenPIC_PAddr + 0x10580);
+
+	/* dummy mappings to get to 48 */
+	mpic_assign_isu(mpic1, 8, OpenPIC_PAddr + 0x10600);
+	mpic_assign_isu(mpic1, 9, OpenPIC_PAddr + 0x10680);
+	mpic_assign_isu(mpic1, 10, OpenPIC_PAddr + 0x10700);
+	mpic_assign_isu(mpic1, 11, OpenPIC_PAddr + 0x10780);
+
+	/* External ints */
+	mpic_assign_isu(mpic1, 12, OpenPIC_PAddr + 0x10000);
+	mpic_assign_isu(mpic1, 13, OpenPIC_PAddr + 0x10080);
+	mpic_assign_isu(mpic1, 14, OpenPIC_PAddr + 0x10100);
+
+	mpic_init(mpic1);
+
+#ifdef CONFIG_PCI
+	mpic_setup_cascade(PIRQ0A, i8259_irq_cascade, NULL);
+
+	i8259_init(0,0);
+#endif
+}
+
+
+/*
+ * Setup the architecture
+ */
+static void __init
+mpc85xx_cds_setup_arch(void)
+{
+	struct device_node *cpu;
+#ifdef CONFIG_PCI
+	struct device_node *np;
+#endif
+
+	if (ppc_md.progress)
+		ppc_md.progress("mpc85xx_cds_setup_arch()", 0);
+
+	cpu = of_find_node_by_type(NULL, "cpu");
+	if (cpu != 0) {
+		unsigned int *fp;
+
+		fp = (int *)get_property(cpu, "clock-frequency", NULL);
+		if (fp != 0)
+			loops_per_jiffy = *fp / HZ;
+		else
+			loops_per_jiffy = 500000000 / HZ;
+		of_node_put(cpu);
+	}
+
+	cadmus = ioremap(CADMUS_BASE, CADMUS_SIZE);
+	cds_pci_slot = ((cadmus[CM_CSR] >> 6) & 0x3) + 1;
+
+	if (ppc_md.progress) {
+		char buf[40];
+		snprintf(buf, 40, "CDS Version = 0x%x in slot %d\n",
+				cadmus[CM_VER], cds_pci_slot);
+		ppc_md.progress(buf, 0);
+	}
+
+#ifdef CONFIG_PCI
+	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
+		add_bridge(np);
+
+	ppc_md.pcibios_fixup = mpc85xx_cds_pcibios_fixup;
+	ppc_md.pci_swizzle = common_swizzle;
+	ppc_md.pci_map_irq = mpc85xx_map_irq;
+	ppc_md.pci_exclude_device = mpc85xx_exclude_device;
+#endif
+
+#ifdef  CONFIG_ROOT_NFS
+	ROOT_DEV = Root_NFS;
+#else
+	ROOT_DEV = Root_HDA1;
+#endif
+}
+
+
+void
+mpc85xx_cds_show_cpuinfo(struct seq_file *m)
+{
+	uint pvid, svid, phid1;
+	uint memsize = total_memory;
+
+	pvid = mfspr(SPRN_PVR);
+	svid = mfspr(SPRN_SVR);
+
+	seq_printf(m, "Vendor\t\t: Freescale Semiconductor\n");
+	seq_printf(m, "Machine\t\t: MPC85xx CDS (0x%x)\n", cadmus[CM_VER]);
+	seq_printf(m, "PVR\t\t: 0x%x\n", pvid);
+	seq_printf(m, "SVR\t\t: 0x%x\n", svid);
+
+	/* Display cpu Pll setting */
+	phid1 = mfspr(SPRN_HID1);
+	seq_printf(m, "PLL setting\t: 0x%x\n", ((phid1 >> 24) & 0x3f));
+
+	/* Display the amount of memory */
+	seq_printf(m, "Memory\t\t: %d MB\n", memsize / (1024 * 1024));
+}
+
+
+/*
+ * Called very early, device-tree isn't unflattened
+ */
+static int __init mpc85xx_cds_probe(void)
+{
+	/* We always match for now, eventually we should look at
+	 * the flat dev tree to ensure this is the board we are
+	 * supposed to run on
+	 */
+	return 1;
+}
+
+define_machine(mpc85xx_cds) {
+	.name		= "MPC85xx CDS",
+	.probe		= mpc85xx_cds_probe,
+	.setup_arch	= mpc85xx_cds_setup_arch,
+	.init_IRQ	= mpc85xx_cds_pic_init,
+	.show_cpuinfo	= mpc85xx_cds_show_cpuinfo,
+	.get_irq	= mpic_get_irq,
+	.restart	= mpc85xx_restart,
+	.calibrate_decr = generic_calibrate_decr,
+	.progress	= udbg_progress,
+};
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.h b/arch/powerpc/platforms/85xx/mpc85xx_cds.h
new file mode 100644
index 0000000..671f54f
--- /dev/null
+++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.h
@@ -0,0 +1,43 @@
+/*
+ * arch/ppc/platforms/85xx/mpc85xx_cds_common.h
+ *
+ * MPC85xx CDS board definitions
+ *
+ * Maintainer: Kumar Gala <galak@kernel.crashing.org>
+ *
+ * Copyright 2004 Freescale Semiconductor, Inc
+ *
+ * This program is free software; you can redistribute  it and/or modify it
+ * under  the terms of  the GNU General  Public License as published by the
+ * Free Software Foundation;  either version 2 of the  License, or (at your
+ * option) any later version.
+ *
+ */
+
+#ifndef __MACH_MPC85XX_CDS_H__
+#define __MACH_MPC85XX_CDS_H__
+
+/* CADMUS info */
+#define CADMUS_BASE (0xf8004000)
+#define CADMUS_SIZE (256)
+#define CM_VER	(0)
+#define CM_CSR	(1)
+#define CM_RST	(2)
+
+/* CDS NVRAM/RTC */
+#define CDS_RTC_ADDR	(0xf8000000)
+#define CDS_RTC_SIZE	(8 * 1024)
+
+/* PCI interrupt controller */
+#define PIRQ0A			MPC85xx_IRQ_EXT0
+#define PIRQ0B			MPC85xx_IRQ_EXT1
+#define PIRQ0C			MPC85xx_IRQ_EXT2
+#define PIRQ0D			MPC85xx_IRQ_EXT3
+#define PIRQ1A			MPC85xx_IRQ_EXT11
+
+#define NR_8259_INTS		16
+#define CPM_IRQ_OFFSET		NR_8259_INTS
+
+#define MPC85xx_OPENPIC_IRQ_OFFSET	80
+
+#endif /* __MACH_MPC85XX_CDS_H__ */
diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
index 865ba74..b250b1b 100644
--- a/arch/ppc/kernel/ppc_ksyms.c
+++ b/arch/ppc/kernel/ppc_ksyms.c
@@ -94,6 +94,7 @@ EXPORT_SYMBOL(strcat);
 EXPORT_SYMBOL(strlen);
 EXPORT_SYMBOL(strcmp);
 EXPORT_SYMBOL(strcasecmp);
+EXPORT_SYMBOL(strncasecmp);
 EXPORT_SYMBOL(__div64_32);
 
 EXPORT_SYMBOL(csum_partial);
diff --git a/include/asm-ppc/mpc85xx.h b/include/asm-ppc/mpc85xx.h
index f47002a..4f844eb 100644
--- a/include/asm-ppc/mpc85xx.h
+++ b/include/asm-ppc/mpc85xx.h
@@ -28,6 +28,9 @@
 #if defined(CONFIG_MPC8555_CDS) || defined(CONFIG_MPC8548_CDS)
 #include <platforms/85xx/mpc8555_cds.h>
 #endif
+#ifdef CONFIG_MPC85xx_CDS
+#include <platforms/85xx/mpc85xx_cds.h>
+#endif
 #ifdef CONFIG_MPC8560_ADS
 #include <platforms/85xx/mpc8560_ads.h>
 #endif

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-04-04 21:14 Kumar Gala
@ 2006-04-05  0:28 ` Stephen Rothwell
  2006-04-05  1:23   ` Kumar Gala
  0 siblings, 1 reply; 20+ messages in thread
From: Stephen Rothwell @ 2006-04-05  0:28 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, paulus, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1373 bytes --]

On Tue, 4 Apr 2006 16:14:04 -0500 (CDT) Kumar Gala <galak@kernel.crashing.org> wrote:
>
> Please pull from 'for_paulus' branch of
> master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git
> 
> to receive the following updates:
> 
>  arch/powerpc/configs/mpc85xx_cds_defconfig |  846 +++++++++++++++++++++++++++++
>  arch/powerpc/kernel/ppc_ksyms.c            |    1 
>  arch/powerpc/platforms/85xx/Kconfig        |    9 
>  arch/powerpc/platforms/85xx/Makefile       |    1 
>  arch/powerpc/platforms/85xx/mpc85xx_cds.c  |  359 ++++++++++++
>  arch/powerpc/platforms/85xx/mpc85xx_cds.h  |   43 +
>  arch/ppc/kernel/ppc_ksyms.c                |    1 
>  include/asm-ppc/mpc85xx.h                  |    3 
>  8 files changed, 1262 insertions(+), 1 deletion(-)
> 
> Andy Fleming:
>       Add 85xx CDS to arch/powerpc

Could these "add xxx to arch/powerpc" patches please move any relevant
headers files to include/asm-powerpc as well.  It would be nice if we
could remove the hack from the powerpc Makefile that include files from
include/asm-ppc.  i.e. My opinion is that if any ARCH=powerpc build
requires a file in include/asm-ppc, then that file should be moved to
include/asm-powerpc.  I am doing a set of patches to that effect.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-04-05  0:28 ` Stephen Rothwell
@ 2006-04-05  1:23   ` Kumar Gala
  2006-04-05  3:05     ` Stephen Rothwell
  0 siblings, 1 reply; 20+ messages in thread
From: Kumar Gala @ 2006-04-05  1:23 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, paulus, linux-kernel


On Apr 4, 2006, at 7:28 PM, Stephen Rothwell wrote:

> On Tue, 4 Apr 2006 16:14:04 -0500 (CDT) Kumar Gala  
> <galak@kernel.crashing.org> wrote:
>>
>> Please pull from 'for_paulus' branch of
>> master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git
>>
>> to receive the following updates:
>>
>>  arch/powerpc/configs/mpc85xx_cds_defconfig |  846 ++++++++++++++++ 
>> +++++++++++++
>>  arch/powerpc/kernel/ppc_ksyms.c            |    1
>>  arch/powerpc/platforms/85xx/Kconfig        |    9
>>  arch/powerpc/platforms/85xx/Makefile       |    1
>>  arch/powerpc/platforms/85xx/mpc85xx_cds.c  |  359 ++++++++++++
>>  arch/powerpc/platforms/85xx/mpc85xx_cds.h  |   43 +
>>  arch/ppc/kernel/ppc_ksyms.c                |    1
>>  include/asm-ppc/mpc85xx.h                  |    3
>>  8 files changed, 1262 insertions(+), 1 deletion(-)
>>
>> Andy Fleming:
>>       Add 85xx CDS to arch/powerpc
>
> Could these "add xxx to arch/powerpc" patches please move any relevant
> headers files to include/asm-powerpc as well.  It would be nice if we
> could remove the hack from the powerpc Makefile that include files  
> from
> include/asm-ppc.  i.e. My opinion is that if any ARCH=powerpc build
> requires a file in include/asm-ppc, then that file should be moved to
> include/asm-powerpc.  I am doing a set of patches to that effect.

We need the irq rework before I'd be willing to do this.  The main  
dependancy between asm-ppc and asm-powerpc is the static IRQs we  
currently have.  I'd rather spend time on fixing up the IRQ handling  
to parse the flat dev tree.

- kumar

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-04-05  1:23   ` Kumar Gala
@ 2006-04-05  3:05     ` Stephen Rothwell
  2006-04-05  4:33       ` Kumar Gala
  0 siblings, 1 reply; 20+ messages in thread
From: Stephen Rothwell @ 2006-04-05  3:05 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, paulus, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 602 bytes --]

Hi Kumar,

On Tue, 4 Apr 2006 20:23:23 -0500 Kumar Gala <galak@kernel.crashing.org> wrote:
>
> We need the irq rework before I'd be willing to do this.  The main  
> dependancy between asm-ppc and asm-powerpc is the static IRQs we  
> currently have.  I'd rather spend time on fixing up the IRQ handling  
> to parse the flat dev tree.

I agree entirely.  To clrify, I was referring to header files that only
exist in include/asm-ppc and are trivial to move.

Patches following ...
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-04-05  3:05     ` Stephen Rothwell
@ 2006-04-05  4:33       ` Kumar Gala
  0 siblings, 0 replies; 20+ messages in thread
From: Kumar Gala @ 2006-04-05  4:33 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, paulus, linux-kernel


On Apr 4, 2006, at 10:05 PM, Stephen Rothwell wrote:

> Hi Kumar,
>
> On Tue, 4 Apr 2006 20:23:23 -0500 Kumar Gala  
> <galak@kernel.crashing.org> wrote:
>>
>> We need the irq rework before I'd be willing to do this.  The main
>> dependancy between asm-ppc and asm-powerpc is the static IRQs we
>> currently have.  I'd rather spend time on fixing up the IRQ handling
>> to parse the flat dev tree.
>
> I agree entirely.  To clrify, I was referring to header files that  
> only
> exist in include/asm-ppc and are trivial to move.
>
> Patches following ...

Agreed.

- k

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Please pull from 'for_paulus' branch of powerpc
@ 2006-05-04 21:28 Kumar Gala
  2006-05-04 22:09 ` Segher Boessenkool
  2006-05-04 22:49 ` Paul Mackerras
  0 siblings, 2 replies; 20+ messages in thread
From: Kumar Gala @ 2006-05-04 21:28 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linux-kernel

Please pull from 'for_paulus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git

to receive the following updates:

 arch/powerpc/kernel/setup-common.c |   17 +++++++++++++++++
 arch/powerpc/kernel/setup_32.c     |    4 ++++
 arch/powerpc/kernel/setup_64.c     |   17 ++---------------
 3 files changed, 23 insertions(+), 15 deletions(-)

Kumar Gala:
      powerpc: provide ppc_md.panic() for both ppc32 & ppc64

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 684ab1d..7a6a883 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -524,3 +524,20 @@ int check_legacy_ioport(unsigned long ba
 	return ppc_md.check_legacy_ioport(base_port);
 }
 EXPORT_SYMBOL(check_legacy_ioport);
+
+static int ppc_panic_event(struct notifier_block *this,
+                             unsigned long event, void *ptr)
+{
+	ppc_md.panic((char *)ptr);  /* May not return */
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block ppc_panic_block = {
+	.notifier_call = ppc_panic_event,
+	.priority = INT_MIN /* may not return; must be done last */
+};
+
+void __init setup_panic(void)
+{
+	atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block);
+}
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 69ac257..9d55234 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -236,6 +236,7 @@ arch_initcall(ppc_init);
 void __init setup_arch(char **cmdline_p)
 {
 	extern void do_init_bootmem(void);
+	extern void setup_panic(void);
 
 	/* so udelay does something sensible, assume <= 1000 bogomips */
 	loops_per_jiffy = 500000000 / HZ;
@@ -285,6 +286,9 @@ #endif
 	/* reboot on panic */
 	panic_timeout = 180;
 
+	if (ppc_md.panic)
+		setup_panic();
+
 	init_mm.start_code = PAGE_OFFSET;
 	init_mm.end_code = (unsigned long) _etext;
 	init_mm.end_data = (unsigned long) _edata;
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4467c49..ff6726f 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -100,12 +100,6 @@ unsigned long SYSRQ_KEY;
 #endif /* CONFIG_MAGIC_SYSRQ */
 
 
-static int ppc64_panic_event(struct notifier_block *, unsigned long, void *);
-static struct notifier_block ppc64_panic_block = {
-	.notifier_call = ppc64_panic_event,
-	.priority = INT_MIN /* may not return; must be done last */
-};
-
 #ifdef CONFIG_SMP
 
 static int smt_enabled_cmdline;
@@ -456,13 +450,6 @@ #endif
 	DBG(" <- setup_system()\n");
 }
 
-static int ppc64_panic_event(struct notifier_block *this,
-                             unsigned long event, void *ptr)
-{
-	ppc_md.panic((char *)ptr);  /* May not return */
-	return NOTIFY_DONE;
-}
-
 #ifdef CONFIG_IRQSTACKS
 static void __init irqstack_early_init(void)
 {
@@ -518,6 +505,7 @@ static void __init emergency_stack_init(
 void __init setup_arch(char **cmdline_p)
 {
 	extern void do_init_bootmem(void);
+	extern void setup_panic(void);
 
 	ppc64_boot_msg(0x12, "Setup Arch");
 
@@ -535,8 +523,7 @@ void __init setup_arch(char **cmdline_p)
 	panic_timeout = 180;
 
 	if (ppc_md.panic)
-		atomic_notifier_chain_register(&panic_notifier_list,
-				&ppc64_panic_block);
+		setup_panic();
 
 	init_mm.start_code = PAGE_OFFSET;
 	init_mm.end_code = (unsigned long) _etext;

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-05-04 21:28 Kumar Gala
@ 2006-05-04 22:09 ` Segher Boessenkool
  2006-05-04 22:10   ` Kumar Gala
  2006-05-04 22:49 ` Paul Mackerras
  1 sibling, 1 reply; 20+ messages in thread
From: Segher Boessenkool @ 2006-05-04 22:09 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel

Hi Kumar,

> +static int ppc_panic_event(struct notifier_block *this,
> +                             unsigned long event, void *ptr)
> +{
> +	ppc_md.panic((char *)ptr);  /* May not return */
> +	return NOTIFY_DONE;
> +}

Lose the redundant pointer cast while you're there please?

>  void __init setup_arch(char **cmdline_p)
>  {
>  	extern void do_init_bootmem(void);
> +	extern void setup_panic(void);

Can those two go into a header file please?


Segher

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-05-04 22:09 ` Segher Boessenkool
@ 2006-05-04 22:10   ` Kumar Gala
  2006-05-04 22:36     ` Segher Boessenkool
  0 siblings, 1 reply; 20+ messages in thread
From: Kumar Gala @ 2006-05-04 22:10 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel


On May 4, 2006, at 5:09 PM, Segher Boessenkool wrote:

> Hi Kumar,
>
>> +static int ppc_panic_event(struct notifier_block *this,
>> +                             unsigned long event, void *ptr)
>> +{
>> +	ppc_md.panic((char *)ptr);  /* May not return */
>> +	return NOTIFY_DONE;
>> +}
>
> Lose the redundant pointer cast while you're there please?
>
>>  void __init setup_arch(char **cmdline_p)
>>  {
>>  	extern void do_init_bootmem(void);
>> +	extern void setup_panic(void);
>
> Can those two go into a header file please?

any suggestions on which header?

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-05-04 22:10   ` Kumar Gala
@ 2006-05-04 22:36     ` Segher Boessenkool
  0 siblings, 0 replies; 20+ messages in thread
From: Segher Boessenkool @ 2006-05-04 22:36 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel

>>>  void __init setup_arch(char **cmdline_p)
>>>  {
>>>  	extern void do_init_bootmem(void);
>>> +	extern void setup_panic(void);
>>
>> Can those two go into a header file please?
>
> any suggestions on which header?

The new one should just go into arch/powerpc/kernel/setup.h;
the bootmem thing could go there as well perhaps.


Segher

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-05-04 21:28 Kumar Gala
  2006-05-04 22:09 ` Segher Boessenkool
@ 2006-05-04 22:49 ` Paul Mackerras
  2006-05-05  4:59   ` Kumar Gala
  1 sibling, 1 reply; 20+ messages in thread
From: Paul Mackerras @ 2006-05-04 22:49 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, linux-kernel

Kumar Gala writes:

> Please pull from 'for_paulus' branch of
> master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git

> --- a/arch/powerpc/kernel/setup_32.c
> +++ b/arch/powerpc/kernel/setup_32.c
> @@ -236,6 +236,7 @@ arch_initcall(ppc_init);
>  void __init setup_arch(char **cmdline_p)
>  {
>  	extern void do_init_bootmem(void);
> +	extern void setup_panic(void);

Urk.

> @@ -285,6 +286,9 @@ #endif
>  	/* reboot on panic */
>  	panic_timeout = 180;
>  
> +	if (ppc_md.panic)
> +		setup_panic();

Since no 32-bit platform sets ppc_md.panic AFAICS, I guess this
doesn't need to be pushed into 2.6.17.  Please redo with setup_panic
declared in a header file.

Paul.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-05-04 22:49 ` Paul Mackerras
@ 2006-05-05  4:59   ` Kumar Gala
  0 siblings, 0 replies; 20+ messages in thread
From: Kumar Gala @ 2006-05-05  4:59 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linux-kernel


On May 4, 2006, at 5:49 PM, Paul Mackerras wrote:

> Kumar Gala writes:
>
>> Please pull from 'for_paulus' branch of
>> master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git
>
>> --- a/arch/powerpc/kernel/setup_32.c
>> +++ b/arch/powerpc/kernel/setup_32.c
>> @@ -236,6 +236,7 @@ arch_initcall(ppc_init);
>>  void __init setup_arch(char **cmdline_p)
>>  {
>>  	extern void do_init_bootmem(void);
>> +	extern void setup_panic(void);
>
> Urk.

Yeah didn't care for it either.  Will move to "setup.h"

>
>> @@ -285,6 +286,9 @@ #endif
>>  	/* reboot on panic */
>>  	panic_timeout = 180;
>>
>> +	if (ppc_md.panic)
>> +		setup_panic();
>
> Since no 32-bit platform sets ppc_md.panic AFAICS, I guess this
> doesn't need to be pushed into 2.6.17.  Please redo with setup_panic
> declared in a header file.

Yeah, this was for 2.6.18. (will do on the header change)

- k

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Please pull from 'for_paulus' branch of powerpc
@ 2006-06-28  6:01 Kumar Gala
  2006-06-28 22:44 ` Jon Loeliger
  0 siblings, 1 reply; 20+ messages in thread
From: Kumar Gala @ 2006-06-28  6:01 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, linux-kernel

Please pull from 'for_paulus' branch of
master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git

to receive the following updates:

 arch/powerpc/kernel/cputable.c             |   12 --
 arch/powerpc/platforms/86xx/mpc86xx.h      |    8 +
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |  128 +++++++++++++++++++++++++--
 arch/powerpc/platforms/86xx/mpc86xx_smp.c  |    9 -
 arch/powerpc/platforms/86xx/pci.c          |  136 +----------------------------
 include/asm-powerpc/mpc86xx.h              |    4 
 6 files changed, 138 insertions(+), 159 deletions(-)

Kumar Gala:
      powerpc: minor cleanups for mpc86xx

diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 1c11488..abf7d42 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -722,18 +722,6 @@ #if CLASSIC_PPC
 		.oprofile_type		= PPC_OPROFILE_G4,
 		.platform		= "ppc7450",
 	},
-        {       /* 8641 */
-               .pvr_mask               = 0xffffffff,
-               .pvr_value              = 0x80040010,
-               .cpu_name               = "8641",
-               .cpu_features           = CPU_FTRS_7447A,
-               .cpu_user_features      = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP,
-               .icache_bsize           = 32,
-               .dcache_bsize           = 32,
-               .num_pmcs               = 6,
-               .cpu_setup              = __setup_cpu_745x
-        },
-
 	{	/* 82xx (8240, 8245, 8260 are all 603e cores) */
 		.pvr_mask		= 0x7fff0000,
 		.pvr_value		= 0x00810000,
diff --git a/arch/powerpc/platforms/86xx/mpc86xx.h b/arch/powerpc/platforms/86xx/mpc86xx.h
index e3c9e4f..2834462 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx.h
+++ b/arch/powerpc/platforms/86xx/mpc86xx.h
@@ -15,11 +15,13 @@ #define __MPC86XX_H__
  * mpc86xx_* files. Mostly for use by mpc86xx_setup().
  */
 
-extern int __init add_bridge(struct device_node *dev);
+extern int add_bridge(struct device_node *dev);
 
-extern void __init setup_indirect_pcie(struct pci_controller *hose,
+extern int mpc86xx_exclude_device(u_char bus, u_char devfn);
+
+extern void setup_indirect_pcie(struct pci_controller *hose,
 				       u32 cfg_addr, u32 cfg_data);
-extern void __init setup_indirect_pcie_nomap(struct pci_controller *hose,
+extern void setup_indirect_pcie_nomap(struct pci_controller *hose,
 					     void __iomem *cfg_addr,
 					     void __iomem *cfg_data);
 
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
index 483c21d..ac7f418 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
@@ -36,6 +36,7 @@ #include <asm/mpic.h>
 #include <sysdev/fsl_soc.h>
 
 #include "mpc86xx.h"
+#include "mpc8641_hpcn.h"
 
 #ifndef CONFIG_PCI
 unsigned long isa_io_base = 0;
@@ -186,17 +187,130 @@ mpc86xx_map_irq(struct pci_dev *dev, uns
 	return PCI_IRQ_TABLE_LOOKUP + I8259_OFFSET;
 }
 
+static void __devinit quirk_ali1575(struct pci_dev *dev)
+{
+	unsigned short temp;
+
+	/*
+	 * ALI1575 interrupts route table setup:
+	 *
+	 * IRQ pin   IRQ#
+	 * PIRQA ---- 3
+	 * PIRQB ---- 4
+	 * PIRQC ---- 5
+	 * PIRQD ---- 6
+	 * PIRQE ---- 9
+	 * PIRQF ---- 10
+	 * PIRQG ---- 11
+	 * PIRQH ---- 12
+	 *
+	 * interrupts for PCI slot0 -- PIRQA / PIRQB / PIRQC / PIRQD
+	 *                PCI slot1 -- PIRQB / PIRQC / PIRQD / PIRQA
+	 */
+	pci_write_config_dword(dev, 0x48, 0xb9317542);
+
+	/* USB 1.1 OHCI controller 1, interrupt: PIRQE */
+	pci_write_config_byte(dev, 0x86, 0x0c);
+
+	/* USB 1.1 OHCI controller 2, interrupt: PIRQF */
+	pci_write_config_byte(dev, 0x87, 0x0d);
+
+	/* USB 1.1 OHCI controller 3, interrupt: PIRQH */
+	pci_write_config_byte(dev, 0x88, 0x0f);
+
+	/* USB 2.0 controller, interrupt: PIRQ7 */
+	pci_write_config_byte(dev, 0x74, 0x06);
+
+	/* Audio controller, interrupt: PIRQE */
+	pci_write_config_byte(dev, 0x8a, 0x0c);
+
+	/* Modem controller, interrupt: PIRQF */
+	pci_write_config_byte(dev, 0x8b, 0x0d);
+
+	/* HD audio controller, interrupt: PIRQG */
+	pci_write_config_byte(dev, 0x8c, 0x0e);
+
+	/* Serial ATA interrupt: PIRQD */
+	pci_write_config_byte(dev, 0x8d, 0x0b);
+
+	/* SMB interrupt: PIRQH */
+	pci_write_config_byte(dev, 0x8e, 0x0f);
+
+	/* PMU ACPI SCI interrupt: PIRQH */
+	pci_write_config_byte(dev, 0x8f, 0x0f);
+
+	/* Primary PATA IDE IRQ: 14
+	 * Secondary PATA IDE IRQ: 15
+	 */
+	pci_write_config_byte(dev, 0x44, 0x3d);
+	pci_write_config_byte(dev, 0x75, 0x0f);
+
+	/* Set IRQ14 and IRQ15 to legacy IRQs */
+	pci_read_config_word(dev, 0x46, &temp);
+	temp |= 0xc000;
+	pci_write_config_word(dev, 0x46, temp);
+
+	/* Set i8259 interrupt trigger
+	 * IRQ 3:  Level
+	 * IRQ 4:  Level
+	 * IRQ 5:  Level
+	 * IRQ 6:  Level
+	 * IRQ 7:  Level
+	 * IRQ 9:  Level
+	 * IRQ 10: Level
+	 * IRQ 11: Level
+	 * IRQ 12: Level
+	 * IRQ 14: Edge
+	 * IRQ 15: Edge
+	 */
+	outb(0xfa, 0x4d0);
+	outb(0x1e, 0x4d1);
+}
 
-int
-mpc86xx_exclude_device(u_char bus, u_char devfn)
+static void __devinit quirk_uli5288(struct pci_dev *dev)
 {
-#if !defined(CONFIG_PCI)
-	if (bus == 0 && PCI_SLOT(devfn) == 0)
-		return PCIBIOS_DEVICE_NOT_FOUND;
-#endif
+	unsigned char c;
+
+	pci_read_config_byte(dev,0x83,&c);
+	c |= 0x80;
+	pci_write_config_byte(dev, 0x83, c);
+
+	pci_write_config_byte(dev, 0x09, 0x01);
+	pci_write_config_byte(dev, 0x0a, 0x06);
+
+	pci_read_config_byte(dev,0x83,&c);
+	c &= 0x7f;
+	pci_write_config_byte(dev, 0x83, c);
 
-	return PCIBIOS_SUCCESSFUL;
+	pci_read_config_byte(dev,0x84,&c);
+	c |= 0x01;
+	pci_write_config_byte(dev, 0x84, c);
 }
+
+static void __devinit quirk_uli5229(struct pci_dev *dev)
+{
+	unsigned short temp;
+	pci_write_config_word(dev, 0x04, 0x0405);
+	pci_read_config_word(dev, 0x4a, &temp);
+	temp |= 0x1000;
+	pci_write_config_word(dev, 0x4a, temp);
+}
+
+static void __devinit early_uli5249(struct pci_dev *dev)
+{
+	unsigned char temp;
+	pci_write_config_word(dev, 0x04, 0x0007);
+	pci_read_config_byte(dev, 0x7c, &temp);
+	pci_write_config_byte(dev, 0x7c, 0x80);
+	pci_write_config_byte(dev, 0x09, 0x01);
+	pci_write_config_byte(dev, 0x7c, temp);
+	dev->class |= 0x1;
+}
+
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, quirk_ali1575);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 0x5249, early_uli5249);
 #endif /* CONFIG_PCI */
 
 
diff --git a/arch/powerpc/platforms/86xx/mpc86xx_smp.c b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
index 944ec4b..9cca3d1 100644
--- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
+++ b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
@@ -34,8 +34,8 @@ extern unsigned long __secondary_hold_ac
 static void __init
 smp_86xx_release_core(int nr)
 {
-	void *mcm_vaddr;
-	unsigned long vaddr, pcr;
+	__be32 __iomem *mcm_vaddr;
+	unsigned long pcr;
 
 	if (nr < 0 || nr >= NR_CPUS)
 		return;
@@ -45,10 +45,9 @@ smp_86xx_release_core(int nr)
 	 */
 	mcm_vaddr = ioremap(get_immrbase() + MPC86xx_MCM_OFFSET,
 			    MPC86xx_MCM_SIZE);
-	vaddr = (unsigned long)mcm_vaddr +  MCM_PORT_CONFIG_OFFSET;
-	pcr = in_be32((volatile unsigned *)vaddr);
+	pcr = in_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2));
 	pcr |= 1 << (nr + 24);
-	out_be32((volatile unsigned *)vaddr, pcr);
+	out_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2), pcr);
 }
 
 
diff --git a/arch/powerpc/platforms/86xx/pci.c b/arch/powerpc/platforms/86xx/pci.c
index 5180df7..0d8b340 100644
--- a/arch/powerpc/platforms/86xx/pci.c
+++ b/arch/powerpc/platforms/86xx/pci.c
@@ -122,15 +122,12 @@ static void __init setup_pcie_atmu(struc
 static void __init
 mpc86xx_setup_pcie(struct pci_controller *hose, u32 pcie_offset, u32 pcie_size)
 {
-	volatile struct ccsr_pex *pcie;
 	u16 cmd;
 	unsigned int temps;
 
 	DBG("PCIE host controller register offset 0x%08x, size 0x%08x.\n",
 			pcie_offset, pcie_size);
 
-	pcie = ioremap(pcie_offset, pcie_size);
-
 	early_read_config_word(hose, 0, 0, PCI_COMMAND, &cmd);
 	cmd |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY
 	    | PCI_COMMAND_IO;
@@ -144,6 +141,14 @@ mpc86xx_setup_pcie(struct pci_controller
 	early_write_config_dword(hose, 0, 0, PCI_PRIMARY_BUS, temps);
 }
 
+int mpc86xx_exclude_device(u_char bus, u_char devfn)
+{
+	if (bus == 0 && PCI_SLOT(devfn) == 0)
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
+	return PCIBIOS_SUCCESSFUL;
+}
+
 int __init add_bridge(struct device_node *dev)
 {
 	int len;
@@ -198,128 +203,3 @@ int __init add_bridge(struct device_node
 
 	return 0;
 }
-
-static void __devinit quirk_ali1575(struct pci_dev *dev)
-{
-	unsigned short temp;
-
-	/*
-	 * ALI1575 interrupts route table setup:
-	 *
-	 * IRQ pin   IRQ#
-	 * PIRQA ---- 3
-	 * PIRQB ---- 4
-	 * PIRQC ---- 5
-	 * PIRQD ---- 6
-	 * PIRQE ---- 9
-	 * PIRQF ---- 10
-	 * PIRQG ---- 11
-	 * PIRQH ---- 12
-	 *
-	 * interrupts for PCI slot0 -- PIRQA / PIRQB / PIRQC / PIRQD
-	 *                PCI slot1 -- PIRQB / PIRQC / PIRQD / PIRQA
-	 */
-	pci_write_config_dword(dev, 0x48, 0xb9317542);
-
-	/* USB 1.1 OHCI controller 1, interrupt: PIRQE */
-	pci_write_config_byte(dev, 0x86, 0x0c);
-
-	/* USB 1.1 OHCI controller 2, interrupt: PIRQF */
-	pci_write_config_byte(dev, 0x87, 0x0d);
-
-	/* USB 1.1 OHCI controller 3, interrupt: PIRQH */
-	pci_write_config_byte(dev, 0x88, 0x0f);
-
-	/* USB 2.0 controller, interrupt: PIRQ7 */
-	pci_write_config_byte(dev, 0x74, 0x06);
-
-	/* Audio controller, interrupt: PIRQE */
-	pci_write_config_byte(dev, 0x8a, 0x0c);
-
-	/* Modem controller, interrupt: PIRQF */
-	pci_write_config_byte(dev, 0x8b, 0x0d);
-
-	/* HD audio controller, interrupt: PIRQG */
-	pci_write_config_byte(dev, 0x8c, 0x0e);
-
-	/* Serial ATA interrupt: PIRQD */
-	pci_write_config_byte(dev, 0x8d, 0x0b);
-
-	/* SMB interrupt: PIRQH */
-	pci_write_config_byte(dev, 0x8e, 0x0f);
-
-	/* PMU ACPI SCI interrupt: PIRQH */
-	pci_write_config_byte(dev, 0x8f, 0x0f);
-
-	/* Primary PATA IDE IRQ: 14
-	 * Secondary PATA IDE IRQ: 15
-	 */
-	pci_write_config_byte(dev, 0x44, 0x3d);
-	pci_write_config_byte(dev, 0x75, 0x0f);
-
-	/* Set IRQ14 and IRQ15 to legacy IRQs */
-	pci_read_config_word(dev, 0x46, &temp);
-	temp |= 0xc000;
-	pci_write_config_word(dev, 0x46, temp);
-
-	/* Set i8259 interrupt trigger
-	 * IRQ 3:  Level
-	 * IRQ 4:  Level
-	 * IRQ 5:  Level
-	 * IRQ 6:  Level
-	 * IRQ 7:  Level
-	 * IRQ 9:  Level
-	 * IRQ 10: Level
-	 * IRQ 11: Level
-	 * IRQ 12: Level
-	 * IRQ 14: Edge
-	 * IRQ 15: Edge
-	 */
-	outb(0xfa, 0x4d0);
-	outb(0x1e, 0x4d1);
-}
-
-static void __devinit quirk_uli5288(struct pci_dev *dev)
-{
-	unsigned char c;
-
-	pci_read_config_byte(dev,0x83,&c);
-	c |= 0x80;
-	pci_write_config_byte(dev, 0x83, c);
-
-	pci_write_config_byte(dev, 0x09, 0x01);
-	pci_write_config_byte(dev, 0x0a, 0x06);
-
-	pci_read_config_byte(dev,0x83,&c);
-	c &= 0x7f;
-	pci_write_config_byte(dev, 0x83, c);
-
-	pci_read_config_byte(dev,0x84,&c);
-	c |= 0x01;
-	pci_write_config_byte(dev, 0x84, c);
-}
-
-static void __devinit quirk_uli5229(struct pci_dev *dev)
-{
-	unsigned short temp;
-	pci_write_config_word(dev, 0x04, 0x0405);
-	pci_read_config_word(dev, 0x4a, &temp);
-	temp |= 0x1000;
-	pci_write_config_word(dev, 0x4a, temp);
-}
-
-static void __devinit early_uli5249(struct pci_dev *dev)
-{
-	unsigned char temp;
-	pci_write_config_word(dev, 0x04, 0x0007);
-	pci_read_config_byte(dev, 0x7c, &temp);
-	pci_write_config_byte(dev, 0x7c, 0x80);
-	pci_write_config_byte(dev, 0x09, 0x01);
-	pci_write_config_byte(dev, 0x7c, temp);
-	dev->class |= 0x1;
-}
-
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, quirk_ali1575);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
-DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 0x5249, early_uli5249);
diff --git a/include/asm-powerpc/mpc86xx.h b/include/asm-powerpc/mpc86xx.h
index d0a6718..00d72a7 100644
--- a/include/asm-powerpc/mpc86xx.h
+++ b/include/asm-powerpc/mpc86xx.h
@@ -20,10 +20,6 @@ #include <asm/mmu.h>
 
 #ifdef CONFIG_PPC_86xx
 
-#ifdef CONFIG_MPC8641_HPCN
-#include <platforms/86xx/mpc8641_hpcn.h>
-#endif
-
 #define _IO_BASE        isa_io_base
 #define _ISA_MEM_BASE   isa_mem_base
 #ifdef CONFIG_PCI

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* RE: Please pull from 'for_paulus' branch of powerpc
@ 2006-06-28  6:26 Zhang Wei-r63237
  2006-06-28 13:19 ` Kumar Gala
  0 siblings, 1 reply; 20+ messages in thread
From: Zhang Wei-r63237 @ 2006-06-28  6:26 UTC (permalink / raw)
  To: Kumar Gala, Paul Mackerras; +Cc: linuxppc-dev, linux-kernel

Hi, Kumar,

Why moving these codes from pci.c to mpc86xx_hpcn.c? It's not must be.
These functions relate to PCI device of MPC8641D HPCn platform. 
And we can also see the 'DECLARE_PCI_FIXUP_HEADER()' declaration in pci.c of Powermac platform.

Best Regards,
Zhang Wei

> -----Original Message-----
> From: linuxppc-dev-bounces+wei.zhang=freescale.com@ozlabs.org 
> [mailto:linuxppc-dev-bounces+wei.zhang=freescale.com@ozlabs.or
> g] On Behalf Of Kumar Gala
> Sent: Wednesday, June 28, 2006 2:01 PM
> To: Paul Mackerras
> Cc: linuxppc-dev@ozlabs.org; linux-kernel@vger.kernel.org
> Subject: Please pull from 'for_paulus' branch of powerpc
> 
> Please pull from 'for_paulus' branch of
> master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git
> 
> to receive the following updates:
> 
>  arch/powerpc/kernel/cputable.c             |   12 --
>  arch/powerpc/platforms/86xx/mpc86xx.h      |    8 +
>  arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |  128 
> +++++++++++++++++++++++++--
>  arch/powerpc/platforms/86xx/mpc86xx_smp.c  |    9 -
>  arch/powerpc/platforms/86xx/pci.c          |  136 
> +----------------------------
>  include/asm-powerpc/mpc86xx.h              |    4 
>  6 files changed, 138 insertions(+), 159 deletions(-)
> 
> Kumar Gala:
>       powerpc: minor cleanups for mpc86xx
> 
> diff --git a/arch/powerpc/kernel/cputable.c 
> b/arch/powerpc/kernel/cputable.c index 1c11488..abf7d42 100644
> --- a/arch/powerpc/kernel/cputable.c
> +++ b/arch/powerpc/kernel/cputable.c
> @@ -722,18 +722,6 @@ #if CLASSIC_PPC
>  		.oprofile_type		= PPC_OPROFILE_G4,
>  		.platform		= "ppc7450",
>  	},
> -        {       /* 8641 */
> -               .pvr_mask               = 0xffffffff,
> -               .pvr_value              = 0x80040010,
> -               .cpu_name               = "8641",
> -               .cpu_features           = CPU_FTRS_7447A,
> -               .cpu_user_features      = COMMON_USER | 
> PPC_FEATURE_HAS_ALTIVEC_COMP,
> -               .icache_bsize           = 32,
> -               .dcache_bsize           = 32,
> -               .num_pmcs               = 6,
> -               .cpu_setup              = __setup_cpu_745x
> -        },
> -
>  	{	/* 82xx (8240, 8245, 8260 are all 603e cores) */
>  		.pvr_mask		= 0x7fff0000,
>  		.pvr_value		= 0x00810000,
> diff --git a/arch/powerpc/platforms/86xx/mpc86xx.h 
> b/arch/powerpc/platforms/86xx/mpc86xx.h
> index e3c9e4f..2834462 100644
> --- a/arch/powerpc/platforms/86xx/mpc86xx.h
> +++ b/arch/powerpc/platforms/86xx/mpc86xx.h
> @@ -15,11 +15,13 @@ #define __MPC86XX_H__
>   * mpc86xx_* files. Mostly for use by mpc86xx_setup().
>   */
>  
> -extern int __init add_bridge(struct device_node *dev);
> +extern int add_bridge(struct device_node *dev);
>  
> -extern void __init setup_indirect_pcie(struct pci_controller *hose,
> +extern int mpc86xx_exclude_device(u_char bus, u_char devfn);
> +
> +extern void setup_indirect_pcie(struct pci_controller *hose,
>  				       u32 cfg_addr, u32 
> cfg_data); -extern void __init 
> setup_indirect_pcie_nomap(struct pci_controller *hose,
> +extern void setup_indirect_pcie_nomap(struct pci_controller *hose,
>  					     void __iomem *cfg_addr,
>  					     void __iomem *cfg_data);
>  
> diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c 
> b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
> index 483c21d..ac7f418 100644
> --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
> +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
> @@ -36,6 +36,7 @@ #include <asm/mpic.h>
>  #include <sysdev/fsl_soc.h>
>  
>  #include "mpc86xx.h"
> +#include "mpc8641_hpcn.h"
>  
>  #ifndef CONFIG_PCI
>  unsigned long isa_io_base = 0;
> @@ -186,17 +187,130 @@ mpc86xx_map_irq(struct pci_dev *dev, uns
>  	return PCI_IRQ_TABLE_LOOKUP + I8259_OFFSET;  }
>  
> +static void __devinit quirk_ali1575(struct pci_dev *dev) {
> +	unsigned short temp;
> +
> +	/*
> +	 * ALI1575 interrupts route table setup:
> +	 *
> +	 * IRQ pin   IRQ#
> +	 * PIRQA ---- 3
> +	 * PIRQB ---- 4
> +	 * PIRQC ---- 5
> +	 * PIRQD ---- 6
> +	 * PIRQE ---- 9
> +	 * PIRQF ---- 10
> +	 * PIRQG ---- 11
> +	 * PIRQH ---- 12
> +	 *
> +	 * interrupts for PCI slot0 -- PIRQA / PIRQB / PIRQC / PIRQD
> +	 *                PCI slot1 -- PIRQB / PIRQC / PIRQD / PIRQA
> +	 */
> +	pci_write_config_dword(dev, 0x48, 0xb9317542);
> +
> +	/* USB 1.1 OHCI controller 1, interrupt: PIRQE */
> +	pci_write_config_byte(dev, 0x86, 0x0c);
> +
> +	/* USB 1.1 OHCI controller 2, interrupt: PIRQF */
> +	pci_write_config_byte(dev, 0x87, 0x0d);
> +
> +	/* USB 1.1 OHCI controller 3, interrupt: PIRQH */
> +	pci_write_config_byte(dev, 0x88, 0x0f);
> +
> +	/* USB 2.0 controller, interrupt: PIRQ7 */
> +	pci_write_config_byte(dev, 0x74, 0x06);
> +
> +	/* Audio controller, interrupt: PIRQE */
> +	pci_write_config_byte(dev, 0x8a, 0x0c);
> +
> +	/* Modem controller, interrupt: PIRQF */
> +	pci_write_config_byte(dev, 0x8b, 0x0d);
> +
> +	/* HD audio controller, interrupt: PIRQG */
> +	pci_write_config_byte(dev, 0x8c, 0x0e);
> +
> +	/* Serial ATA interrupt: PIRQD */
> +	pci_write_config_byte(dev, 0x8d, 0x0b);
> +
> +	/* SMB interrupt: PIRQH */
> +	pci_write_config_byte(dev, 0x8e, 0x0f);
> +
> +	/* PMU ACPI SCI interrupt: PIRQH */
> +	pci_write_config_byte(dev, 0x8f, 0x0f);
> +
> +	/* Primary PATA IDE IRQ: 14
> +	 * Secondary PATA IDE IRQ: 15
> +	 */
> +	pci_write_config_byte(dev, 0x44, 0x3d);
> +	pci_write_config_byte(dev, 0x75, 0x0f);
> +
> +	/* Set IRQ14 and IRQ15 to legacy IRQs */
> +	pci_read_config_word(dev, 0x46, &temp);
> +	temp |= 0xc000;
> +	pci_write_config_word(dev, 0x46, temp);
> +
> +	/* Set i8259 interrupt trigger
> +	 * IRQ 3:  Level
> +	 * IRQ 4:  Level
> +	 * IRQ 5:  Level
> +	 * IRQ 6:  Level
> +	 * IRQ 7:  Level
> +	 * IRQ 9:  Level
> +	 * IRQ 10: Level
> +	 * IRQ 11: Level
> +	 * IRQ 12: Level
> +	 * IRQ 14: Edge
> +	 * IRQ 15: Edge
> +	 */
> +	outb(0xfa, 0x4d0);
> +	outb(0x1e, 0x4d1);
> +}
>  
> -int
> -mpc86xx_exclude_device(u_char bus, u_char devfn)
> +static void __devinit quirk_uli5288(struct pci_dev *dev)
>  {
> -#if !defined(CONFIG_PCI)
> -	if (bus == 0 && PCI_SLOT(devfn) == 0)
> -		return PCIBIOS_DEVICE_NOT_FOUND;
> -#endif
> +	unsigned char c;
> +
> +	pci_read_config_byte(dev,0x83,&c);
> +	c |= 0x80;
> +	pci_write_config_byte(dev, 0x83, c);
> +
> +	pci_write_config_byte(dev, 0x09, 0x01);
> +	pci_write_config_byte(dev, 0x0a, 0x06);
> +
> +	pci_read_config_byte(dev,0x83,&c);
> +	c &= 0x7f;
> +	pci_write_config_byte(dev, 0x83, c);
>  
> -	return PCIBIOS_SUCCESSFUL;
> +	pci_read_config_byte(dev,0x84,&c);
> +	c |= 0x01;
> +	pci_write_config_byte(dev, 0x84, c);
>  }
> +
> +static void __devinit quirk_uli5229(struct pci_dev *dev) {
> +	unsigned short temp;
> +	pci_write_config_word(dev, 0x04, 0x0405);
> +	pci_read_config_word(dev, 0x4a, &temp);
> +	temp |= 0x1000;
> +	pci_write_config_word(dev, 0x4a, temp); }
> +
> +static void __devinit early_uli5249(struct pci_dev *dev) {
> +	unsigned char temp;
> +	pci_write_config_word(dev, 0x04, 0x0007);
> +	pci_read_config_byte(dev, 0x7c, &temp);
> +	pci_write_config_byte(dev, 0x7c, 0x80);
> +	pci_write_config_byte(dev, 0x09, 0x01);
> +	pci_write_config_byte(dev, 0x7c, temp);
> +	dev->class |= 0x1;
> +}
> +
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, quirk_ali1575); 
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288); 
> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229); 
> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 0x5249, early_uli5249);
>  #endif /* CONFIG_PCI */
>  
>  
> diff --git a/arch/powerpc/platforms/86xx/mpc86xx_smp.c 
> b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
> index 944ec4b..9cca3d1 100644
> --- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
> +++ b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
> @@ -34,8 +34,8 @@ extern unsigned long __secondary_hold_ac  
> static void __init  smp_86xx_release_core(int nr)  {
> -	void *mcm_vaddr;
> -	unsigned long vaddr, pcr;
> +	__be32 __iomem *mcm_vaddr;
> +	unsigned long pcr;
>  
>  	if (nr < 0 || nr >= NR_CPUS)
>  		return;
> @@ -45,10 +45,9 @@ smp_86xx_release_core(int nr)
>  	 */
>  	mcm_vaddr = ioremap(get_immrbase() + MPC86xx_MCM_OFFSET,
>  			    MPC86xx_MCM_SIZE);
> -	vaddr = (unsigned long)mcm_vaddr +  MCM_PORT_CONFIG_OFFSET;
> -	pcr = in_be32((volatile unsigned *)vaddr);
> +	pcr = in_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2));
>  	pcr |= 1 << (nr + 24);
> -	out_be32((volatile unsigned *)vaddr, pcr);
> +	out_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2), pcr);
>  }
>  
>  
> diff --git a/arch/powerpc/platforms/86xx/pci.c 
> b/arch/powerpc/platforms/86xx/pci.c
> index 5180df7..0d8b340 100644
> --- a/arch/powerpc/platforms/86xx/pci.c
> +++ b/arch/powerpc/platforms/86xx/pci.c
> @@ -122,15 +122,12 @@ static void __init 
> setup_pcie_atmu(struc  static void __init  
> mpc86xx_setup_pcie(struct pci_controller *hose, u32 
> pcie_offset, u32 pcie_size)  {
> -	volatile struct ccsr_pex *pcie;
>  	u16 cmd;
>  	unsigned int temps;
>  
>  	DBG("PCIE host controller register offset 0x%08x, size 
> 0x%08x.\n",
>  			pcie_offset, pcie_size);
>  
> -	pcie = ioremap(pcie_offset, pcie_size);
> -
>  	early_read_config_word(hose, 0, 0, PCI_COMMAND, &cmd);
>  	cmd |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | 
> PCI_COMMAND_MEMORY
>  	    | PCI_COMMAND_IO;
> @@ -144,6 +141,14 @@ mpc86xx_setup_pcie(struct pci_controller
>  	early_write_config_dword(hose, 0, 0, PCI_PRIMARY_BUS, temps);  }
>  
> +int mpc86xx_exclude_device(u_char bus, u_char devfn) {
> +	if (bus == 0 && PCI_SLOT(devfn) == 0)
> +		return PCIBIOS_DEVICE_NOT_FOUND;
> +
> +	return PCIBIOS_SUCCESSFUL;
> +}
> +
>  int __init add_bridge(struct device_node *dev)  {
>  	int len;
> @@ -198,128 +203,3 @@ int __init add_bridge(struct device_node
>  
>  	return 0;
>  }
> -
> -static void __devinit quirk_ali1575(struct pci_dev *dev) -{
> -	unsigned short temp;
> -
> -	/*
> -	 * ALI1575 interrupts route table setup:
> -	 *
> -	 * IRQ pin   IRQ#
> -	 * PIRQA ---- 3
> -	 * PIRQB ---- 4
> -	 * PIRQC ---- 5
> -	 * PIRQD ---- 6
> -	 * PIRQE ---- 9
> -	 * PIRQF ---- 10
> -	 * PIRQG ---- 11
> -	 * PIRQH ---- 12
> -	 *
> -	 * interrupts for PCI slot0 -- PIRQA / PIRQB / PIRQC / PIRQD
> -	 *                PCI slot1 -- PIRQB / PIRQC / PIRQD / PIRQA
> -	 */
> -	pci_write_config_dword(dev, 0x48, 0xb9317542);
> -
> -	/* USB 1.1 OHCI controller 1, interrupt: PIRQE */
> -	pci_write_config_byte(dev, 0x86, 0x0c);
> -
> -	/* USB 1.1 OHCI controller 2, interrupt: PIRQF */
> -	pci_write_config_byte(dev, 0x87, 0x0d);
> -
> -	/* USB 1.1 OHCI controller 3, interrupt: PIRQH */
> -	pci_write_config_byte(dev, 0x88, 0x0f);
> -
> -	/* USB 2.0 controller, interrupt: PIRQ7 */
> -	pci_write_config_byte(dev, 0x74, 0x06);
> -
> -	/* Audio controller, interrupt: PIRQE */
> -	pci_write_config_byte(dev, 0x8a, 0x0c);
> -
> -	/* Modem controller, interrupt: PIRQF */
> -	pci_write_config_byte(dev, 0x8b, 0x0d);
> -
> -	/* HD audio controller, interrupt: PIRQG */
> -	pci_write_config_byte(dev, 0x8c, 0x0e);
> -
> -	/* Serial ATA interrupt: PIRQD */
> -	pci_write_config_byte(dev, 0x8d, 0x0b);
> -
> -	/* SMB interrupt: PIRQH */
> -	pci_write_config_byte(dev, 0x8e, 0x0f);
> -
> -	/* PMU ACPI SCI interrupt: PIRQH */
> -	pci_write_config_byte(dev, 0x8f, 0x0f);
> -
> -	/* Primary PATA IDE IRQ: 14
> -	 * Secondary PATA IDE IRQ: 15
> -	 */
> -	pci_write_config_byte(dev, 0x44, 0x3d);
> -	pci_write_config_byte(dev, 0x75, 0x0f);
> -
> -	/* Set IRQ14 and IRQ15 to legacy IRQs */
> -	pci_read_config_word(dev, 0x46, &temp);
> -	temp |= 0xc000;
> -	pci_write_config_word(dev, 0x46, temp);
> -
> -	/* Set i8259 interrupt trigger
> -	 * IRQ 3:  Level
> -	 * IRQ 4:  Level
> -	 * IRQ 5:  Level
> -	 * IRQ 6:  Level
> -	 * IRQ 7:  Level
> -	 * IRQ 9:  Level
> -	 * IRQ 10: Level
> -	 * IRQ 11: Level
> -	 * IRQ 12: Level
> -	 * IRQ 14: Edge
> -	 * IRQ 15: Edge
> -	 */
> -	outb(0xfa, 0x4d0);
> -	outb(0x1e, 0x4d1);
> -}
> -
> -static void __devinit quirk_uli5288(struct pci_dev *dev) -{
> -	unsigned char c;
> -
> -	pci_read_config_byte(dev,0x83,&c);
> -	c |= 0x80;
> -	pci_write_config_byte(dev, 0x83, c);
> -
> -	pci_write_config_byte(dev, 0x09, 0x01);
> -	pci_write_config_byte(dev, 0x0a, 0x06);
> -
> -	pci_read_config_byte(dev,0x83,&c);
> -	c &= 0x7f;
> -	pci_write_config_byte(dev, 0x83, c);
> -
> -	pci_read_config_byte(dev,0x84,&c);
> -	c |= 0x01;
> -	pci_write_config_byte(dev, 0x84, c);
> -}
> -
> -static void __devinit quirk_uli5229(struct pci_dev *dev) -{
> -	unsigned short temp;
> -	pci_write_config_word(dev, 0x04, 0x0405);
> -	pci_read_config_word(dev, 0x4a, &temp);
> -	temp |= 0x1000;
> -	pci_write_config_word(dev, 0x4a, temp);
> -}
> -
> -static void __devinit early_uli5249(struct pci_dev *dev) -{
> -	unsigned char temp;
> -	pci_write_config_word(dev, 0x04, 0x0007);
> -	pci_read_config_byte(dev, 0x7c, &temp);
> -	pci_write_config_byte(dev, 0x7c, 0x80);
> -	pci_write_config_byte(dev, 0x09, 0x01);
> -	pci_write_config_byte(dev, 0x7c, temp);
> -	dev->class |= 0x1;
> -}
> -
> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, 
> quirk_ali1575); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 
> 0x5288, quirk_uli5288); 
> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, 
> quirk_uli5229); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 
> 0x5249, early_uli5249); diff --git 
> a/include/asm-powerpc/mpc86xx.h 
> b/include/asm-powerpc/mpc86xx.h index d0a6718..00d72a7 100644
> --- a/include/asm-powerpc/mpc86xx.h
> +++ b/include/asm-powerpc/mpc86xx.h
> @@ -20,10 +20,6 @@ #include <asm/mmu.h>
>  
>  #ifdef CONFIG_PPC_86xx
>  
> -#ifdef CONFIG_MPC8641_HPCN
> -#include <platforms/86xx/mpc8641_hpcn.h> -#endif
> -
>  #define _IO_BASE        isa_io_base
>  #define _ISA_MEM_BASE   isa_mem_base
>  #ifdef CONFIG_PCI
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-06-28  6:26 Zhang Wei-r63237
@ 2006-06-28 13:19 ` Kumar Gala
  0 siblings, 0 replies; 20+ messages in thread
From: Kumar Gala @ 2006-06-28 13:19 UTC (permalink / raw)
  To: Zhang Wei-r63237; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel


On Jun 28, 2006, at 1:26 AM, Zhang Wei-r63237 wrote:

> Hi, Kumar,
>
> Why moving these codes from pci.c to mpc86xx_hpcn.c? It's not must be.
> These functions relate to PCI device of MPC8641D HPCn platform.
> And we can also see the 'DECLARE_PCI_FIXUP_HEADER()' declaration in  
> pci.c of Powermac platform.

The point for moving is 86xx/pci.c should apply to all 86xx systems,  
not just the HPCn system.

- kumar

>> -----Original Message-----
>> From: linuxppc-dev-bounces+wei.zhang=freescale.com@ozlabs.org
>> [mailto:linuxppc-dev-bounces+wei.zhang=freescale.com@ozlabs.or
>> g] On Behalf Of Kumar Gala
>> Sent: Wednesday, June 28, 2006 2:01 PM
>> To: Paul Mackerras
>> Cc: linuxppc-dev@ozlabs.org; linux-kernel@vger.kernel.org
>> Subject: Please pull from 'for_paulus' branch of powerpc
>>
>> Please pull from 'for_paulus' branch of
>> master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git
>>
>> to receive the following updates:
>>
>>  arch/powerpc/kernel/cputable.c             |   12 --
>>  arch/powerpc/platforms/86xx/mpc86xx.h      |    8 +
>>  arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |  128
>> +++++++++++++++++++++++++--
>>  arch/powerpc/platforms/86xx/mpc86xx_smp.c  |    9 -
>>  arch/powerpc/platforms/86xx/pci.c          |  136
>> +----------------------------
>>  include/asm-powerpc/mpc86xx.h              |    4
>>  6 files changed, 138 insertions(+), 159 deletions(-)
>>
>> Kumar Gala:
>>       powerpc: minor cleanups for mpc86xx
>>
>> diff --git a/arch/powerpc/kernel/cputable.c
>> b/arch/powerpc/kernel/cputable.c index 1c11488..abf7d42 100644
>> --- a/arch/powerpc/kernel/cputable.c
>> +++ b/arch/powerpc/kernel/cputable.c
>> @@ -722,18 +722,6 @@ #if CLASSIC_PPC
>>  		.oprofile_type		= PPC_OPROFILE_G4,
>>  		.platform		= "ppc7450",
>>  	},
>> -        {       /* 8641 */
>> -               .pvr_mask               = 0xffffffff,
>> -               .pvr_value              = 0x80040010,
>> -               .cpu_name               = "8641",
>> -               .cpu_features           = CPU_FTRS_7447A,
>> -               .cpu_user_features      = COMMON_USER |
>> PPC_FEATURE_HAS_ALTIVEC_COMP,
>> -               .icache_bsize           = 32,
>> -               .dcache_bsize           = 32,
>> -               .num_pmcs               = 6,
>> -               .cpu_setup              = __setup_cpu_745x
>> -        },
>> -
>>  	{	/* 82xx (8240, 8245, 8260 are all 603e cores) */
>>  		.pvr_mask		= 0x7fff0000,
>>  		.pvr_value		= 0x00810000,
>> diff --git a/arch/powerpc/platforms/86xx/mpc86xx.h
>> b/arch/powerpc/platforms/86xx/mpc86xx.h
>> index e3c9e4f..2834462 100644
>> --- a/arch/powerpc/platforms/86xx/mpc86xx.h
>> +++ b/arch/powerpc/platforms/86xx/mpc86xx.h
>> @@ -15,11 +15,13 @@ #define __MPC86XX_H__
>>   * mpc86xx_* files. Mostly for use by mpc86xx_setup().
>>   */
>>
>> -extern int __init add_bridge(struct device_node *dev);
>> +extern int add_bridge(struct device_node *dev);
>>
>> -extern void __init setup_indirect_pcie(struct pci_controller *hose,
>> +extern int mpc86xx_exclude_device(u_char bus, u_char devfn);
>> +
>> +extern void setup_indirect_pcie(struct pci_controller *hose,
>>  				       u32 cfg_addr, u32
>> cfg_data); -extern void __init
>> setup_indirect_pcie_nomap(struct pci_controller *hose,
>> +extern void setup_indirect_pcie_nomap(struct pci_controller *hose,
>>  					     void __iomem *cfg_addr,
>>  					     void __iomem *cfg_data);
>>
>> diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
>> b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
>> index 483c21d..ac7f418 100644
>> --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
>> +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
>> @@ -36,6 +36,7 @@ #include <asm/mpic.h>
>>  #include <sysdev/fsl_soc.h>
>>
>>  #include "mpc86xx.h"
>> +#include "mpc8641_hpcn.h"
>>
>>  #ifndef CONFIG_PCI
>>  unsigned long isa_io_base = 0;
>> @@ -186,17 +187,130 @@ mpc86xx_map_irq(struct pci_dev *dev, uns
>>  	return PCI_IRQ_TABLE_LOOKUP + I8259_OFFSET;  }
>>
>> +static void __devinit quirk_ali1575(struct pci_dev *dev) {
>> +	unsigned short temp;
>> +
>> +	/*
>> +	 * ALI1575 interrupts route table setup:
>> +	 *
>> +	 * IRQ pin   IRQ#
>> +	 * PIRQA ---- 3
>> +	 * PIRQB ---- 4
>> +	 * PIRQC ---- 5
>> +	 * PIRQD ---- 6
>> +	 * PIRQE ---- 9
>> +	 * PIRQF ---- 10
>> +	 * PIRQG ---- 11
>> +	 * PIRQH ---- 12
>> +	 *
>> +	 * interrupts for PCI slot0 -- PIRQA / PIRQB / PIRQC / PIRQD
>> +	 *                PCI slot1 -- PIRQB / PIRQC / PIRQD / PIRQA
>> +	 */
>> +	pci_write_config_dword(dev, 0x48, 0xb9317542);
>> +
>> +	/* USB 1.1 OHCI controller 1, interrupt: PIRQE */
>> +	pci_write_config_byte(dev, 0x86, 0x0c);
>> +
>> +	/* USB 1.1 OHCI controller 2, interrupt: PIRQF */
>> +	pci_write_config_byte(dev, 0x87, 0x0d);
>> +
>> +	/* USB 1.1 OHCI controller 3, interrupt: PIRQH */
>> +	pci_write_config_byte(dev, 0x88, 0x0f);
>> +
>> +	/* USB 2.0 controller, interrupt: PIRQ7 */
>> +	pci_write_config_byte(dev, 0x74, 0x06);
>> +
>> +	/* Audio controller, interrupt: PIRQE */
>> +	pci_write_config_byte(dev, 0x8a, 0x0c);
>> +
>> +	/* Modem controller, interrupt: PIRQF */
>> +	pci_write_config_byte(dev, 0x8b, 0x0d);
>> +
>> +	/* HD audio controller, interrupt: PIRQG */
>> +	pci_write_config_byte(dev, 0x8c, 0x0e);
>> +
>> +	/* Serial ATA interrupt: PIRQD */
>> +	pci_write_config_byte(dev, 0x8d, 0x0b);
>> +
>> +	/* SMB interrupt: PIRQH */
>> +	pci_write_config_byte(dev, 0x8e, 0x0f);
>> +
>> +	/* PMU ACPI SCI interrupt: PIRQH */
>> +	pci_write_config_byte(dev, 0x8f, 0x0f);
>> +
>> +	/* Primary PATA IDE IRQ: 14
>> +	 * Secondary PATA IDE IRQ: 15
>> +	 */
>> +	pci_write_config_byte(dev, 0x44, 0x3d);
>> +	pci_write_config_byte(dev, 0x75, 0x0f);
>> +
>> +	/* Set IRQ14 and IRQ15 to legacy IRQs */
>> +	pci_read_config_word(dev, 0x46, &temp);
>> +	temp |= 0xc000;
>> +	pci_write_config_word(dev, 0x46, temp);
>> +
>> +	/* Set i8259 interrupt trigger
>> +	 * IRQ 3:  Level
>> +	 * IRQ 4:  Level
>> +	 * IRQ 5:  Level
>> +	 * IRQ 6:  Level
>> +	 * IRQ 7:  Level
>> +	 * IRQ 9:  Level
>> +	 * IRQ 10: Level
>> +	 * IRQ 11: Level
>> +	 * IRQ 12: Level
>> +	 * IRQ 14: Edge
>> +	 * IRQ 15: Edge
>> +	 */
>> +	outb(0xfa, 0x4d0);
>> +	outb(0x1e, 0x4d1);
>> +}
>>
>> -int
>> -mpc86xx_exclude_device(u_char bus, u_char devfn)
>> +static void __devinit quirk_uli5288(struct pci_dev *dev)
>>  {
>> -#if !defined(CONFIG_PCI)
>> -	if (bus == 0 && PCI_SLOT(devfn) == 0)
>> -		return PCIBIOS_DEVICE_NOT_FOUND;
>> -#endif
>> +	unsigned char c;
>> +
>> +	pci_read_config_byte(dev,0x83,&c);
>> +	c |= 0x80;
>> +	pci_write_config_byte(dev, 0x83, c);
>> +
>> +	pci_write_config_byte(dev, 0x09, 0x01);
>> +	pci_write_config_byte(dev, 0x0a, 0x06);
>> +
>> +	pci_read_config_byte(dev,0x83,&c);
>> +	c &= 0x7f;
>> +	pci_write_config_byte(dev, 0x83, c);
>>
>> -	return PCIBIOS_SUCCESSFUL;
>> +	pci_read_config_byte(dev,0x84,&c);
>> +	c |= 0x01;
>> +	pci_write_config_byte(dev, 0x84, c);
>>  }
>> +
>> +static void __devinit quirk_uli5229(struct pci_dev *dev) {
>> +	unsigned short temp;
>> +	pci_write_config_word(dev, 0x04, 0x0405);
>> +	pci_read_config_word(dev, 0x4a, &temp);
>> +	temp |= 0x1000;
>> +	pci_write_config_word(dev, 0x4a, temp); }
>> +
>> +static void __devinit early_uli5249(struct pci_dev *dev) {
>> +	unsigned char temp;
>> +	pci_write_config_word(dev, 0x04, 0x0007);
>> +	pci_read_config_byte(dev, 0x7c, &temp);
>> +	pci_write_config_byte(dev, 0x7c, 0x80);
>> +	pci_write_config_byte(dev, 0x09, 0x01);
>> +	pci_write_config_byte(dev, 0x7c, temp);
>> +	dev->class |= 0x1;
>> +}
>> +
>> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, quirk_ali1575);
>> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, quirk_uli5288);
>> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, quirk_uli5229);
>> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 0x5249, early_uli5249);
>>  #endif /* CONFIG_PCI */
>>
>>
>> diff --git a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
>> b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
>> index 944ec4b..9cca3d1 100644
>> --- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
>> +++ b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
>> @@ -34,8 +34,8 @@ extern unsigned long __secondary_hold_ac
>> static void __init  smp_86xx_release_core(int nr)  {
>> -	void *mcm_vaddr;
>> -	unsigned long vaddr, pcr;
>> +	__be32 __iomem *mcm_vaddr;
>> +	unsigned long pcr;
>>
>>  	if (nr < 0 || nr >= NR_CPUS)
>>  		return;
>> @@ -45,10 +45,9 @@ smp_86xx_release_core(int nr)
>>  	 */
>>  	mcm_vaddr = ioremap(get_immrbase() + MPC86xx_MCM_OFFSET,
>>  			    MPC86xx_MCM_SIZE);
>> -	vaddr = (unsigned long)mcm_vaddr +  MCM_PORT_CONFIG_OFFSET;
>> -	pcr = in_be32((volatile unsigned *)vaddr);
>> +	pcr = in_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2));
>>  	pcr |= 1 << (nr + 24);
>> -	out_be32((volatile unsigned *)vaddr, pcr);
>> +	out_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2), pcr);
>>  }
>>
>>
>> diff --git a/arch/powerpc/platforms/86xx/pci.c
>> b/arch/powerpc/platforms/86xx/pci.c
>> index 5180df7..0d8b340 100644
>> --- a/arch/powerpc/platforms/86xx/pci.c
>> +++ b/arch/powerpc/platforms/86xx/pci.c
>> @@ -122,15 +122,12 @@ static void __init
>> setup_pcie_atmu(struc  static void __init
>> mpc86xx_setup_pcie(struct pci_controller *hose, u32
>> pcie_offset, u32 pcie_size)  {
>> -	volatile struct ccsr_pex *pcie;
>>  	u16 cmd;
>>  	unsigned int temps;
>>
>>  	DBG("PCIE host controller register offset 0x%08x, size
>> 0x%08x.\n",
>>  			pcie_offset, pcie_size);
>>
>> -	pcie = ioremap(pcie_offset, pcie_size);
>> -
>>  	early_read_config_word(hose, 0, 0, PCI_COMMAND, &cmd);
>>  	cmd |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER |
>> PCI_COMMAND_MEMORY
>>  	    | PCI_COMMAND_IO;
>> @@ -144,6 +141,14 @@ mpc86xx_setup_pcie(struct pci_controller
>>  	early_write_config_dword(hose, 0, 0, PCI_PRIMARY_BUS, temps);  }
>>
>> +int mpc86xx_exclude_device(u_char bus, u_char devfn) {
>> +	if (bus == 0 && PCI_SLOT(devfn) == 0)
>> +		return PCIBIOS_DEVICE_NOT_FOUND;
>> +
>> +	return PCIBIOS_SUCCESSFUL;
>> +}
>> +
>>  int __init add_bridge(struct device_node *dev)  {
>>  	int len;
>> @@ -198,128 +203,3 @@ int __init add_bridge(struct device_node
>>
>>  	return 0;
>>  }
>> -
>> -static void __devinit quirk_ali1575(struct pci_dev *dev) -{
>> -	unsigned short temp;
>> -
>> -	/*
>> -	 * ALI1575 interrupts route table setup:
>> -	 *
>> -	 * IRQ pin   IRQ#
>> -	 * PIRQA ---- 3
>> -	 * PIRQB ---- 4
>> -	 * PIRQC ---- 5
>> -	 * PIRQD ---- 6
>> -	 * PIRQE ---- 9
>> -	 * PIRQF ---- 10
>> -	 * PIRQG ---- 11
>> -	 * PIRQH ---- 12
>> -	 *
>> -	 * interrupts for PCI slot0 -- PIRQA / PIRQB / PIRQC / PIRQD
>> -	 *                PCI slot1 -- PIRQB / PIRQC / PIRQD / PIRQA
>> -	 */
>> -	pci_write_config_dword(dev, 0x48, 0xb9317542);
>> -
>> -	/* USB 1.1 OHCI controller 1, interrupt: PIRQE */
>> -	pci_write_config_byte(dev, 0x86, 0x0c);
>> -
>> -	/* USB 1.1 OHCI controller 2, interrupt: PIRQF */
>> -	pci_write_config_byte(dev, 0x87, 0x0d);
>> -
>> -	/* USB 1.1 OHCI controller 3, interrupt: PIRQH */
>> -	pci_write_config_byte(dev, 0x88, 0x0f);
>> -
>> -	/* USB 2.0 controller, interrupt: PIRQ7 */
>> -	pci_write_config_byte(dev, 0x74, 0x06);
>> -
>> -	/* Audio controller, interrupt: PIRQE */
>> -	pci_write_config_byte(dev, 0x8a, 0x0c);
>> -
>> -	/* Modem controller, interrupt: PIRQF */
>> -	pci_write_config_byte(dev, 0x8b, 0x0d);
>> -
>> -	/* HD audio controller, interrupt: PIRQG */
>> -	pci_write_config_byte(dev, 0x8c, 0x0e);
>> -
>> -	/* Serial ATA interrupt: PIRQD */
>> -	pci_write_config_byte(dev, 0x8d, 0x0b);
>> -
>> -	/* SMB interrupt: PIRQH */
>> -	pci_write_config_byte(dev, 0x8e, 0x0f);
>> -
>> -	/* PMU ACPI SCI interrupt: PIRQH */
>> -	pci_write_config_byte(dev, 0x8f, 0x0f);
>> -
>> -	/* Primary PATA IDE IRQ: 14
>> -	 * Secondary PATA IDE IRQ: 15
>> -	 */
>> -	pci_write_config_byte(dev, 0x44, 0x3d);
>> -	pci_write_config_byte(dev, 0x75, 0x0f);
>> -
>> -	/* Set IRQ14 and IRQ15 to legacy IRQs */
>> -	pci_read_config_word(dev, 0x46, &temp);
>> -	temp |= 0xc000;
>> -	pci_write_config_word(dev, 0x46, temp);
>> -
>> -	/* Set i8259 interrupt trigger
>> -	 * IRQ 3:  Level
>> -	 * IRQ 4:  Level
>> -	 * IRQ 5:  Level
>> -	 * IRQ 6:  Level
>> -	 * IRQ 7:  Level
>> -	 * IRQ 9:  Level
>> -	 * IRQ 10: Level
>> -	 * IRQ 11: Level
>> -	 * IRQ 12: Level
>> -	 * IRQ 14: Edge
>> -	 * IRQ 15: Edge
>> -	 */
>> -	outb(0xfa, 0x4d0);
>> -	outb(0x1e, 0x4d1);
>> -}
>> -
>> -static void __devinit quirk_uli5288(struct pci_dev *dev) -{
>> -	unsigned char c;
>> -
>> -	pci_read_config_byte(dev,0x83,&c);
>> -	c |= 0x80;
>> -	pci_write_config_byte(dev, 0x83, c);
>> -
>> -	pci_write_config_byte(dev, 0x09, 0x01);
>> -	pci_write_config_byte(dev, 0x0a, 0x06);
>> -
>> -	pci_read_config_byte(dev,0x83,&c);
>> -	c &= 0x7f;
>> -	pci_write_config_byte(dev, 0x83, c);
>> -
>> -	pci_read_config_byte(dev,0x84,&c);
>> -	c |= 0x01;
>> -	pci_write_config_byte(dev, 0x84, c);
>> -}
>> -
>> -static void __devinit quirk_uli5229(struct pci_dev *dev) -{
>> -	unsigned short temp;
>> -	pci_write_config_word(dev, 0x04, 0x0405);
>> -	pci_read_config_word(dev, 0x4a, &temp);
>> -	temp |= 0x1000;
>> -	pci_write_config_word(dev, 0x4a, temp);
>> -}
>> -
>> -static void __devinit early_uli5249(struct pci_dev *dev) -{
>> -	unsigned char temp;
>> -	pci_write_config_word(dev, 0x04, 0x0007);
>> -	pci_read_config_byte(dev, 0x7c, &temp);
>> -	pci_write_config_byte(dev, 0x7c, 0x80);
>> -	pci_write_config_byte(dev, 0x09, 0x01);
>> -	pci_write_config_byte(dev, 0x7c, temp);
>> -	dev->class |= 0x1;
>> -}
>> -
>> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575,
>> quirk_ali1575); -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL,
>> 0x5288, quirk_uli5288);
>> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229,
>> quirk_uli5229); -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL,
>> 0x5249, early_uli5249); diff --git
>> a/include/asm-powerpc/mpc86xx.h
>> b/include/asm-powerpc/mpc86xx.h index d0a6718..00d72a7 100644
>> --- a/include/asm-powerpc/mpc86xx.h
>> +++ b/include/asm-powerpc/mpc86xx.h
>> @@ -20,10 +20,6 @@ #include <asm/mmu.h>
>>
>>  #ifdef CONFIG_PPC_86xx
>>
>> -#ifdef CONFIG_MPC8641_HPCN
>> -#include <platforms/86xx/mpc8641_hpcn.h> -#endif
>> -
>>  #define _IO_BASE        isa_io_base
>>  #define _ISA_MEM_BASE   isa_mem_base
>>  #ifdef CONFIG_PCI
>>
>> _______________________________________________
>> Linuxppc-dev mailing list
>> Linuxppc-dev@ozlabs.org
>> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-06-28  6:01 Please pull from 'for_paulus' branch of powerpc Kumar Gala
@ 2006-06-28 22:44 ` Jon Loeliger
  0 siblings, 0 replies; 20+ messages in thread
From: Jon Loeliger @ 2006-06-28 22:44 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel

So, like, the other day Kumar Gala mumbled:
> Please pull from 'for_paulus' branch of
> master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git
> 
> to receive the following updates:
> 
>  arch/powerpc/kernel/cputable.c             |   12 --
>  arch/powerpc/platforms/86xx/mpc86xx.h      |    8 +
>  arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |  128 +++++++++++++++++++++++++-
> -
>  arch/powerpc/platforms/86xx/mpc86xx_smp.c  |    9 -
>  arch/powerpc/platforms/86xx/pci.c          |  136 +-------------------------
> ---
>  include/asm-powerpc/mpc86xx.h              |    4 
>  6 files changed, 138 insertions(+), 159 deletions(-)
> 
> Kumar Gala:
>       powerpc: minor cleanups for mpc86xx
> 

Kumar,

Looks good to me.  I'll pull them to the 86xx tree.

Thanks!
jdl

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: Please pull from 'for_paulus' branch of powerpc
@ 2006-06-29  3:33 Zhang Wei-r63237
  2006-06-29  5:08 ` Kumar Gala
  0 siblings, 1 reply; 20+ messages in thread
From: Zhang Wei-r63237 @ 2006-06-29  3:33 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel

> 
> On Jun 28, 2006, at 1:26 AM, Zhang Wei-r63237 wrote:
> 
> > Hi, Kumar,
> >
> > Why moving these codes from pci.c to mpc86xx_hpcn.c? It's 
> not must be.
> > These functions relate to PCI device of MPC8641D HPCn platform.
> > And we can also see the 'DECLARE_PCI_FIXUP_HEADER()' declaration in 
> > pci.c of Powermac platform.
> 
> The point for moving is 86xx/pci.c should apply to all 86xx 
> systems, not just the HPCn system.
> 
> - kumar

The codes of moving is for PCI devices, it's for HPCn system now, but it's also fit for the same PCI chips in the other 86xx system and the same chip should keep the same setting in 86xx platforms, I think so.

Even though other 86xx platforms have no these PCI chips, these codes will not take effect.

And we can also see the similar solution in pSeries and PowerMac platforms pci.c file. The function 'fixup_winbond_82c105' in pseries/pci.c is for the Winbond 82c105 IDE controller on p610. (pSeries have only p610? :-D ) The function 'fixup_k2_sata' in powermac/pci.c is for K2-SATA. (K2-SATA chip is in all PowerMac machine? ;-) )

The moving will make the mpc86xx_hpcn.c more fat.

Thanks,
Zhang Wei

> 
> >> -----Original Message-----
> >> From: linuxppc-dev-bounces+wei.zhang=freescale.com@ozlabs.org
> >> [mailto:linuxppc-dev-bounces+wei.zhang=freescale.com@ozlabs.or
> >> g] On Behalf Of Kumar Gala
> >> Sent: Wednesday, June 28, 2006 2:01 PM
> >> To: Paul Mackerras
> >> Cc: linuxppc-dev@ozlabs.org; linux-kernel@vger.kernel.org
> >> Subject: Please pull from 'for_paulus' branch of powerpc
> >>
> >> Please pull from 'for_paulus' branch of 
> >> master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git
> >>
> >> to receive the following updates:
> >>
> >>  arch/powerpc/kernel/cputable.c             |   12 --
> >>  arch/powerpc/platforms/86xx/mpc86xx.h      |    8 +
> >>  arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |  128
> >> +++++++++++++++++++++++++--
> >>  arch/powerpc/platforms/86xx/mpc86xx_smp.c  |    9 -
> >>  arch/powerpc/platforms/86xx/pci.c          |  136
> >> +----------------------------
> >>  include/asm-powerpc/mpc86xx.h              |    4
> >>  6 files changed, 138 insertions(+), 159 deletions(-)
> >>
> >> Kumar Gala:
> >>       powerpc: minor cleanups for mpc86xx
> >>
> >> diff --git a/arch/powerpc/kernel/cputable.c 
> >> b/arch/powerpc/kernel/cputable.c index 1c11488..abf7d42 100644
> >> --- a/arch/powerpc/kernel/cputable.c
> >> +++ b/arch/powerpc/kernel/cputable.c
> >> @@ -722,18 +722,6 @@ #if CLASSIC_PPC
> >>  		.oprofile_type		= PPC_OPROFILE_G4,
> >>  		.platform		= "ppc7450",
> >>  	},
> >> -        {       /* 8641 */
> >> -               .pvr_mask               = 0xffffffff,
> >> -               .pvr_value              = 0x80040010,
> >> -               .cpu_name               = "8641",
> >> -               .cpu_features           = CPU_FTRS_7447A,
> >> -               .cpu_user_features      = COMMON_USER |
> >> PPC_FEATURE_HAS_ALTIVEC_COMP,
> >> -               .icache_bsize           = 32,
> >> -               .dcache_bsize           = 32,
> >> -               .num_pmcs               = 6,
> >> -               .cpu_setup              = __setup_cpu_745x
> >> -        },
> >> -
> >>  	{	/* 82xx (8240, 8245, 8260 are all 603e cores) */
> >>  		.pvr_mask		= 0x7fff0000,
> >>  		.pvr_value		= 0x00810000,
> >> diff --git a/arch/powerpc/platforms/86xx/mpc86xx.h
> >> b/arch/powerpc/platforms/86xx/mpc86xx.h
> >> index e3c9e4f..2834462 100644
> >> --- a/arch/powerpc/platforms/86xx/mpc86xx.h
> >> +++ b/arch/powerpc/platforms/86xx/mpc86xx.h
> >> @@ -15,11 +15,13 @@ #define __MPC86XX_H__
> >>   * mpc86xx_* files. Mostly for use by mpc86xx_setup().
> >>   */
> >>
> >> -extern int __init add_bridge(struct device_node *dev);
> >> +extern int add_bridge(struct device_node *dev);
> >>
> >> -extern void __init setup_indirect_pcie(struct 
> pci_controller *hose,
> >> +extern int mpc86xx_exclude_device(u_char bus, u_char devfn);
> >> +
> >> +extern void setup_indirect_pcie(struct pci_controller *hose,
> >>  				       u32 cfg_addr, u32
> >> cfg_data); -extern void __init
> >> setup_indirect_pcie_nomap(struct pci_controller *hose,
> >> +extern void setup_indirect_pcie_nomap(struct pci_controller *hose,
> >>  					     void __iomem *cfg_addr,
> >>  					     void __iomem *cfg_data);
> >>
> >> diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
> >> b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
> >> index 483c21d..ac7f418 100644
> >> --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
> >> +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
> >> @@ -36,6 +36,7 @@ #include <asm/mpic.h>  #include 
> <sysdev/fsl_soc.h>
> >>
> >>  #include "mpc86xx.h"
> >> +#include "mpc8641_hpcn.h"
> >>
> >>  #ifndef CONFIG_PCI
> >>  unsigned long isa_io_base = 0;
> >> @@ -186,17 +187,130 @@ mpc86xx_map_irq(struct pci_dev *dev, uns
> >>  	return PCI_IRQ_TABLE_LOOKUP + I8259_OFFSET;  }
> >>
> >> +static void __devinit quirk_ali1575(struct pci_dev *dev) {
> >> +	unsigned short temp;
> >> +
> >> +	/*
> >> +	 * ALI1575 interrupts route table setup:
> >> +	 *
> >> +	 * IRQ pin   IRQ#
> >> +	 * PIRQA ---- 3
> >> +	 * PIRQB ---- 4
> >> +	 * PIRQC ---- 5
> >> +	 * PIRQD ---- 6
> >> +	 * PIRQE ---- 9
> >> +	 * PIRQF ---- 10
> >> +	 * PIRQG ---- 11
> >> +	 * PIRQH ---- 12
> >> +	 *
> >> +	 * interrupts for PCI slot0 -- PIRQA / PIRQB / PIRQC / PIRQD
> >> +	 *                PCI slot1 -- PIRQB / PIRQC / PIRQD / PIRQA
> >> +	 */
> >> +	pci_write_config_dword(dev, 0x48, 0xb9317542);
> >> +
> >> +	/* USB 1.1 OHCI controller 1, interrupt: PIRQE */
> >> +	pci_write_config_byte(dev, 0x86, 0x0c);
> >> +
> >> +	/* USB 1.1 OHCI controller 2, interrupt: PIRQF */
> >> +	pci_write_config_byte(dev, 0x87, 0x0d);
> >> +
> >> +	/* USB 1.1 OHCI controller 3, interrupt: PIRQH */
> >> +	pci_write_config_byte(dev, 0x88, 0x0f);
> >> +
> >> +	/* USB 2.0 controller, interrupt: PIRQ7 */
> >> +	pci_write_config_byte(dev, 0x74, 0x06);
> >> +
> >> +	/* Audio controller, interrupt: PIRQE */
> >> +	pci_write_config_byte(dev, 0x8a, 0x0c);
> >> +
> >> +	/* Modem controller, interrupt: PIRQF */
> >> +	pci_write_config_byte(dev, 0x8b, 0x0d);
> >> +
> >> +	/* HD audio controller, interrupt: PIRQG */
> >> +	pci_write_config_byte(dev, 0x8c, 0x0e);
> >> +
> >> +	/* Serial ATA interrupt: PIRQD */
> >> +	pci_write_config_byte(dev, 0x8d, 0x0b);
> >> +
> >> +	/* SMB interrupt: PIRQH */
> >> +	pci_write_config_byte(dev, 0x8e, 0x0f);
> >> +
> >> +	/* PMU ACPI SCI interrupt: PIRQH */
> >> +	pci_write_config_byte(dev, 0x8f, 0x0f);
> >> +
> >> +	/* Primary PATA IDE IRQ: 14
> >> +	 * Secondary PATA IDE IRQ: 15
> >> +	 */
> >> +	pci_write_config_byte(dev, 0x44, 0x3d);
> >> +	pci_write_config_byte(dev, 0x75, 0x0f);
> >> +
> >> +	/* Set IRQ14 and IRQ15 to legacy IRQs */
> >> +	pci_read_config_word(dev, 0x46, &temp);
> >> +	temp |= 0xc000;
> >> +	pci_write_config_word(dev, 0x46, temp);
> >> +
> >> +	/* Set i8259 interrupt trigger
> >> +	 * IRQ 3:  Level
> >> +	 * IRQ 4:  Level
> >> +	 * IRQ 5:  Level
> >> +	 * IRQ 6:  Level
> >> +	 * IRQ 7:  Level
> >> +	 * IRQ 9:  Level
> >> +	 * IRQ 10: Level
> >> +	 * IRQ 11: Level
> >> +	 * IRQ 12: Level
> >> +	 * IRQ 14: Edge
> >> +	 * IRQ 15: Edge
> >> +	 */
> >> +	outb(0xfa, 0x4d0);
> >> +	outb(0x1e, 0x4d1);
> >> +}
> >>
> >> -int
> >> -mpc86xx_exclude_device(u_char bus, u_char devfn)
> >> +static void __devinit quirk_uli5288(struct pci_dev *dev)
> >>  {
> >> -#if !defined(CONFIG_PCI)
> >> -	if (bus == 0 && PCI_SLOT(devfn) == 0)
> >> -		return PCIBIOS_DEVICE_NOT_FOUND;
> >> -#endif
> >> +	unsigned char c;
> >> +
> >> +	pci_read_config_byte(dev,0x83,&c);
> >> +	c |= 0x80;
> >> +	pci_write_config_byte(dev, 0x83, c);
> >> +
> >> +	pci_write_config_byte(dev, 0x09, 0x01);
> >> +	pci_write_config_byte(dev, 0x0a, 0x06);
> >> +
> >> +	pci_read_config_byte(dev,0x83,&c);
> >> +	c &= 0x7f;
> >> +	pci_write_config_byte(dev, 0x83, c);
> >>
> >> -	return PCIBIOS_SUCCESSFUL;
> >> +	pci_read_config_byte(dev,0x84,&c);
> >> +	c |= 0x01;
> >> +	pci_write_config_byte(dev, 0x84, c);
> >>  }
> >> +
> >> +static void __devinit quirk_uli5229(struct pci_dev *dev) {
> >> +	unsigned short temp;
> >> +	pci_write_config_word(dev, 0x04, 0x0405);
> >> +	pci_read_config_word(dev, 0x4a, &temp);
> >> +	temp |= 0x1000;
> >> +	pci_write_config_word(dev, 0x4a, temp); }
> >> +
> >> +static void __devinit early_uli5249(struct pci_dev *dev) {
> >> +	unsigned char temp;
> >> +	pci_write_config_word(dev, 0x04, 0x0007);
> >> +	pci_read_config_byte(dev, 0x7c, &temp);
> >> +	pci_write_config_byte(dev, 0x7c, 0x80);
> >> +	pci_write_config_byte(dev, 0x09, 0x01);
> >> +	pci_write_config_byte(dev, 0x7c, temp);
> >> +	dev->class |= 0x1;
> >> +}
> >> +
> >> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, 
> quirk_ali1575); 
> >> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288, 
> quirk_uli5288); 
> >> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, 
> quirk_uli5229); 
> >> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 0x5249, early_uli5249);
> >>  #endif /* CONFIG_PCI */
> >>
> >>
> >> diff --git a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
> >> b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
> >> index 944ec4b..9cca3d1 100644
> >> --- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
> >> +++ b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
> >> @@ -34,8 +34,8 @@ extern unsigned long __secondary_hold_ac static 
> >> void __init  smp_86xx_release_core(int nr)  {
> >> -	void *mcm_vaddr;
> >> -	unsigned long vaddr, pcr;
> >> +	__be32 __iomem *mcm_vaddr;
> >> +	unsigned long pcr;
> >>
> >>  	if (nr < 0 || nr >= NR_CPUS)
> >>  		return;
> >> @@ -45,10 +45,9 @@ smp_86xx_release_core(int nr)
> >>  	 */
> >>  	mcm_vaddr = ioremap(get_immrbase() + MPC86xx_MCM_OFFSET,
> >>  			    MPC86xx_MCM_SIZE);
> >> -	vaddr = (unsigned long)mcm_vaddr +  MCM_PORT_CONFIG_OFFSET;
> >> -	pcr = in_be32((volatile unsigned *)vaddr);
> >> +	pcr = in_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2));
> >>  	pcr |= 1 << (nr + 24);
> >> -	out_be32((volatile unsigned *)vaddr, pcr);
> >> +	out_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2), pcr);
> >>  }
> >>
> >>
> >> diff --git a/arch/powerpc/platforms/86xx/pci.c
> >> b/arch/powerpc/platforms/86xx/pci.c
> >> index 5180df7..0d8b340 100644
> >> --- a/arch/powerpc/platforms/86xx/pci.c
> >> +++ b/arch/powerpc/platforms/86xx/pci.c
> >> @@ -122,15 +122,12 @@ static void __init setup_pcie_atmu(struc  
> >> static void __init mpc86xx_setup_pcie(struct pci_controller *hose, 
> >> u32 pcie_offset, u32 pcie_size)  {
> >> -	volatile struct ccsr_pex *pcie;
> >>  	u16 cmd;
> >>  	unsigned int temps;
> >>
> >>  	DBG("PCIE host controller register offset 0x%08x, size 
> 0x%08x.\n",
> >>  			pcie_offset, pcie_size);
> >>
> >> -	pcie = ioremap(pcie_offset, pcie_size);
> >> -
> >>  	early_read_config_word(hose, 0, 0, PCI_COMMAND, &cmd);
> >>  	cmd |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER | 
> PCI_COMMAND_MEMORY
> >>  	    | PCI_COMMAND_IO;
> >> @@ -144,6 +141,14 @@ mpc86xx_setup_pcie(struct pci_controller
> >>  	early_write_config_dword(hose, 0, 0, PCI_PRIMARY_BUS, temps);  }
> >>
> >> +int mpc86xx_exclude_device(u_char bus, u_char devfn) {
> >> +	if (bus == 0 && PCI_SLOT(devfn) == 0)
> >> +		return PCIBIOS_DEVICE_NOT_FOUND;
> >> +
> >> +	return PCIBIOS_SUCCESSFUL;
> >> +}
> >> +
> >>  int __init add_bridge(struct device_node *dev)  {
> >>  	int len;
> >> @@ -198,128 +203,3 @@ int __init add_bridge(struct device_node
> >>
> >>  	return 0;
> >>  }
> >> -
> >> -static void __devinit quirk_ali1575(struct pci_dev *dev) -{
> >> -	unsigned short temp;
> >> -
> >> -	/*
> >> -	 * ALI1575 interrupts route table setup:
> >> -	 *
> >> -	 * IRQ pin   IRQ#
> >> -	 * PIRQA ---- 3
> >> -	 * PIRQB ---- 4
> >> -	 * PIRQC ---- 5
> >> -	 * PIRQD ---- 6
> >> -	 * PIRQE ---- 9
> >> -	 * PIRQF ---- 10
> >> -	 * PIRQG ---- 11
> >> -	 * PIRQH ---- 12
> >> -	 *
> >> -	 * interrupts for PCI slot0 -- PIRQA / PIRQB / PIRQC / PIRQD
> >> -	 *                PCI slot1 -- PIRQB / PIRQC / PIRQD / PIRQA
> >> -	 */
> >> -	pci_write_config_dword(dev, 0x48, 0xb9317542);
> >> -
> >> -	/* USB 1.1 OHCI controller 1, interrupt: PIRQE */
> >> -	pci_write_config_byte(dev, 0x86, 0x0c);
> >> -
> >> -	/* USB 1.1 OHCI controller 2, interrupt: PIRQF */
> >> -	pci_write_config_byte(dev, 0x87, 0x0d);
> >> -
> >> -	/* USB 1.1 OHCI controller 3, interrupt: PIRQH */
> >> -	pci_write_config_byte(dev, 0x88, 0x0f);
> >> -
> >> -	/* USB 2.0 controller, interrupt: PIRQ7 */
> >> -	pci_write_config_byte(dev, 0x74, 0x06);
> >> -
> >> -	/* Audio controller, interrupt: PIRQE */
> >> -	pci_write_config_byte(dev, 0x8a, 0x0c);
> >> -
> >> -	/* Modem controller, interrupt: PIRQF */
> >> -	pci_write_config_byte(dev, 0x8b, 0x0d);
> >> -
> >> -	/* HD audio controller, interrupt: PIRQG */
> >> -	pci_write_config_byte(dev, 0x8c, 0x0e);
> >> -
> >> -	/* Serial ATA interrupt: PIRQD */
> >> -	pci_write_config_byte(dev, 0x8d, 0x0b);
> >> -
> >> -	/* SMB interrupt: PIRQH */
> >> -	pci_write_config_byte(dev, 0x8e, 0x0f);
> >> -
> >> -	/* PMU ACPI SCI interrupt: PIRQH */
> >> -	pci_write_config_byte(dev, 0x8f, 0x0f);
> >> -
> >> -	/* Primary PATA IDE IRQ: 14
> >> -	 * Secondary PATA IDE IRQ: 15
> >> -	 */
> >> -	pci_write_config_byte(dev, 0x44, 0x3d);
> >> -	pci_write_config_byte(dev, 0x75, 0x0f);
> >> -
> >> -	/* Set IRQ14 and IRQ15 to legacy IRQs */
> >> -	pci_read_config_word(dev, 0x46, &temp);
> >> -	temp |= 0xc000;
> >> -	pci_write_config_word(dev, 0x46, temp);
> >> -
> >> -	/* Set i8259 interrupt trigger
> >> -	 * IRQ 3:  Level
> >> -	 * IRQ 4:  Level
> >> -	 * IRQ 5:  Level
> >> -	 * IRQ 6:  Level
> >> -	 * IRQ 7:  Level
> >> -	 * IRQ 9:  Level
> >> -	 * IRQ 10: Level
> >> -	 * IRQ 11: Level
> >> -	 * IRQ 12: Level
> >> -	 * IRQ 14: Edge
> >> -	 * IRQ 15: Edge
> >> -	 */
> >> -	outb(0xfa, 0x4d0);
> >> -	outb(0x1e, 0x4d1);
> >> -}
> >> -
> >> -static void __devinit quirk_uli5288(struct pci_dev *dev) -{
> >> -	unsigned char c;
> >> -
> >> -	pci_read_config_byte(dev,0x83,&c);
> >> -	c |= 0x80;
> >> -	pci_write_config_byte(dev, 0x83, c);
> >> -
> >> -	pci_write_config_byte(dev, 0x09, 0x01);
> >> -	pci_write_config_byte(dev, 0x0a, 0x06);
> >> -
> >> -	pci_read_config_byte(dev,0x83,&c);
> >> -	c &= 0x7f;
> >> -	pci_write_config_byte(dev, 0x83, c);
> >> -
> >> -	pci_read_config_byte(dev,0x84,&c);
> >> -	c |= 0x01;
> >> -	pci_write_config_byte(dev, 0x84, c);
> >> -}
> >> -
> >> -static void __devinit quirk_uli5229(struct pci_dev *dev) -{
> >> -	unsigned short temp;
> >> -	pci_write_config_word(dev, 0x04, 0x0405);
> >> -	pci_read_config_word(dev, 0x4a, &temp);
> >> -	temp |= 0x1000;
> >> -	pci_write_config_word(dev, 0x4a, temp);
> >> -}
> >> -
> >> -static void __devinit early_uli5249(struct pci_dev *dev) -{
> >> -	unsigned char temp;
> >> -	pci_write_config_word(dev, 0x04, 0x0007);
> >> -	pci_read_config_byte(dev, 0x7c, &temp);
> >> -	pci_write_config_byte(dev, 0x7c, 0x80);
> >> -	pci_write_config_byte(dev, 0x09, 0x01);
> >> -	pci_write_config_byte(dev, 0x7c, temp);
> >> -	dev->class |= 0x1;
> >> -}
> >> -
> >> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575, 
> quirk_ali1575); 
> >> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL,
> >> 0x5288, quirk_uli5288);
> >> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229, 
> quirk_uli5229); 
> >> -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL,
> >> 0x5249, early_uli5249); diff --git
> >> a/include/asm-powerpc/mpc86xx.h
> >> b/include/asm-powerpc/mpc86xx.h index d0a6718..00d72a7 100644
> >> --- a/include/asm-powerpc/mpc86xx.h
> >> +++ b/include/asm-powerpc/mpc86xx.h
> >> @@ -20,10 +20,6 @@ #include <asm/mmu.h>
> >>
> >>  #ifdef CONFIG_PPC_86xx
> >>
> >> -#ifdef CONFIG_MPC8641_HPCN
> >> -#include <platforms/86xx/mpc8641_hpcn.h> -#endif
> >> -
> >>  #define _IO_BASE        isa_io_base
> >>  #define _ISA_MEM_BASE   isa_mem_base
> >>  #ifdef CONFIG_PCI
> >>
> >> _______________________________________________
> >> Linuxppc-dev mailing list
> >> Linuxppc-dev@ozlabs.org
> >> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> >>
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-06-29  3:33 Zhang Wei-r63237
@ 2006-06-29  5:08 ` Kumar Gala
  2006-06-29  9:10   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 20+ messages in thread
From: Kumar Gala @ 2006-06-29  5:08 UTC (permalink / raw)
  To: Zhang Wei-r63237; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel


On Jun 28, 2006, at 10:33 PM, Zhang Wei-r63237 wrote:

>>
>> On Jun 28, 2006, at 1:26 AM, Zhang Wei-r63237 wrote:
>>
>>> Hi, Kumar,
>>>
>>> Why moving these codes from pci.c to mpc86xx_hpcn.c? It's
>> not must be.
>>> These functions relate to PCI device of MPC8641D HPCn platform.
>>> And we can also see the 'DECLARE_PCI_FIXUP_HEADER()' declaration in
>>> pci.c of Powermac platform.
>>
>> The point for moving is 86xx/pci.c should apply to all 86xx
>> systems, not just the HPCn system.
>>
>> - kumar
>
> The codes of moving is for PCI devices, it's for HPCn system now,  
> but it's also fit for the same PCI chips in the other 86xx system  
> and the same chip should keep the same setting in 86xx platforms, I  
> think so.
>
> Even though other 86xx platforms have no these PCI chips, these  
> codes will not take effect.

Its code bloat for systems that dont need it.

> And we can also see the similar solution in pSeries and PowerMac  
> platforms pci.c file. The function 'fixup_winbond_82c105' in  
> pseries/pci.c is for the Winbond 82c105 IDE controller on p610.  
> (pSeries have only p610? :-D ) The function 'fixup_k2_sata' in  
> powermac/pci.c is for K2-SATA. (K2-SATA chip is in all PowerMac  
> machine? ;-) )

Realize, powermac and pseries describe actual full systems, not  
processor families like 86xx.

> The moving will make the mpc86xx_hpcn.c more fat.

That's all relative.

- kumar

>
> Thanks,
> Zhang Wei
>
>>
>>>> -----Original Message-----
>>>> From: linuxppc-dev-bounces+wei.zhang=freescale.com@ozlabs.org
>>>> [mailto:linuxppc-dev-bounces+wei.zhang=freescale.com@ozlabs.or
>>>> g] On Behalf Of Kumar Gala
>>>> Sent: Wednesday, June 28, 2006 2:01 PM
>>>> To: Paul Mackerras
>>>> Cc: linuxppc-dev@ozlabs.org; linux-kernel@vger.kernel.org
>>>> Subject: Please pull from 'for_paulus' branch of powerpc
>>>>
>>>> Please pull from 'for_paulus' branch of
>>>> master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git
>>>>
>>>> to receive the following updates:
>>>>
>>>>  arch/powerpc/kernel/cputable.c             |   12 --
>>>>  arch/powerpc/platforms/86xx/mpc86xx.h      |    8 +
>>>>  arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |  128
>>>> +++++++++++++++++++++++++--
>>>>  arch/powerpc/platforms/86xx/mpc86xx_smp.c  |    9 -
>>>>  arch/powerpc/platforms/86xx/pci.c          |  136
>>>> +----------------------------
>>>>  include/asm-powerpc/mpc86xx.h              |    4
>>>>  6 files changed, 138 insertions(+), 159 deletions(-)
>>>>
>>>> Kumar Gala:
>>>>       powerpc: minor cleanups for mpc86xx
>>>>
>>>> diff --git a/arch/powerpc/kernel/cputable.c
>>>> b/arch/powerpc/kernel/cputable.c index 1c11488..abf7d42 100644
>>>> --- a/arch/powerpc/kernel/cputable.c
>>>> +++ b/arch/powerpc/kernel/cputable.c
>>>> @@ -722,18 +722,6 @@ #if CLASSIC_PPC
>>>>  		.oprofile_type		= PPC_OPROFILE_G4,
>>>>  		.platform		= "ppc7450",
>>>>  	},
>>>> -        {       /* 8641 */
>>>> -               .pvr_mask               = 0xffffffff,
>>>> -               .pvr_value              = 0x80040010,
>>>> -               .cpu_name               = "8641",
>>>> -               .cpu_features           = CPU_FTRS_7447A,
>>>> -               .cpu_user_features      = COMMON_USER |
>>>> PPC_FEATURE_HAS_ALTIVEC_COMP,
>>>> -               .icache_bsize           = 32,
>>>> -               .dcache_bsize           = 32,
>>>> -               .num_pmcs               = 6,
>>>> -               .cpu_setup              = __setup_cpu_745x
>>>> -        },
>>>> -
>>>>  	{	/* 82xx (8240, 8245, 8260 are all 603e cores) */
>>>>  		.pvr_mask		= 0x7fff0000,
>>>>  		.pvr_value		= 0x00810000,
>>>> diff --git a/arch/powerpc/platforms/86xx/mpc86xx.h
>>>> b/arch/powerpc/platforms/86xx/mpc86xx.h
>>>> index e3c9e4f..2834462 100644
>>>> --- a/arch/powerpc/platforms/86xx/mpc86xx.h
>>>> +++ b/arch/powerpc/platforms/86xx/mpc86xx.h
>>>> @@ -15,11 +15,13 @@ #define __MPC86XX_H__
>>>>   * mpc86xx_* files. Mostly for use by mpc86xx_setup().
>>>>   */
>>>>
>>>> -extern int __init add_bridge(struct device_node *dev);
>>>> +extern int add_bridge(struct device_node *dev);
>>>>
>>>> -extern void __init setup_indirect_pcie(struct
>> pci_controller *hose,
>>>> +extern int mpc86xx_exclude_device(u_char bus, u_char devfn);
>>>> +
>>>> +extern void setup_indirect_pcie(struct pci_controller *hose,
>>>>  				       u32 cfg_addr, u32
>>>> cfg_data); -extern void __init
>>>> setup_indirect_pcie_nomap(struct pci_controller *hose,
>>>> +extern void setup_indirect_pcie_nomap(struct pci_controller *hose,
>>>>  					     void __iomem *cfg_addr,
>>>>  					     void __iomem *cfg_data);
>>>>
>>>> diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
>>>> b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
>>>> index 483c21d..ac7f418 100644
>>>> --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
>>>> +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
>>>> @@ -36,6 +36,7 @@ #include <asm/mpic.h>  #include
>> <sysdev/fsl_soc.h>
>>>>
>>>>  #include "mpc86xx.h"
>>>> +#include "mpc8641_hpcn.h"
>>>>
>>>>  #ifndef CONFIG_PCI
>>>>  unsigned long isa_io_base = 0;
>>>> @@ -186,17 +187,130 @@ mpc86xx_map_irq(struct pci_dev *dev, uns
>>>>  	return PCI_IRQ_TABLE_LOOKUP + I8259_OFFSET;  }
>>>>
>>>> +static void __devinit quirk_ali1575(struct pci_dev *dev) {
>>>> +	unsigned short temp;
>>>> +
>>>> +	/*
>>>> +	 * ALI1575 interrupts route table setup:
>>>> +	 *
>>>> +	 * IRQ pin   IRQ#
>>>> +	 * PIRQA ---- 3
>>>> +	 * PIRQB ---- 4
>>>> +	 * PIRQC ---- 5
>>>> +	 * PIRQD ---- 6
>>>> +	 * PIRQE ---- 9
>>>> +	 * PIRQF ---- 10
>>>> +	 * PIRQG ---- 11
>>>> +	 * PIRQH ---- 12
>>>> +	 *
>>>> +	 * interrupts for PCI slot0 -- PIRQA / PIRQB / PIRQC / PIRQD
>>>> +	 *                PCI slot1 -- PIRQB / PIRQC / PIRQD / PIRQA
>>>> +	 */
>>>> +	pci_write_config_dword(dev, 0x48, 0xb9317542);
>>>> +
>>>> +	/* USB 1.1 OHCI controller 1, interrupt: PIRQE */
>>>> +	pci_write_config_byte(dev, 0x86, 0x0c);
>>>> +
>>>> +	/* USB 1.1 OHCI controller 2, interrupt: PIRQF */
>>>> +	pci_write_config_byte(dev, 0x87, 0x0d);
>>>> +
>>>> +	/* USB 1.1 OHCI controller 3, interrupt: PIRQH */
>>>> +	pci_write_config_byte(dev, 0x88, 0x0f);
>>>> +
>>>> +	/* USB 2.0 controller, interrupt: PIRQ7 */
>>>> +	pci_write_config_byte(dev, 0x74, 0x06);
>>>> +
>>>> +	/* Audio controller, interrupt: PIRQE */
>>>> +	pci_write_config_byte(dev, 0x8a, 0x0c);
>>>> +
>>>> +	/* Modem controller, interrupt: PIRQF */
>>>> +	pci_write_config_byte(dev, 0x8b, 0x0d);
>>>> +
>>>> +	/* HD audio controller, interrupt: PIRQG */
>>>> +	pci_write_config_byte(dev, 0x8c, 0x0e);
>>>> +
>>>> +	/* Serial ATA interrupt: PIRQD */
>>>> +	pci_write_config_byte(dev, 0x8d, 0x0b);
>>>> +
>>>> +	/* SMB interrupt: PIRQH */
>>>> +	pci_write_config_byte(dev, 0x8e, 0x0f);
>>>> +
>>>> +	/* PMU ACPI SCI interrupt: PIRQH */
>>>> +	pci_write_config_byte(dev, 0x8f, 0x0f);
>>>> +
>>>> +	/* Primary PATA IDE IRQ: 14
>>>> +	 * Secondary PATA IDE IRQ: 15
>>>> +	 */
>>>> +	pci_write_config_byte(dev, 0x44, 0x3d);
>>>> +	pci_write_config_byte(dev, 0x75, 0x0f);
>>>> +
>>>> +	/* Set IRQ14 and IRQ15 to legacy IRQs */
>>>> +	pci_read_config_word(dev, 0x46, &temp);
>>>> +	temp |= 0xc000;
>>>> +	pci_write_config_word(dev, 0x46, temp);
>>>> +
>>>> +	/* Set i8259 interrupt trigger
>>>> +	 * IRQ 3:  Level
>>>> +	 * IRQ 4:  Level
>>>> +	 * IRQ 5:  Level
>>>> +	 * IRQ 6:  Level
>>>> +	 * IRQ 7:  Level
>>>> +	 * IRQ 9:  Level
>>>> +	 * IRQ 10: Level
>>>> +	 * IRQ 11: Level
>>>> +	 * IRQ 12: Level
>>>> +	 * IRQ 14: Edge
>>>> +	 * IRQ 15: Edge
>>>> +	 */
>>>> +	outb(0xfa, 0x4d0);
>>>> +	outb(0x1e, 0x4d1);
>>>> +}
>>>>
>>>> -int
>>>> -mpc86xx_exclude_device(u_char bus, u_char devfn)
>>>> +static void __devinit quirk_uli5288(struct pci_dev *dev)
>>>>  {
>>>> -#if !defined(CONFIG_PCI)
>>>> -	if (bus == 0 && PCI_SLOT(devfn) == 0)
>>>> -		return PCIBIOS_DEVICE_NOT_FOUND;
>>>> -#endif
>>>> +	unsigned char c;
>>>> +
>>>> +	pci_read_config_byte(dev,0x83,&c);
>>>> +	c |= 0x80;
>>>> +	pci_write_config_byte(dev, 0x83, c);
>>>> +
>>>> +	pci_write_config_byte(dev, 0x09, 0x01);
>>>> +	pci_write_config_byte(dev, 0x0a, 0x06);
>>>> +
>>>> +	pci_read_config_byte(dev,0x83,&c);
>>>> +	c &= 0x7f;
>>>> +	pci_write_config_byte(dev, 0x83, c);
>>>>
>>>> -	return PCIBIOS_SUCCESSFUL;
>>>> +	pci_read_config_byte(dev,0x84,&c);
>>>> +	c |= 0x01;
>>>> +	pci_write_config_byte(dev, 0x84, c);
>>>>  }
>>>> +
>>>> +static void __devinit quirk_uli5229(struct pci_dev *dev) {
>>>> +	unsigned short temp;
>>>> +	pci_write_config_word(dev, 0x04, 0x0405);
>>>> +	pci_read_config_word(dev, 0x4a, &temp);
>>>> +	temp |= 0x1000;
>>>> +	pci_write_config_word(dev, 0x4a, temp); }
>>>> +
>>>> +static void __devinit early_uli5249(struct pci_dev *dev) {
>>>> +	unsigned char temp;
>>>> +	pci_write_config_word(dev, 0x04, 0x0007);
>>>> +	pci_read_config_byte(dev, 0x7c, &temp);
>>>> +	pci_write_config_byte(dev, 0x7c, 0x80);
>>>> +	pci_write_config_byte(dev, 0x09, 0x01);
>>>> +	pci_write_config_byte(dev, 0x7c, temp);
>>>> +	dev->class |= 0x1;
>>>> +}
>>>> +
>>>> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575,
>> quirk_ali1575);
>>>> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288,
>> quirk_uli5288);
>>>> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229,
>> quirk_uli5229);
>>>> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 0x5249, early_uli5249);
>>>>  #endif /* CONFIG_PCI */
>>>>
>>>>
>>>> diff --git a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
>>>> b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
>>>> index 944ec4b..9cca3d1 100644
>>>> --- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
>>>> +++ b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
>>>> @@ -34,8 +34,8 @@ extern unsigned long __secondary_hold_ac static
>>>> void __init  smp_86xx_release_core(int nr)  {
>>>> -	void *mcm_vaddr;
>>>> -	unsigned long vaddr, pcr;
>>>> +	__be32 __iomem *mcm_vaddr;
>>>> +	unsigned long pcr;
>>>>
>>>>  	if (nr < 0 || nr >= NR_CPUS)
>>>>  		return;
>>>> @@ -45,10 +45,9 @@ smp_86xx_release_core(int nr)
>>>>  	 */
>>>>  	mcm_vaddr = ioremap(get_immrbase() + MPC86xx_MCM_OFFSET,
>>>>  			    MPC86xx_MCM_SIZE);
>>>> -	vaddr = (unsigned long)mcm_vaddr +  MCM_PORT_CONFIG_OFFSET;
>>>> -	pcr = in_be32((volatile unsigned *)vaddr);
>>>> +	pcr = in_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2));
>>>>  	pcr |= 1 << (nr + 24);
>>>> -	out_be32((volatile unsigned *)vaddr, pcr);
>>>> +	out_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 2), pcr);
>>>>  }
>>>>
>>>>
>>>> diff --git a/arch/powerpc/platforms/86xx/pci.c
>>>> b/arch/powerpc/platforms/86xx/pci.c
>>>> index 5180df7..0d8b340 100644
>>>> --- a/arch/powerpc/platforms/86xx/pci.c
>>>> +++ b/arch/powerpc/platforms/86xx/pci.c
>>>> @@ -122,15 +122,12 @@ static void __init setup_pcie_atmu(struc
>>>> static void __init mpc86xx_setup_pcie(struct pci_controller *hose,
>>>> u32 pcie_offset, u32 pcie_size)  {
>>>> -	volatile struct ccsr_pex *pcie;
>>>>  	u16 cmd;
>>>>  	unsigned int temps;
>>>>
>>>>  	DBG("PCIE host controller register offset 0x%08x, size
>> 0x%08x.\n",
>>>>  			pcie_offset, pcie_size);
>>>>
>>>> -	pcie = ioremap(pcie_offset, pcie_size);
>>>> -
>>>>  	early_read_config_word(hose, 0, 0, PCI_COMMAND, &cmd);
>>>>  	cmd |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER |
>> PCI_COMMAND_MEMORY
>>>>  	    | PCI_COMMAND_IO;
>>>> @@ -144,6 +141,14 @@ mpc86xx_setup_pcie(struct pci_controller
>>>>  	early_write_config_dword(hose, 0, 0, PCI_PRIMARY_BUS, temps);  }
>>>>
>>>> +int mpc86xx_exclude_device(u_char bus, u_char devfn) {
>>>> +	if (bus == 0 && PCI_SLOT(devfn) == 0)
>>>> +		return PCIBIOS_DEVICE_NOT_FOUND;
>>>> +
>>>> +	return PCIBIOS_SUCCESSFUL;
>>>> +}
>>>> +
>>>>  int __init add_bridge(struct device_node *dev)  {
>>>>  	int len;
>>>> @@ -198,128 +203,3 @@ int __init add_bridge(struct device_node
>>>>
>>>>  	return 0;
>>>>  }
>>>> -
>>>> -static void __devinit quirk_ali1575(struct pci_dev *dev) -{
>>>> -	unsigned short temp;
>>>> -
>>>> -	/*
>>>> -	 * ALI1575 interrupts route table setup:
>>>> -	 *
>>>> -	 * IRQ pin   IRQ#
>>>> -	 * PIRQA ---- 3
>>>> -	 * PIRQB ---- 4
>>>> -	 * PIRQC ---- 5
>>>> -	 * PIRQD ---- 6
>>>> -	 * PIRQE ---- 9
>>>> -	 * PIRQF ---- 10
>>>> -	 * PIRQG ---- 11
>>>> -	 * PIRQH ---- 12
>>>> -	 *
>>>> -	 * interrupts for PCI slot0 -- PIRQA / PIRQB / PIRQC / PIRQD
>>>> -	 *                PCI slot1 -- PIRQB / PIRQC / PIRQD / PIRQA
>>>> -	 */
>>>> -	pci_write_config_dword(dev, 0x48, 0xb9317542);
>>>> -
>>>> -	/* USB 1.1 OHCI controller 1, interrupt: PIRQE */
>>>> -	pci_write_config_byte(dev, 0x86, 0x0c);
>>>> -
>>>> -	/* USB 1.1 OHCI controller 2, interrupt: PIRQF */
>>>> -	pci_write_config_byte(dev, 0x87, 0x0d);
>>>> -
>>>> -	/* USB 1.1 OHCI controller 3, interrupt: PIRQH */
>>>> -	pci_write_config_byte(dev, 0x88, 0x0f);
>>>> -
>>>> -	/* USB 2.0 controller, interrupt: PIRQ7 */
>>>> -	pci_write_config_byte(dev, 0x74, 0x06);
>>>> -
>>>> -	/* Audio controller, interrupt: PIRQE */
>>>> -	pci_write_config_byte(dev, 0x8a, 0x0c);
>>>> -
>>>> -	/* Modem controller, interrupt: PIRQF */
>>>> -	pci_write_config_byte(dev, 0x8b, 0x0d);
>>>> -
>>>> -	/* HD audio controller, interrupt: PIRQG */
>>>> -	pci_write_config_byte(dev, 0x8c, 0x0e);
>>>> -
>>>> -	/* Serial ATA interrupt: PIRQD */
>>>> -	pci_write_config_byte(dev, 0x8d, 0x0b);
>>>> -
>>>> -	/* SMB interrupt: PIRQH */
>>>> -	pci_write_config_byte(dev, 0x8e, 0x0f);
>>>> -
>>>> -	/* PMU ACPI SCI interrupt: PIRQH */
>>>> -	pci_write_config_byte(dev, 0x8f, 0x0f);
>>>> -
>>>> -	/* Primary PATA IDE IRQ: 14
>>>> -	 * Secondary PATA IDE IRQ: 15
>>>> -	 */
>>>> -	pci_write_config_byte(dev, 0x44, 0x3d);
>>>> -	pci_write_config_byte(dev, 0x75, 0x0f);
>>>> -
>>>> -	/* Set IRQ14 and IRQ15 to legacy IRQs */
>>>> -	pci_read_config_word(dev, 0x46, &temp);
>>>> -	temp |= 0xc000;
>>>> -	pci_write_config_word(dev, 0x46, temp);
>>>> -
>>>> -	/* Set i8259 interrupt trigger
>>>> -	 * IRQ 3:  Level
>>>> -	 * IRQ 4:  Level
>>>> -	 * IRQ 5:  Level
>>>> -	 * IRQ 6:  Level
>>>> -	 * IRQ 7:  Level
>>>> -	 * IRQ 9:  Level
>>>> -	 * IRQ 10: Level
>>>> -	 * IRQ 11: Level
>>>> -	 * IRQ 12: Level
>>>> -	 * IRQ 14: Edge
>>>> -	 * IRQ 15: Edge
>>>> -	 */
>>>> -	outb(0xfa, 0x4d0);
>>>> -	outb(0x1e, 0x4d1);
>>>> -}
>>>> -
>>>> -static void __devinit quirk_uli5288(struct pci_dev *dev) -{
>>>> -	unsigned char c;
>>>> -
>>>> -	pci_read_config_byte(dev,0x83,&c);
>>>> -	c |= 0x80;
>>>> -	pci_write_config_byte(dev, 0x83, c);
>>>> -
>>>> -	pci_write_config_byte(dev, 0x09, 0x01);
>>>> -	pci_write_config_byte(dev, 0x0a, 0x06);
>>>> -
>>>> -	pci_read_config_byte(dev,0x83,&c);
>>>> -	c &= 0x7f;
>>>> -	pci_write_config_byte(dev, 0x83, c);
>>>> -
>>>> -	pci_read_config_byte(dev,0x84,&c);
>>>> -	c |= 0x01;
>>>> -	pci_write_config_byte(dev, 0x84, c);
>>>> -}
>>>> -
>>>> -static void __devinit quirk_uli5229(struct pci_dev *dev) -{
>>>> -	unsigned short temp;
>>>> -	pci_write_config_word(dev, 0x04, 0x0405);
>>>> -	pci_read_config_word(dev, 0x4a, &temp);
>>>> -	temp |= 0x1000;
>>>> -	pci_write_config_word(dev, 0x4a, temp);
>>>> -}
>>>> -
>>>> -static void __devinit early_uli5249(struct pci_dev *dev) -{
>>>> -	unsigned char temp;
>>>> -	pci_write_config_word(dev, 0x04, 0x0007);
>>>> -	pci_read_config_byte(dev, 0x7c, &temp);
>>>> -	pci_write_config_byte(dev, 0x7c, 0x80);
>>>> -	pci_write_config_byte(dev, 0x09, 0x01);
>>>> -	pci_write_config_byte(dev, 0x7c, temp);
>>>> -	dev->class |= 0x1;
>>>> -}
>>>> -
>>>> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575,
>> quirk_ali1575);
>>>> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL,
>>>> 0x5288, quirk_uli5288);
>>>> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229,
>> quirk_uli5229);
>>>> -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL,
>>>> 0x5249, early_uli5249); diff --git
>>>> a/include/asm-powerpc/mpc86xx.h
>>>> b/include/asm-powerpc/mpc86xx.h index d0a6718..00d72a7 100644
>>>> --- a/include/asm-powerpc/mpc86xx.h
>>>> +++ b/include/asm-powerpc/mpc86xx.h
>>>> @@ -20,10 +20,6 @@ #include <asm/mmu.h>
>>>>
>>>>  #ifdef CONFIG_PPC_86xx
>>>>
>>>> -#ifdef CONFIG_MPC8641_HPCN
>>>> -#include <platforms/86xx/mpc8641_hpcn.h> -#endif
>>>> -
>>>>  #define _IO_BASE        isa_io_base
>>>>  #define _ISA_MEM_BASE   isa_mem_base
>>>>  #ifdef CONFIG_PCI
>>>>
>>>> _______________________________________________
>>>> Linuxppc-dev mailing list
>>>> Linuxppc-dev@ozlabs.org
>>>> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>>>>
>>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: Please pull from 'for_paulus' branch of powerpc
@ 2006-06-29  6:13 Zhang Wei-r63237
  0 siblings, 0 replies; 20+ messages in thread
From: Zhang Wei-r63237 @ 2006-06-29  6:13 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel

> On Jun 28, 2006, at 10:33 PM, Zhang Wei-r63237 wrote:
> >> On Jun 28, 2006, at 1:26 AM, Zhang Wei-r63237 wrote:
> >>
> >>> Hi, Kumar,
> >>>
> >>> Why moving these codes from pci.c to mpc86xx_hpcn.c? It's
> >> not must be.
> >>> These functions relate to PCI device of MPC8641D HPCn platform.
> >>> And we can also see the 'DECLARE_PCI_FIXUP_HEADER()' 
> declaration in 
> >>> pci.c of Powermac platform.
> >>
> >> The point for moving is 86xx/pci.c should apply to all 
> 86xx systems, 
> >> not just the HPCn system.
> >>
> >> - kumar
> >
> > The codes of moving is for PCI devices, it's for HPCn 
> system now, but 
> > it's also fit for the same PCI chips in the other 86xx 
> system and the 
> > same chip should keep the same setting in 86xx platforms, I 
> think so.
> >
> > Even though other 86xx platforms have no these PCI chips, 
> these codes 
> > will not take effect.
> 
> Its code bloat for systems that dont need it.

Yes, but it will make the codes more general. 
Otherwise it will prevents using the same kernel image on another platform.

How to do if the other 86xx platform has the same ships? Add the same code to mpc86xx_xxx.c? It will also bloat the source tree.

> 
> > And we can also see the similar solution in pSeries and PowerMac 
> > platforms pci.c file. The function 'fixup_winbond_82c105' in 
> > pseries/pci.c is for the Winbond 82c105 IDE controller on p610.
> > (pSeries have only p610? :-D ) The function 'fixup_k2_sata' in 
> > powermac/pci.c is for K2-SATA. (K2-SATA chip is in all PowerMac 
> > machine? ;-) )
> 
> Realize, powermac and pseries describe actual full systems, 
> not processor families like 86xx.
> 
Yes, but the powermac and pseries full systems also have different model and different chips set. 
And using processor families like 85xx, 86xx as powerpc platform sub-directory name is maybe not a good idea.

Thanks,
Zhang Wei

> > The moving will make the mpc86xx_hpcn.c more fat.
> 
> That's all relative.
> 
> - kumar
> 
> >
> > Thanks,
> > Zhang Wei
> >
> >>
> >>>> -----Original Message-----
> >>>> From: linuxppc-dev-bounces+wei.zhang=freescale.com@ozlabs.org
> >>>> [mailto:linuxppc-dev-bounces+wei.zhang=freescale.com@ozlabs.or
> >>>> g] On Behalf Of Kumar Gala
> >>>> Sent: Wednesday, June 28, 2006 2:01 PM
> >>>> To: Paul Mackerras
> >>>> Cc: linuxppc-dev@ozlabs.org; linux-kernel@vger.kernel.org
> >>>> Subject: Please pull from 'for_paulus' branch of powerpc
> >>>>
> >>>> Please pull from 'for_paulus' branch of 
> >>>> master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git
> >>>>
> >>>> to receive the following updates:
> >>>>
> >>>>  arch/powerpc/kernel/cputable.c             |   12 --
> >>>>  arch/powerpc/platforms/86xx/mpc86xx.h      |    8 +
> >>>>  arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |  128
> >>>> +++++++++++++++++++++++++--
> >>>>  arch/powerpc/platforms/86xx/mpc86xx_smp.c  |    9 -
> >>>>  arch/powerpc/platforms/86xx/pci.c          |  136
> >>>> +----------------------------
> >>>>  include/asm-powerpc/mpc86xx.h              |    4
> >>>>  6 files changed, 138 insertions(+), 159 deletions(-)
> >>>>
> >>>> Kumar Gala:
> >>>>       powerpc: minor cleanups for mpc86xx
> >>>>
> >>>> diff --git a/arch/powerpc/kernel/cputable.c 
> >>>> b/arch/powerpc/kernel/cputable.c index 1c11488..abf7d42 100644
> >>>> --- a/arch/powerpc/kernel/cputable.c
> >>>> +++ b/arch/powerpc/kernel/cputable.c
> >>>> @@ -722,18 +722,6 @@ #if CLASSIC_PPC
> >>>>  		.oprofile_type		= PPC_OPROFILE_G4,
> >>>>  		.platform		= "ppc7450",
> >>>>  	},
> >>>> -        {       /* 8641 */
> >>>> -               .pvr_mask               = 0xffffffff,
> >>>> -               .pvr_value              = 0x80040010,
> >>>> -               .cpu_name               = "8641",
> >>>> -               .cpu_features           = CPU_FTRS_7447A,
> >>>> -               .cpu_user_features      = COMMON_USER |
> >>>> PPC_FEATURE_HAS_ALTIVEC_COMP,
> >>>> -               .icache_bsize           = 32,
> >>>> -               .dcache_bsize           = 32,
> >>>> -               .num_pmcs               = 6,
> >>>> -               .cpu_setup              = __setup_cpu_745x
> >>>> -        },
> >>>> -
> >>>>  	{	/* 82xx (8240, 8245, 8260 are all 603e cores) */
> >>>>  		.pvr_mask		= 0x7fff0000,
> >>>>  		.pvr_value		= 0x00810000,
> >>>> diff --git a/arch/powerpc/platforms/86xx/mpc86xx.h
> >>>> b/arch/powerpc/platforms/86xx/mpc86xx.h
> >>>> index e3c9e4f..2834462 100644
> >>>> --- a/arch/powerpc/platforms/86xx/mpc86xx.h
> >>>> +++ b/arch/powerpc/platforms/86xx/mpc86xx.h
> >>>> @@ -15,11 +15,13 @@ #define __MPC86XX_H__
> >>>>   * mpc86xx_* files. Mostly for use by mpc86xx_setup().
> >>>>   */
> >>>>
> >>>> -extern int __init add_bridge(struct device_node *dev);
> >>>> +extern int add_bridge(struct device_node *dev);
> >>>>
> >>>> -extern void __init setup_indirect_pcie(struct
> >> pci_controller *hose,
> >>>> +extern int mpc86xx_exclude_device(u_char bus, u_char devfn);
> >>>> +
> >>>> +extern void setup_indirect_pcie(struct pci_controller *hose,
> >>>>  				       u32 cfg_addr, u32
> >>>> cfg_data); -extern void __init
> >>>> setup_indirect_pcie_nomap(struct pci_controller *hose,
> >>>> +extern void setup_indirect_pcie_nomap(struct 
> pci_controller *hose,
> >>>>  					     void 
> __iomem *cfg_addr,
> >>>>  					     void 
> __iomem *cfg_data);
> >>>>
> >>>> diff --git a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
> >>>> b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
> >>>> index 483c21d..ac7f418 100644
> >>>> --- a/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
> >>>> +++ b/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c
> >>>> @@ -36,6 +36,7 @@ #include <asm/mpic.h>  #include
> >> <sysdev/fsl_soc.h>
> >>>>
> >>>>  #include "mpc86xx.h"
> >>>> +#include "mpc8641_hpcn.h"
> >>>>
> >>>>  #ifndef CONFIG_PCI
> >>>>  unsigned long isa_io_base = 0;
> >>>> @@ -186,17 +187,130 @@ mpc86xx_map_irq(struct pci_dev *dev, uns
> >>>>  	return PCI_IRQ_TABLE_LOOKUP + I8259_OFFSET;  }
> >>>>
> >>>> +static void __devinit quirk_ali1575(struct pci_dev *dev) {
> >>>> +	unsigned short temp;
> >>>> +
> >>>> +	/*
> >>>> +	 * ALI1575 interrupts route table setup:
> >>>> +	 *
> >>>> +	 * IRQ pin   IRQ#
> >>>> +	 * PIRQA ---- 3
> >>>> +	 * PIRQB ---- 4
> >>>> +	 * PIRQC ---- 5
> >>>> +	 * PIRQD ---- 6
> >>>> +	 * PIRQE ---- 9
> >>>> +	 * PIRQF ---- 10
> >>>> +	 * PIRQG ---- 11
> >>>> +	 * PIRQH ---- 12
> >>>> +	 *
> >>>> +	 * interrupts for PCI slot0 -- PIRQA / PIRQB / 
> PIRQC / PIRQD
> >>>> +	 *                PCI slot1 -- PIRQB / PIRQC / 
> PIRQD / PIRQA
> >>>> +	 */
> >>>> +	pci_write_config_dword(dev, 0x48, 0xb9317542);
> >>>> +
> >>>> +	/* USB 1.1 OHCI controller 1, interrupt: PIRQE */
> >>>> +	pci_write_config_byte(dev, 0x86, 0x0c);
> >>>> +
> >>>> +	/* USB 1.1 OHCI controller 2, interrupt: PIRQF */
> >>>> +	pci_write_config_byte(dev, 0x87, 0x0d);
> >>>> +
> >>>> +	/* USB 1.1 OHCI controller 3, interrupt: PIRQH */
> >>>> +	pci_write_config_byte(dev, 0x88, 0x0f);
> >>>> +
> >>>> +	/* USB 2.0 controller, interrupt: PIRQ7 */
> >>>> +	pci_write_config_byte(dev, 0x74, 0x06);
> >>>> +
> >>>> +	/* Audio controller, interrupt: PIRQE */
> >>>> +	pci_write_config_byte(dev, 0x8a, 0x0c);
> >>>> +
> >>>> +	/* Modem controller, interrupt: PIRQF */
> >>>> +	pci_write_config_byte(dev, 0x8b, 0x0d);
> >>>> +
> >>>> +	/* HD audio controller, interrupt: PIRQG */
> >>>> +	pci_write_config_byte(dev, 0x8c, 0x0e);
> >>>> +
> >>>> +	/* Serial ATA interrupt: PIRQD */
> >>>> +	pci_write_config_byte(dev, 0x8d, 0x0b);
> >>>> +
> >>>> +	/* SMB interrupt: PIRQH */
> >>>> +	pci_write_config_byte(dev, 0x8e, 0x0f);
> >>>> +
> >>>> +	/* PMU ACPI SCI interrupt: PIRQH */
> >>>> +	pci_write_config_byte(dev, 0x8f, 0x0f);
> >>>> +
> >>>> +	/* Primary PATA IDE IRQ: 14
> >>>> +	 * Secondary PATA IDE IRQ: 15
> >>>> +	 */
> >>>> +	pci_write_config_byte(dev, 0x44, 0x3d);
> >>>> +	pci_write_config_byte(dev, 0x75, 0x0f);
> >>>> +
> >>>> +	/* Set IRQ14 and IRQ15 to legacy IRQs */
> >>>> +	pci_read_config_word(dev, 0x46, &temp);
> >>>> +	temp |= 0xc000;
> >>>> +	pci_write_config_word(dev, 0x46, temp);
> >>>> +
> >>>> +	/* Set i8259 interrupt trigger
> >>>> +	 * IRQ 3:  Level
> >>>> +	 * IRQ 4:  Level
> >>>> +	 * IRQ 5:  Level
> >>>> +	 * IRQ 6:  Level
> >>>> +	 * IRQ 7:  Level
> >>>> +	 * IRQ 9:  Level
> >>>> +	 * IRQ 10: Level
> >>>> +	 * IRQ 11: Level
> >>>> +	 * IRQ 12: Level
> >>>> +	 * IRQ 14: Edge
> >>>> +	 * IRQ 15: Edge
> >>>> +	 */
> >>>> +	outb(0xfa, 0x4d0);
> >>>> +	outb(0x1e, 0x4d1);
> >>>> +}
> >>>>
> >>>> -int
> >>>> -mpc86xx_exclude_device(u_char bus, u_char devfn)
> >>>> +static void __devinit quirk_uli5288(struct pci_dev *dev)
> >>>>  {
> >>>> -#if !defined(CONFIG_PCI)
> >>>> -	if (bus == 0 && PCI_SLOT(devfn) == 0)
> >>>> -		return PCIBIOS_DEVICE_NOT_FOUND;
> >>>> -#endif
> >>>> +	unsigned char c;
> >>>> +
> >>>> +	pci_read_config_byte(dev,0x83,&c);
> >>>> +	c |= 0x80;
> >>>> +	pci_write_config_byte(dev, 0x83, c);
> >>>> +
> >>>> +	pci_write_config_byte(dev, 0x09, 0x01);
> >>>> +	pci_write_config_byte(dev, 0x0a, 0x06);
> >>>> +
> >>>> +	pci_read_config_byte(dev,0x83,&c);
> >>>> +	c &= 0x7f;
> >>>> +	pci_write_config_byte(dev, 0x83, c);
> >>>>
> >>>> -	return PCIBIOS_SUCCESSFUL;
> >>>> +	pci_read_config_byte(dev,0x84,&c);
> >>>> +	c |= 0x01;
> >>>> +	pci_write_config_byte(dev, 0x84, c);
> >>>>  }
> >>>> +
> >>>> +static void __devinit quirk_uli5229(struct pci_dev *dev) {
> >>>> +	unsigned short temp;
> >>>> +	pci_write_config_word(dev, 0x04, 0x0405);
> >>>> +	pci_read_config_word(dev, 0x4a, &temp);
> >>>> +	temp |= 0x1000;
> >>>> +	pci_write_config_word(dev, 0x4a, temp); }
> >>>> +
> >>>> +static void __devinit early_uli5249(struct pci_dev *dev) {
> >>>> +	unsigned char temp;
> >>>> +	pci_write_config_word(dev, 0x04, 0x0007);
> >>>> +	pci_read_config_byte(dev, 0x7c, &temp);
> >>>> +	pci_write_config_byte(dev, 0x7c, 0x80);
> >>>> +	pci_write_config_byte(dev, 0x09, 0x01);
> >>>> +	pci_write_config_byte(dev, 0x7c, temp);
> >>>> +	dev->class |= 0x1;
> >>>> +}
> >>>> +
> >>>> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575,
> >> quirk_ali1575);
> >>>> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5288,
> >> quirk_uli5288);
> >>>> +DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229,
> >> quirk_uli5229);
> >>>> +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL, 0x5249, 
> early_uli5249);
> >>>>  #endif /* CONFIG_PCI */
> >>>>
> >>>>
> >>>> diff --git a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
> >>>> b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
> >>>> index 944ec4b..9cca3d1 100644
> >>>> --- a/arch/powerpc/platforms/86xx/mpc86xx_smp.c
> >>>> +++ b/arch/powerpc/platforms/86xx/mpc86xx_smp.c
> >>>> @@ -34,8 +34,8 @@ extern unsigned long 
> __secondary_hold_ac static 
> >>>> void __init  smp_86xx_release_core(int nr)  {
> >>>> -	void *mcm_vaddr;
> >>>> -	unsigned long vaddr, pcr;
> >>>> +	__be32 __iomem *mcm_vaddr;
> >>>> +	unsigned long pcr;
> >>>>
> >>>>  	if (nr < 0 || nr >= NR_CPUS)
> >>>>  		return;
> >>>> @@ -45,10 +45,9 @@ smp_86xx_release_core(int nr)
> >>>>  	 */
> >>>>  	mcm_vaddr = ioremap(get_immrbase() + MPC86xx_MCM_OFFSET,
> >>>>  			    MPC86xx_MCM_SIZE);
> >>>> -	vaddr = (unsigned long)mcm_vaddr +  
> MCM_PORT_CONFIG_OFFSET;
> >>>> -	pcr = in_be32((volatile unsigned *)vaddr);
> >>>> +	pcr = in_be32(mcm_vaddr + 
> (MCM_PORT_CONFIG_OFFSET >> 2));
> >>>>  	pcr |= 1 << (nr + 24);
> >>>> -	out_be32((volatile unsigned *)vaddr, pcr);
> >>>> +	out_be32(mcm_vaddr + (MCM_PORT_CONFIG_OFFSET >> 
> 2), pcr);
> >>>>  }
> >>>>
> >>>>
> >>>> diff --git a/arch/powerpc/platforms/86xx/pci.c
> >>>> b/arch/powerpc/platforms/86xx/pci.c
> >>>> index 5180df7..0d8b340 100644
> >>>> --- a/arch/powerpc/platforms/86xx/pci.c
> >>>> +++ b/arch/powerpc/platforms/86xx/pci.c
> >>>> @@ -122,15 +122,12 @@ static void __init setup_pcie_atmu(struc 
> >>>> static void __init mpc86xx_setup_pcie(struct 
> pci_controller *hose,
> >>>> u32 pcie_offset, u32 pcie_size)  {
> >>>> -	volatile struct ccsr_pex *pcie;
> >>>>  	u16 cmd;
> >>>>  	unsigned int temps;
> >>>>
> >>>>  	DBG("PCIE host controller register offset 0x%08x, size
> >> 0x%08x.\n",
> >>>>  			pcie_offset, pcie_size);
> >>>>
> >>>> -	pcie = ioremap(pcie_offset, pcie_size);
> >>>> -
> >>>>  	early_read_config_word(hose, 0, 0, PCI_COMMAND, &cmd);
> >>>>  	cmd |= PCI_COMMAND_SERR | PCI_COMMAND_MASTER |
> >> PCI_COMMAND_MEMORY
> >>>>  	    | PCI_COMMAND_IO;
> >>>> @@ -144,6 +141,14 @@ mpc86xx_setup_pcie(struct pci_controller
> >>>>  	early_write_config_dword(hose, 0, 0, 
> PCI_PRIMARY_BUS, temps);  }
> >>>>
> >>>> +int mpc86xx_exclude_device(u_char bus, u_char devfn) {
> >>>> +	if (bus == 0 && PCI_SLOT(devfn) == 0)
> >>>> +		return PCIBIOS_DEVICE_NOT_FOUND;
> >>>> +
> >>>> +	return PCIBIOS_SUCCESSFUL;
> >>>> +}
> >>>> +
> >>>>  int __init add_bridge(struct device_node *dev)  {
> >>>>  	int len;
> >>>> @@ -198,128 +203,3 @@ int __init add_bridge(struct device_node
> >>>>
> >>>>  	return 0;
> >>>>  }
> >>>> -
> >>>> -static void __devinit quirk_ali1575(struct pci_dev *dev) -{
> >>>> -	unsigned short temp;
> >>>> -
> >>>> -	/*
> >>>> -	 * ALI1575 interrupts route table setup:
> >>>> -	 *
> >>>> -	 * IRQ pin   IRQ#
> >>>> -	 * PIRQA ---- 3
> >>>> -	 * PIRQB ---- 4
> >>>> -	 * PIRQC ---- 5
> >>>> -	 * PIRQD ---- 6
> >>>> -	 * PIRQE ---- 9
> >>>> -	 * PIRQF ---- 10
> >>>> -	 * PIRQG ---- 11
> >>>> -	 * PIRQH ---- 12
> >>>> -	 *
> >>>> -	 * interrupts for PCI slot0 -- PIRQA / PIRQB / 
> PIRQC / PIRQD
> >>>> -	 *                PCI slot1 -- PIRQB / PIRQC / 
> PIRQD / PIRQA
> >>>> -	 */
> >>>> -	pci_write_config_dword(dev, 0x48, 0xb9317542);
> >>>> -
> >>>> -	/* USB 1.1 OHCI controller 1, interrupt: PIRQE */
> >>>> -	pci_write_config_byte(dev, 0x86, 0x0c);
> >>>> -
> >>>> -	/* USB 1.1 OHCI controller 2, interrupt: PIRQF */
> >>>> -	pci_write_config_byte(dev, 0x87, 0x0d);
> >>>> -
> >>>> -	/* USB 1.1 OHCI controller 3, interrupt: PIRQH */
> >>>> -	pci_write_config_byte(dev, 0x88, 0x0f);
> >>>> -
> >>>> -	/* USB 2.0 controller, interrupt: PIRQ7 */
> >>>> -	pci_write_config_byte(dev, 0x74, 0x06);
> >>>> -
> >>>> -	/* Audio controller, interrupt: PIRQE */
> >>>> -	pci_write_config_byte(dev, 0x8a, 0x0c);
> >>>> -
> >>>> -	/* Modem controller, interrupt: PIRQF */
> >>>> -	pci_write_config_byte(dev, 0x8b, 0x0d);
> >>>> -
> >>>> -	/* HD audio controller, interrupt: PIRQG */
> >>>> -	pci_write_config_byte(dev, 0x8c, 0x0e);
> >>>> -
> >>>> -	/* Serial ATA interrupt: PIRQD */
> >>>> -	pci_write_config_byte(dev, 0x8d, 0x0b);
> >>>> -
> >>>> -	/* SMB interrupt: PIRQH */
> >>>> -	pci_write_config_byte(dev, 0x8e, 0x0f);
> >>>> -
> >>>> -	/* PMU ACPI SCI interrupt: PIRQH */
> >>>> -	pci_write_config_byte(dev, 0x8f, 0x0f);
> >>>> -
> >>>> -	/* Primary PATA IDE IRQ: 14
> >>>> -	 * Secondary PATA IDE IRQ: 15
> >>>> -	 */
> >>>> -	pci_write_config_byte(dev, 0x44, 0x3d);
> >>>> -	pci_write_config_byte(dev, 0x75, 0x0f);
> >>>> -
> >>>> -	/* Set IRQ14 and IRQ15 to legacy IRQs */
> >>>> -	pci_read_config_word(dev, 0x46, &temp);
> >>>> -	temp |= 0xc000;
> >>>> -	pci_write_config_word(dev, 0x46, temp);
> >>>> -
> >>>> -	/* Set i8259 interrupt trigger
> >>>> -	 * IRQ 3:  Level
> >>>> -	 * IRQ 4:  Level
> >>>> -	 * IRQ 5:  Level
> >>>> -	 * IRQ 6:  Level
> >>>> -	 * IRQ 7:  Level
> >>>> -	 * IRQ 9:  Level
> >>>> -	 * IRQ 10: Level
> >>>> -	 * IRQ 11: Level
> >>>> -	 * IRQ 12: Level
> >>>> -	 * IRQ 14: Edge
> >>>> -	 * IRQ 15: Edge
> >>>> -	 */
> >>>> -	outb(0xfa, 0x4d0);
> >>>> -	outb(0x1e, 0x4d1);
> >>>> -}
> >>>> -
> >>>> -static void __devinit quirk_uli5288(struct pci_dev *dev) -{
> >>>> -	unsigned char c;
> >>>> -
> >>>> -	pci_read_config_byte(dev,0x83,&c);
> >>>> -	c |= 0x80;
> >>>> -	pci_write_config_byte(dev, 0x83, c);
> >>>> -
> >>>> -	pci_write_config_byte(dev, 0x09, 0x01);
> >>>> -	pci_write_config_byte(dev, 0x0a, 0x06);
> >>>> -
> >>>> -	pci_read_config_byte(dev,0x83,&c);
> >>>> -	c &= 0x7f;
> >>>> -	pci_write_config_byte(dev, 0x83, c);
> >>>> -
> >>>> -	pci_read_config_byte(dev,0x84,&c);
> >>>> -	c |= 0x01;
> >>>> -	pci_write_config_byte(dev, 0x84, c);
> >>>> -}
> >>>> -
> >>>> -static void __devinit quirk_uli5229(struct pci_dev *dev) -{
> >>>> -	unsigned short temp;
> >>>> -	pci_write_config_word(dev, 0x04, 0x0405);
> >>>> -	pci_read_config_word(dev, 0x4a, &temp);
> >>>> -	temp |= 0x1000;
> >>>> -	pci_write_config_word(dev, 0x4a, temp);
> >>>> -}
> >>>> -
> >>>> -static void __devinit early_uli5249(struct pci_dev *dev) -{
> >>>> -	unsigned char temp;
> >>>> -	pci_write_config_word(dev, 0x04, 0x0007);
> >>>> -	pci_read_config_byte(dev, 0x7c, &temp);
> >>>> -	pci_write_config_byte(dev, 0x7c, 0x80);
> >>>> -	pci_write_config_byte(dev, 0x09, 0x01);
> >>>> -	pci_write_config_byte(dev, 0x7c, temp);
> >>>> -	dev->class |= 0x1;
> >>>> -}
> >>>> -
> >>>> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x1575,
> >> quirk_ali1575);
> >>>> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL,
> >>>> 0x5288, quirk_uli5288);
> >>>> -DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AL, 0x5229,
> >> quirk_uli5229);
> >>>> -DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_AL,
> >>>> 0x5249, early_uli5249); diff --git
> >>>> a/include/asm-powerpc/mpc86xx.h
> >>>> b/include/asm-powerpc/mpc86xx.h index d0a6718..00d72a7 100644
> >>>> --- a/include/asm-powerpc/mpc86xx.h
> >>>> +++ b/include/asm-powerpc/mpc86xx.h
> >>>> @@ -20,10 +20,6 @@ #include <asm/mmu.h>
> >>>>
> >>>>  #ifdef CONFIG_PPC_86xx
> >>>>
> >>>> -#ifdef CONFIG_MPC8641_HPCN
> >>>> -#include <platforms/86xx/mpc8641_hpcn.h> -#endif
> >>>> -
> >>>>  #define _IO_BASE        isa_io_base
> >>>>  #define _ISA_MEM_BASE   isa_mem_base
> >>>>  #ifdef CONFIG_PCI
> >>>>
> >>>> _______________________________________________
> >>>> Linuxppc-dev mailing list
> >>>> Linuxppc-dev@ozlabs.org
> >>>> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> >>>>
> >>
> 

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: Please pull from 'for_paulus' branch of powerpc
  2006-06-29  5:08 ` Kumar Gala
@ 2006-06-29  9:10   ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 20+ messages in thread
From: Benjamin Herrenschmidt @ 2006-06-29  9:10 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras, linux-kernel, Zhang Wei-r63237


> > Even though other 86xx platforms have no these PCI chips, these  
> > codes will not take effect.
> 
> Its code bloat for systems that dont need it.

Well... it depends :) If it's totally unlikely to ever have this chip in
those platforms, then yes. But if it's common enough, it's fair to have
the quirk in a generic place (provided that Whang is right and the fixup
is indeed the same for all 86xx platforms)

Ben.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2006-06-29  9:11 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-28  6:01 Please pull from 'for_paulus' branch of powerpc Kumar Gala
2006-06-28 22:44 ` Jon Loeliger
  -- strict thread matches above, loose matches on Subject: below --
2006-06-29  6:13 Zhang Wei-r63237
2006-06-29  3:33 Zhang Wei-r63237
2006-06-29  5:08 ` Kumar Gala
2006-06-29  9:10   ` Benjamin Herrenschmidt
2006-06-28  6:26 Zhang Wei-r63237
2006-06-28 13:19 ` Kumar Gala
2006-05-04 21:28 Kumar Gala
2006-05-04 22:09 ` Segher Boessenkool
2006-05-04 22:10   ` Kumar Gala
2006-05-04 22:36     ` Segher Boessenkool
2006-05-04 22:49 ` Paul Mackerras
2006-05-05  4:59   ` Kumar Gala
2006-04-04 21:14 Kumar Gala
2006-04-05  0:28 ` Stephen Rothwell
2006-04-05  1:23   ` Kumar Gala
2006-04-05  3:05     ` Stephen Rothwell
2006-04-05  4:33       ` Kumar Gala
2006-03-31  5:43 Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).