LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4/4] powerpc: Katana750i - Add platform support
From: Mark A. Greer @ 2008-01-14 23:00 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: linuxppc-dev
In-Reply-To: <20080114225150.GB21940@mag.az.mvista.com>

From: Mark A. Greer <mgreer@mvista.com>

Add support for the Emerson Katana 750i & 752i platforms.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
This patch depends on 2 other patch series. This is the list of all the
patches in the two series (not all of them are actually required):

http://patchwork.ozlabs.org/linuxppc/patch?id=14397
http://patchwork.ozlabs.org/linuxppc/patch?id=14396
http://patchwork.ozlabs.org/linuxppc/patch?id=14631
http://patchwork.ozlabs.org/linuxppc/patch?id=14632
http://patchwork.ozlabs.org/linuxppc/patch?id=14633
http://patchwork.ozlabs.org/linuxppc/patch?id=15007
http://patchwork.ozlabs.org/linuxppc/patch?id=15453
http://patchwork.ozlabs.org/linuxppc/patch?id=15454
http://patchwork.ozlabs.org/linuxppc/patch?id=15455
http://patchwork.ozlabs.org/linuxppc/patch?id=15456
http://patchwork.ozlabs.org/linuxppc/patch?id=15457
http://patchwork.ozlabs.org/linuxppc/patch?id=15458
http://patchwork.ozlabs.org/linuxppc/patch?id=15459
http://patchwork.ozlabs.org/linuxppc/patch?id=15460

 arch/powerpc/boot/Makefile                      |    3 
 arch/powerpc/boot/cuboot-katana750i.c           |  248 ++
 arch/powerpc/configs/katana750i_defconfig       | 1315 ++++++++++++++
 arch/powerpc/platforms/embedded6xx/Kconfig      |   10 
 arch/powerpc/platforms/embedded6xx/Makefile     |    1 
 arch/powerpc/platforms/embedded6xx/katana750i.c |  314 +++
 6 files changed, 1890 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index d1e625c..b04ecc0 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -62,7 +62,7 @@ src-plat := of.c cuboot-52xx.c cuboot-83xx.c cuboot-85xx.c holly.c \
 		ps3-head.S ps3-hvcall.S ps3.c treeboot-bamboo.c cuboot-8xx.c \
 		cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c cuboot-bamboo.c \
 		fixed-head.S ep88xc.c cuboot-hpc2.c ep405.c cuboot-taishan.c \
-		cuboot-katmai.c cuboot-rainier.c
+		cuboot-katmai.c cuboot-rainier.c cuboot-katana750i.c
 src-boot := $(src-wlib) $(src-plat) empty.c
 
 src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -206,6 +206,7 @@ image-$(CONFIG_RAINIER)			+= cuImage.rainier
 image-$(CONFIG_WALNUT)			+= treeImage.walnut
 image-$(CONFIG_TAISHAN)			+= cuImage.taishan
 image-$(CONFIG_KATMAI)			+= cuImage.katmai
+image-$(CONFIG_PPC_KATANA750I)		+= cuImage.katana750i
 endif
 
 # For 32-bit powermacs, build the COFF and miboot images
diff --git a/arch/powerpc/boot/cuboot-katana750i.c b/arch/powerpc/boot/cuboot-katana750i.c
new file mode 100644
index 0000000..41d4105
--- /dev/null
+++ b/arch/powerpc/boot/cuboot-katana750i.c
@@ -0,0 +1,248 @@
+/*
+ * Emerson Katana-750i/752i
+ *
+ * Author: Mark A. Greer <mgreer@mvista.com>
+ *
+ * 2007 (c) MontaVista, Software, Inc.  This file is licensed under
+ * the terms of the GNU General Public License version 2.  This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ */
+
+#include "stdio.h"
+#include "io.h"
+#include "ops.h"
+#include "cuboot.h"
+#include "ppcboot.h"
+#include "mv64x60.h"
+
+static u8 *bridge_base;
+static u8 *cpld_base;
+static bd_t bd;
+
+#define KATANA750I_CPLD_RST_CMD			0x00001000
+#define KATANA750I_CPLD_RST_CMD_HR		0x01
+
+#define KATANA750I_CPLD_PRODUCT_ID		0x00004000
+#define	KATANA750I_PRODUCT_ID_750I		0x02
+#define	KATANA750I_PRODUCT_ID_752I		0x04
+
+#define KATANA750I_CPLD_BD_CFG_0		0x00009000
+#define KATANA750I_CPLD_BD_CFG_0_SYSCLK_MASK	0xc0
+#define KATANA750I_CPLD_BD_CFG_0_SYSCLK_200	0x00
+#define KATANA750I_CPLD_BD_CFG_0_SYSCLK_166	0x80
+#define KATANA750I_CPLD_BD_CFG_0_SYSCLK_133	0xc0
+#define KATANA750I_CPLD_BD_CFG_0_SYSCLK_100	0x40
+
+#define BOARD_MODEL_MAX	32
+
+typedef enum {
+	BOARD_TYPE_750I,
+	BOARD_TYPE_752I,
+} katana750i_board_type;
+
+struct katana750i_board_info {
+	char	cpld_prod_id;
+	char	*model;
+	char	*bridge_type;
+};
+
+static struct katana750i_board_info katana750i_board_info[] = {
+	[BOARD_TYPE_750I] = {
+		.cpld_prod_id	= KATANA750I_PRODUCT_ID_750I,
+		.model		= "Katana-750i",
+		.bridge_type	= "mv64360",
+	},
+	[BOARD_TYPE_752I] = {
+		.cpld_prod_id	= KATANA750I_PRODUCT_ID_752I,
+		.model		= "Katana-752i",
+		.bridge_type	= "mv64460",
+	},
+};
+
+static struct katana750i_board_info *katana750i_get_bip(void)
+{
+	struct katana750i_board_info *bip;
+	int i;
+	u8 id;
+
+	id = in_8(cpld_base + KATANA750I_CPLD_PRODUCT_ID);
+
+	for (i = 0, bip = katana750i_board_info;
+			i < ARRAY_SIZE(katana750i_board_info); i++, bip++)
+		if (bip->cpld_prod_id == id)
+			return bip;
+
+	return NULL;
+}
+
+static void katana750i_bridge_setup(void)
+{
+	u32 i, v[12], enables, acc_bits;
+	u32 pci_base_hi, pci_base_lo, size, buf[2];
+	unsigned long cpu_base;
+	int rc;
+	void *devp;
+	u8 *bridge_pbase, is_coherent;
+	struct mv64x60_cpu2pci_win *tbl;
+
+	bridge_pbase = mv64x60_get_bridge_pbase();
+	is_coherent = mv64x60_is_coherent();
+
+	if (is_coherent)
+		acc_bits = MV64x60_PCI_ACC_CNTL_SNOOP_WB
+			| MV64x60_PCI_ACC_CNTL_SWAP_NONE
+			| MV64x60_PCI_ACC_CNTL_MBURST_32_BYTES
+			| MV64x60_PCI_ACC_CNTL_RDSIZE_32_BYTES;
+	else
+		acc_bits = MV64x60_PCI_ACC_CNTL_SNOOP_NONE
+			| MV64x60_PCI_ACC_CNTL_SWAP_NONE
+			| MV64x60_PCI_ACC_CNTL_MBURST_128_BYTES
+			| MV64x60_PCI_ACC_CNTL_RDSIZE_256_BYTES;
+
+	mv64x60_config_ctlr_windows(bridge_base, bridge_pbase, is_coherent);
+	mv64x60_config_pci_windows(bridge_base, bridge_pbase, 1, 0, acc_bits);
+
+	/* Get the cpu -> pci i/o & mem mappings from the device tree */
+	devp = finddevice("/mv64x60/pci");
+	if (devp == NULL)
+		fatal("Error: Missing /mv64x60/pci device tree node\n\r");
+
+	rc = getprop(devp, "ranges", v, sizeof(v));
+	if (rc != sizeof(v))
+		fatal("Error: Can't find /mv64x60/pci/ranges property\n\r");
+
+	/* Get the cpu -> pci i/o & mem mappings from the device tree */
+	devp = finddevice("/mv64x60");
+	if (devp == NULL)
+		fatal("Error: Missing /mv64x60 device tree node\n\r");
+
+	enables = in_le32((u32 *)(bridge_base + MV64x60_CPU_BAR_ENABLE));
+	enables |= 0x0007fe00; /* Disable all cpu->pci windows */
+	out_le32((u32 *)(bridge_base + MV64x60_CPU_BAR_ENABLE), enables);
+
+	for (i=0; i<12; i+=6) {
+		switch (v[i] & 0xff000000) {
+		case 0x01000000: /* PCI I/O Space */
+			tbl = mv64x60_cpu2pci_io;
+			break;
+		case 0x02000000: /* PCI MEM Space */
+			tbl = mv64x60_cpu2pci_mem;
+			break;
+		default:
+			continue;
+		}
+
+		pci_base_hi = v[i+1];
+		pci_base_lo = v[i+2];
+		cpu_base = v[i+3];
+		size = v[i+5];
+
+		buf[0] = cpu_base;
+		buf[1] = size;
+
+		if (!dt_xlate_addr(devp, buf, sizeof(buf), &cpu_base))
+			fatal("Error: Can't translate PCI address 0x%x\n\r",
+					(u32)cpu_base);
+
+		mv64x60_config_cpu2pci_window(bridge_base, 1, pci_base_hi,
+				pci_base_lo, cpu_base, size, tbl);
+	}
+
+	enables &= ~0x0000c000; /* Enable cpu->pci1 i/o, cpu->pci1 mem0 */
+	out_le32((u32 *)(bridge_base + MV64x60_CPU_BAR_ENABLE), enables);
+}
+
+static void katana750i_fixups(void)
+{
+	void *devp;
+	struct katana750i_board_info *bip;
+	u32 v[2];
+
+	katana750i_bridge_setup();
+
+	bip = katana750i_get_bip();
+	if (!bip) {
+		printf("Can't identify Katana board. Using DT defaults.\n\r");
+		return;
+	}
+
+	devp = finddevice("/");
+	if (devp == NULL)
+		fatal("Error: Missing '/' device tree node\n\r");
+	setprop(devp, "model", bip->model, strlen(bip->model) + 1);
+
+	dt_fixup_memory(bd.bi_memstart, bd.bi_memsize);
+	dt_fixup_cpu_clocks(bd.bi_intfreq, bd.bi_busfreq / 4, bd.bi_busfreq);
+
+	devp = finddevice("/mv64x60");
+	if (devp == NULL)
+		fatal("Error: Missing /mv64x60 device tree node\n\r");
+	setprop(devp, "model", bip->bridge_type, strlen(bip->bridge_type) + 1);
+
+	devp = finddevice("/mv64x60/flash");
+	if (devp == NULL)
+		fatal("Error: Missing '/mv64x60/flash' device tree node\n\r");
+	v[0] = bd.bi_flashstart;
+	v[1] = bd.bi_flashsize & 0xfff00000;
+	setprop(devp, "reg", v, 2 * sizeof(v[0]));
+
+	devp = finddevice("/mv64x60/brg@b200");
+	if (devp == NULL)
+		fatal("Error:Missing '/mv64x60/brg@b200' device tree node\n\r");
+	v[0] = bd.bi_baudrate;
+	setprop(devp, "current-speed", v, sizeof(v[0]));
+}
+
+static void katana750i_reset(void)
+{
+	udelay(5000000);
+
+	if (bridge_base)
+		out_8(cpld_base + KATANA750I_CPLD_RST_CMD,
+				KATANA750I_CPLD_RST_CMD_HR);
+	for (;;);
+}
+
+static u8 *katana750i_get_cpld_base(void)
+{
+	u32 v;
+	void *devp;
+
+	devp = finddevice("/mv64x60/cpld");
+	if (devp == NULL)
+		goto err_out;
+	if (getprop(devp, "virtual-reg", &v, sizeof(v)) != sizeof(v))
+		goto err_out;
+
+	return (u8 *)v;
+
+err_out:
+	return 0;
+}
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
+                   unsigned long r6, unsigned long r7)
+{
+	CUBOOT_INIT();
+	fdt_init(_dtb_start);
+
+	bridge_base = mv64x60_get_bridge_base();
+	cpld_base = katana750i_get_cpld_base();
+
+	platform_ops.fixups = katana750i_fixups;
+	platform_ops.exit = katana750i_reset;
+
+	serial_console_init();
+}
+
+/* _zimage_start called very early--need to turn off external interrupts */
+asm ("		.globl _zimage_start\n\
+	_zimage_start:\n\
+		mfmsr	10\n\
+		rlwinm	10,10,0,~(1<<15)	/* Clear MSR_EE */\n\
+		sync\n\
+		mtmsr	10\n\
+		isync\n\
+		b _zimage_start_lib\n\
+");
diff --git a/arch/powerpc/configs/katana750i_defconfig b/arch/powerpc/configs/katana750i_defconfig
new file mode 100644
index 0000000..b55dd55
--- /dev/null
+++ b/arch/powerpc/configs/katana750i_defconfig
@@ -0,0 +1,1315 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.24-rc6
+# Mon Jan 14 14:39:14 2008
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+CONFIG_6xx=y
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+# CONFIG_44x is not set
+# CONFIG_E200 is not set
+CONFIG_PPC_FPU=y
+CONFIG_ALTIVEC=y
+CONFIG_PPC_STD_MMU=y
+CONFIG_PPC_STD_MMU_32=y
+# CONFIG_PPC_MM_SLICES is not set
+# CONFIG_SMP is not set
+CONFIG_NOT_COHERENT_CACHE=y
+CONFIG_CHECK_CACHE_COHERENCY=y
+CONFIG_PPC32=y
+CONFIG_WORD_SIZE=32
+CONFIG_PPC_MERGE=y
+CONFIG_MMU=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_HARDIRQS=y
+CONFIG_IRQ_PER_CPU=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_ARCH_HAS_ILOG2_U32=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_GENERIC_FIND_NEXT_BIT=y
+# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
+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_OF=y
+# CONFIG_PPC_UDBG_16550 is not set
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+# CONFIG_DEFAULT_UIMAGE is not set
+# CONFIG_PPC_DCR_NATIVE is not set
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+
+#
+# General setup
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_LOCALVERSION=""
+CONFIG_LOCALVERSION_AUTO=y
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+CONFIG_POSIX_MQUEUE=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+# CONFIG_USER_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_AUDIT is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_CGROUPS is not set
+# CONFIG_FAIR_GROUP_SCHED is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+# CONFIG_EMBEDDED is not set
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# 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_ANON_INODES=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_EVENTFD=y
+CONFIG_SHMEM=y
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+# CONFIG_MODULES is not set
+CONFIG_BLOCK=y
+CONFIG_LBD=y
+# CONFIG_BLK_DEV_IO_TRACE is not set
+# CONFIG_LSF is not set
+# CONFIG_BLK_DEV_BSG is not set
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+# CONFIG_IOSCHED_DEADLINE is not set
+# CONFIG_IOSCHED_CFQ is not set
+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"
+
+#
+# Platform support
+#
+CONFIG_PPC_MULTIPLATFORM=y
+# CONFIG_PPC_82xx is not set
+# CONFIG_PPC_83xx is not set
+# CONFIG_PPC_86xx is not set
+CONFIG_CLASSIC32=y
+# CONFIG_PPC_CHRP is not set
+# CONFIG_PPC_MPC52xx is not set
+# CONFIG_PPC_MPC5200 is not set
+# CONFIG_PPC_EFIKA is not set
+# CONFIG_PPC_LITE5200 is not set
+# CONFIG_PPC_PMAC is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+CONFIG_EMBEDDED6xx=y
+# CONFIG_LINKSTATION is not set
+# CONFIG_MPC7448HPC2 is not set
+# CONFIG_PPC_HOLLY is not set
+# CONFIG_PPC_PRPMC2800 is not set
+CONFIG_PPC_KATANA750I=y
+CONFIG_MV64X60=y
+# CONFIG_MPIC is not set
+# CONFIG_MPIC_WEIRD is not set
+# CONFIG_PPC_I8259 is not set
+# CONFIG_PPC_RTAS is not set
+# CONFIG_MMIO_NVRAM is not set
+# CONFIG_PPC_MPC106 is not set
+# CONFIG_PPC_970_NAP is not set
+# CONFIG_PPC_INDIRECT_IO is not set
+# CONFIG_GENERIC_IOMAP is not set
+# CONFIG_CPU_FREQ is not set
+# CONFIG_TAU is not set
+# CONFIG_CPM2 is not set
+# CONFIG_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+CONFIG_HIGHMEM=y
+CONFIG_TICK_ONESHOT=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
+# CONFIG_HZ_100 is not set
+CONFIG_HZ_250=y
+# CONFIG_HZ_300 is not set
+# 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_ARCH_ENABLE_MEMORY_HOTPLUG=y
+# CONFIG_KEXEC is not set
+CONFIG_ARCH_FLATMEM_ENABLE=y
+CONFIG_ARCH_POPULATES_NODE_MAP=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_SPARSEMEM_VMEMMAP_ENABLE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+# CONFIG_RESOURCES_64BIT is not set
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_PROC_DEVICETREE=y
+# CONFIG_CMDLINE_BOOL is not set
+# CONFIG_PM is not set
+CONFIG_SUSPEND_UP_POSSIBLE=y
+CONFIG_HIBERNATION_UP_POSSIBLE=y
+# CONFIG_SECCOMP is not set
+CONFIG_WANT_DEVICE_TREE=y
+CONFIG_DEVICE_TREE="katana750i.dts"
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_DMA=y
+CONFIG_GENERIC_ISA_DMA=y
+CONFIG_PPC_INDIRECT_PCI=y
+CONFIG_PCI=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_SYSCALL=y
+# CONFIG_PCIEPORTBUS is not set
+CONFIG_ARCH_SUPPORTS_MSI=y
+# CONFIG_PCI_MSI is not set
+CONFIG_PCI_LEGACY=y
+# CONFIG_PCCARD is not set
+# 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=0xc0000000
+CONFIG_CONSISTENT_START=0xff100000
+CONFIG_CONSISTENT_SIZE=0x00200000
+CONFIG_BOOT_LOAD=0x00800000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+CONFIG_XFRM=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# 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_XFRM_MODE_TRANSPORT=y
+CONFIG_INET_XFRM_MODE_TUNNEL=y
+CONFIG_INET_XFRM_MODE_BEET=y
+# CONFIG_INET_LRO is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_TCP_CONG_ADVANCED is not set
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_DEFAULT_TCP_CONG="cubic"
+# CONFIG_TCP_MD5SIG is not set
+# CONFIG_IPV6 is not set
+# CONFIG_INET6_XFRM_TUNNEL is not set
+# CONFIG_INET6_TUNNEL is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# 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_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# 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_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
+# CONFIG_MAC80211 is not set
+# CONFIG_IEEE80211 is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+
+#
+# Device Drivers
+#
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+# CONFIG_FW_LOADER is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_CONCAT=y
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_MTD_OOPS is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+CONFIG_MTD_CFI=y
+CONFIG_MTD_JEDECPROBE=y
+CONFIG_MTD_GEN_PROBE=y
+# CONFIG_MTD_CFI_ADV_OPTIONS is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+CONFIG_MTD_CFI_INTELEXT=y
+# CONFIG_MTD_CFI_AMDSTD is not set
+# CONFIG_MTD_CFI_STAA is not set
+CONFIG_MTD_CFI_UTIL=y
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PHYSMAP is not set
+CONFIG_MTD_PHYSMAP_OF=y
+# CONFIG_MTD_INTEL_VR_NOR is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_PMC551 is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+# CONFIG_MTD_NAND is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# UBI - Unsorted block images
+#
+# CONFIG_MTD_UBI is not set
+CONFIG_OF_DEVICE=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# 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_UB is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=131072
+CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+CONFIG_MISC_DEVICES=y
+# CONFIG_PHANTOM is not set
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_SGI_IOC4 is not set
+# CONFIG_TIFM_CORE is not set
+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=y
+# 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_BLK_DEV_IDESCSI is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+CONFIG_IDE_PROC_FS=y
+
+#
+# IDE chipset support/bugfixes
+#
+CONFIG_IDE_GENERIC=y
+# CONFIG_BLK_DEV_PLATFORM is not set
+
+#
+# PCI IDE chipsets support
+#
+CONFIG_BLK_DEV_IDEPCI=y
+# CONFIG_IDEPCI_SHARE_IRQ is not set
+CONFIG_IDEPCI_PCIBUS_ORDER=y
+# CONFIG_BLK_DEV_OFFBOARD is not set
+CONFIG_BLK_DEV_GENERIC=y
+# CONFIG_BLK_DEV_OPTI621 is not set
+CONFIG_BLK_DEV_IDEDMA_PCI=y
+# 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_JMICRON is not set
+# CONFIG_BLK_DEV_SC1200 is not set
+# CONFIG_BLK_DEV_PIIX is not set
+# CONFIG_BLK_DEV_IT8213 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=y
+# CONFIG_BLK_DEV_SVWKS is not set
+# CONFIG_BLK_DEV_SIIMAGE is not set
+# CONFIG_BLK_DEV_SL82C105 is not set
+# CONFIG_BLK_DEV_SLC90E66 is not set
+# CONFIG_BLK_DEV_TRM290 is not set
+# CONFIG_BLK_DEV_VIA82CXXX is not set
+# CONFIG_BLK_DEV_TC86C001 is not set
+# CONFIG_IDE_ARM is not set
+CONFIG_BLK_DEV_IDEDMA=y
+CONFIG_IDE_ARCH_OBSOLETE_INIT=y
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+# CONFIG_SCSI_TGT is not set
+# CONFIG_SCSI_NETLINK is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_MULTI_LUN is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+# CONFIG_SCSI_FC_ATTRS is not set
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_3W_9XXX is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_AIC79XX is not set
+# CONFIG_SCSI_AIC94XX is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_ARCMSR is not set
+# CONFIG_MEGARAID_NEWGEN is not set
+# CONFIG_MEGARAID_LEGACY is not set
+# CONFIG_MEGARAID_SAS is not set
+# CONFIG_SCSI_HPTIOP is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_STEX is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_IPR is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_QLA_FC is not set
+# CONFIG_SCSI_QLA_ISCSI is not set
+# CONFIG_SCSI_LPFC is not set
+# CONFIG_SCSI_DC395x is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_NSP32 is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_SRP is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+# CONFIG_SATA_AHCI is not set
+# CONFIG_SATA_SVW is not set
+# CONFIG_ATA_PIIX is not set
+CONFIG_SATA_MV=y
+# CONFIG_SATA_NV is not set
+# CONFIG_PDC_ADMA is not set
+# CONFIG_SATA_QSTOR is not set
+# CONFIG_SATA_PROMISE is not set
+# CONFIG_SATA_SX4 is not set
+# CONFIG_SATA_SIL is not set
+# CONFIG_SATA_SIL24 is not set
+# CONFIG_SATA_SIS is not set
+# CONFIG_SATA_ULI is not set
+# CONFIG_SATA_VIA is not set
+# CONFIG_SATA_VITESSE is not set
+# CONFIG_SATA_INIC162X is not set
+# CONFIG_PATA_ALI is not set
+# CONFIG_PATA_AMD is not set
+# CONFIG_PATA_ARTOP is not set
+# CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
+# CONFIG_PATA_CMD64X is not set
+# CONFIG_PATA_CS5520 is not set
+# CONFIG_PATA_CS5530 is not set
+# CONFIG_PATA_CYPRESS is not set
+# CONFIG_PATA_EFAR is not set
+# CONFIG_ATA_GENERIC is not set
+# CONFIG_PATA_HPT366 is not set
+# CONFIG_PATA_HPT37X is not set
+# CONFIG_PATA_HPT3X2N is not set
+# CONFIG_PATA_HPT3X3 is not set
+# CONFIG_PATA_IT821X is not set
+# CONFIG_PATA_IT8213 is not set
+# CONFIG_PATA_JMICRON is not set
+# CONFIG_PATA_TRIFLEX is not set
+# CONFIG_PATA_MARVELL is not set
+# CONFIG_PATA_MPIIX is not set
+# CONFIG_PATA_OLDPIIX is not set
+# CONFIG_PATA_NETCELL is not set
+# CONFIG_PATA_NS87410 is not set
+# CONFIG_PATA_NS87415 is not set
+# CONFIG_PATA_OPTI is not set
+# CONFIG_PATA_OPTIDMA is not set
+# CONFIG_PATA_PDC_OLD is not set
+# CONFIG_PATA_RADISYS is not set
+# CONFIG_PATA_RZ1000 is not set
+# CONFIG_PATA_SC1200 is not set
+# CONFIG_PATA_SERVERWORKS is not set
+# CONFIG_PATA_PDC2027X is not set
+# CONFIG_PATA_SIL680 is not set
+# CONFIG_PATA_SIS is not set
+# CONFIG_PATA_VIA is not set
+# CONFIG_PATA_WINBOND is not set
+# CONFIG_MD is not set
+# CONFIG_FUSION is not set
+
+#
+# IEEE 1394 (FireWire) support
+#
+# CONFIG_FIREWIRE is not set
+# CONFIG_IEEE1394 is not set
+# CONFIG_I2O is not set
+CONFIG_MACINTOSH_DRIVERS=y
+# CONFIG_MAC_EMUMOUSEBTN is not set
+# CONFIG_WINDFARM is not set
+CONFIG_NETDEVICES=y
+# CONFIG_NETDEVICES_MULTIQUEUE is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_VETH is not set
+# CONFIG_IP1000 is not set
+# CONFIG_ARCNET is not set
+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
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_FIXED_PHY is not set
+# CONFIG_MDIO_BITBANG is not set
+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
+# CONFIG_NET_TULIP is not set
+# CONFIG_HP100 is not set
+# CONFIG_IBM_NEW_EMAC_ZMII is not set
+# CONFIG_IBM_NEW_EMAC_RGMII is not set
+# CONFIG_IBM_NEW_EMAC_TAH is not set
+# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_AMD8111_ETH is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_B44 is not set
+# CONFIG_FORCEDETH is not set
+# CONFIG_EEPRO100 is not set
+CONFIG_E100=y
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+CONFIG_8139TOO=y
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_OLD_RX_RESET is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_SC92031 is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+CONFIG_E1000=y
+# CONFIG_E1000_NAPI is not set
+# CONFIG_E1000_DISABLE_PACKET_SPLIT is not set
+# CONFIG_E1000E 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_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+CONFIG_MV643XX_ETH=y
+# CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
+CONFIG_NETDEV_10000=y
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGBE is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
+# CONFIG_NETXEN_NIC is not set
+# CONFIG_NIU is not set
+# CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 is not set
+
+#
+# USB Network Adapters
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+# 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_NET_FC 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
+# CONFIG_ISDN is not set
+# CONFIG_PHONE is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV 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_TABLET 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=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_MPSC=y
+CONFIG_SERIAL_MPSC_CONSOLE=y
+# CONFIG_SERIAL_UARTLITE is not set
+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
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_NVRAM is not set
+CONFIG_GEN_RTC=y
+# CONFIG_GEN_RTC_X is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+CONFIG_DEVPORT=y
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_CHARDEV=y
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_ALI1535 is not set
+# CONFIG_I2C_ALI1563 is not set
+# CONFIG_I2C_ALI15X3 is not set
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+# CONFIG_I2C_I801 is not set
+# CONFIG_I2C_I810 is not set
+# CONFIG_I2C_PIIX4 is not set
+# CONFIG_I2C_MPC is not set
+# CONFIG_I2C_NFORCE2 is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_PROSAVAGE is not set
+# CONFIG_I2C_SAVAGE4 is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_SIS5595 is not set
+# CONFIG_I2C_SIS630 is not set
+# CONFIG_I2C_SIS96X is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+# CONFIG_I2C_VIA is not set
+# CONFIG_I2C_VIAPRO is not set
+# CONFIG_I2C_VOODOO3 is not set
+CONFIG_I2C_MV64XXX=y
+
+#
+# Miscellaneous I2C Chip support
+#
+# CONFIG_SENSORS_DS1337 is not set
+# CONFIG_SENSORS_DS1374 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_SENSORS_EEPROM is not set
+# CONFIG_SENSORS_PCF8574 is not set
+# CONFIG_SENSORS_PCA9539 is not set
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_M41T00 is not set
+# CONFIG_SENSORS_MAX6875 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# SPI support
+#
+# CONFIG_SPI is not set
+# CONFIG_SPI_MASTER is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_SUPPLY is not set
+CONFIG_HWMON=y
+# CONFIG_HWMON_VID is not set
+# CONFIG_SENSORS_AD7418 is not set
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1026 is not set
+# CONFIG_SENSORS_ADM1029 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ADM9240 is not set
+# CONFIG_SENSORS_ADT7470 is not set
+# CONFIG_SENSORS_ATXP1 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_I5K_AMB is not set
+# CONFIG_SENSORS_F71805F is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_GL520SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM63 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM87 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_LM92 is not set
+# CONFIG_SENSORS_LM93 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_MAX6650 is not set
+# CONFIG_SENSORS_PC87360 is not set
+# CONFIG_SENSORS_PC87427 is not set
+# CONFIG_SENSORS_SIS5595 is not set
+# CONFIG_SENSORS_DME1737 is not set
+# CONFIG_SENSORS_SMSC47M1 is not set
+# CONFIG_SENSORS_SMSC47M192 is not set
+# CONFIG_SENSORS_SMSC47B397 is not set
+# CONFIG_SENSORS_THMC50 is not set
+# CONFIG_SENSORS_VIA686A is not set
+# CONFIG_SENSORS_VT1211 is not set
+# CONFIG_SENSORS_VT8231 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83791D is not set
+# CONFIG_SENSORS_W83792D is not set
+# CONFIG_SENSORS_W83793 is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+# CONFIG_SENSORS_W83627EHF is not set
+# CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_SM501 is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+# CONFIG_DVB_CORE is not set
+# CONFIG_DAB is not set
+
+#
+# Graphics support
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=y
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Console display driver support
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_VGACON_SOFT_SCROLLBACK is not set
+CONFIG_DUMMY_CONSOLE=y
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+CONFIG_HID_SUPPORT=y
+CONFIG_HID=y
+# CONFIG_HID_DEBUG is not set
+# CONFIG_HIDRAW is not set
+
+#
+# USB Input Devices
+#
+CONFIG_USB_HID=y
+# CONFIG_USB_HIDINPUT_POWERBOOK is not set
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB_ARCH_HAS_OHCI=y
+CONFIG_USB_ARCH_HAS_EHCI=y
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_DEVICE_CLASS is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+
+#
+# USB Host Controller Drivers
+#
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_SPLIT_ISO is not set
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+# CONFIG_USB_EHCI_TT_NEWSCHED is not set
+# CONFIG_USB_ISP116X_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+# CONFIG_USB_OHCI_HCD_PPC_OF is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
+# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_UHCI_HCD is not set
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+
+#
+# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
+#
+
+#
+# may also be needed; see USB_STORAGE Help for more information
+#
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_LIBUSUAL is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+CONFIG_USB_MON=y
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_BERRY_CHARGE is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGET is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+
+#
+# USB DSL modem support
+#
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+# CONFIG_MMC is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+CONFIG_RTC_DRV_DS1307=y
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+
+#
+# SPI RTC drivers
+#
+
+#
+# Platform RTC drivers
+#
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+
+#
+# on-CPU RTC drivers
+#
+
+#
+# Userspace I/O
+#
+# CONFIG_UIO 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_EXT4DEV_FS is not set
+CONFIG_JBD=y
+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_GFS2_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_INOTIFY_USER=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_PROC_SYSCTL=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_HUGETLB_PAGE is not set
+# 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_JFFS2_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
+CONFIG_NETWORK_FILESYSTEMS=y
+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_SUNRPC_BIND34 is not set
+# 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
+
+#
+# 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=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL 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
+# CONFIG_SYSV68_PARTITION is not set
+# CONFIG_NLS is not set
+# CONFIG_DLM is not set
+# CONFIG_UCC_SLOW is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+# CONFIG_CRC_CCITT is not set
+# CONFIG_CRC16 is not set
+# CONFIG_CRC_ITU_T is not set
+CONFIG_CRC32=y
+# CONFIG_CRC7 is not set
+# CONFIG_LIBCRC32C is not set
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+# CONFIG_INSTRUMENTATION is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
+CONFIG_ENABLE_MUST_CHECK=y
+# CONFIG_MAGIC_SYSRQ is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_KERNEL is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_SAMPLES is not set
+# CONFIG_BOOTX_TEXT is not set
+# CONFIG_PPC_EARLY_DEBUG is not set
+
+#
+# Security options
+#
+# CONFIG_KEYS is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
+# CONFIG_CRYPTO is not set
+# CONFIG_PPC_CLOCK is not set
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index 8924095..7e0d9ec 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -46,6 +46,16 @@ config PPC_PRPMC2800
 	help
 	  This option enables support for the Motorola PrPMC2800 board
 
+config PPC_KATANA750I
+	bool "Emerson-Katana750i"
+	depends on EMBEDDED6xx
+	select MV64X60
+	select NOT_COHERENT_CACHE
+	select WANT_DEVICE_TREE
+	help
+	  This option enables support for the Emerson Katana-750i and
+	  Katana-752i platforms.
+
 config TSI108_BRIDGE
 	bool
 	depends on MPC7448HPC2 || PPC_HOLLY
diff --git a/arch/powerpc/platforms/embedded6xx/Makefile b/arch/powerpc/platforms/embedded6xx/Makefile
index 844947c..6ede1de 100644
--- a/arch/powerpc/platforms/embedded6xx/Makefile
+++ b/arch/powerpc/platforms/embedded6xx/Makefile
@@ -5,3 +5,4 @@ obj-$(CONFIG_MPC7448HPC2)	+= mpc7448_hpc2.o
 obj-$(CONFIG_LINKSTATION)	+= linkstation.o ls_uart.o
 obj-$(CONFIG_PPC_HOLLY)		+= holly.o
 obj-$(CONFIG_PPC_PRPMC2800)	+= prpmc2800.o
+obj-$(CONFIG_PPC_KATANA750I)	+= katana750i.o
diff --git a/arch/powerpc/platforms/embedded6xx/katana750i.c b/arch/powerpc/platforms/embedded6xx/katana750i.c
new file mode 100644
index 0000000..bc8eee2
--- /dev/null
+++ b/arch/powerpc/platforms/embedded6xx/katana750i.c
@@ -0,0 +1,314 @@
+/*
+ * Board setup routines for the Emerson Katana-750i/752i
+ *
+ * Author: Mark A. Greer <mgreer@mvista.com>
+ *
+ * Based on code prpmc2800.c by Dale Farnsworth <dale@farnsworth.org>
+ * and original katana port by Tim Montgomery <timm@artesyncp.com>
+ *
+ * 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/stddef.h>
+#include <linux/kernel.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/i2c.h>
+#include <linux/seq_file.h>
+#include <linux/of_platform.h>
+
+#include <asm/machdep.h>
+#include <asm/prom.h>
+#include <asm/system.h>
+#include <asm/time.h>
+#include <asm/pci-bridge.h>
+#include <asm/kexec.h>
+
+#include <mm/mmu_decl.h>
+
+#include <sysdev/mv64x60.h>
+
+#define MV64X60_MPP_CNTL_0		0x0000
+#define MV64X60_MPP_CNTL_2		0x0008
+
+#define MV64X60_GPP_IO_CNTL		0x0000
+#define MV64X60_GPP_LEVEL_CNTL		0x0010
+#define MV64X60_GPP_VALUE_SET		0x0018
+
+#define MV64X60_PCICFG_CPCI_HOTSWAP	0x0068
+#define MV64X60_PCICFG_CPCI_HOTSWAP_LOO	(1 << 19)
+
+#define CPLD_RST_CMD			0x00001000
+#define CPLD_RST_CMD_HR			0x01
+#define CPLD_PRODUCT_ID			0x00004000
+#define CPLD_HARDWARE_VER		0x00007000
+#define CPLD_PLD_VER			0x00008000
+#define CPLD_RESET_OUT			0x0000e000
+#define CPLD_RESET_OUT_PORTSEL		0x80
+
+#define HSL_PLD_BASE			0x00010000
+#define HSL_PLD_HOT_SWAP_OFF		6
+#define HSL_PLD_HOT_SWAP_LED_BIT	0x1
+
+#define PLATFORM_NAME_MAX		32
+
+typedef enum {
+	LED_OFF,
+	LED_ON,
+} led_cmd;
+
+typedef enum { /* Type of Katana board */
+	KATANA750I_BD_TYPE_750I,
+	KATANA750I_BD_TYPE_752I,
+} bd_type;
+
+static bd_type board_type;
+
+static char katana750i_platform_name[PLATFORM_NAME_MAX];
+
+static void __iomem *mv64x60_mpp_reg_base;
+static void __iomem *mv64x60_gpp_reg_base;
+static void __iomem *cpld_base;
+
+
+static void katana750i_set_led(led_cmd cmd)
+{
+	/* Turn on blue LED to indicate its okay to remove */
+	if (board_type == KATANA750I_BD_TYPE_750I) {
+		struct pci_controller *hose;
+		u32 hs;
+
+		hose = mv64x60_find_hose(0);
+		if (!hose)
+			return;
+
+		early_read_config_dword(hose, 0, PCI_DEVFN(0, 0),
+			MV64X60_PCICFG_CPCI_HOTSWAP, &hs);
+
+		if (cmd == LED_ON)
+			hs |= MV64X60_PCICFG_CPCI_HOTSWAP_LOO;
+		else
+			hs &= ~MV64X60_PCICFG_CPCI_HOTSWAP_LOO;
+
+		early_write_config_dword(hose, 0, PCI_DEVFN(0, 0),
+			MV64X60_PCICFG_CPCI_HOTSWAP, hs);
+	} else if (board_type == KATANA750I_BD_TYPE_752I) {
+		u8 v;
+
+		v = in_8(cpld_base + HSL_PLD_BASE + HSL_PLD_HOT_SWAP_OFF);
+
+		if (cmd == LED_ON)
+			v |= HSL_PLD_HOT_SWAP_LED_BIT;
+		else
+			v &= ~HSL_PLD_HOT_SWAP_LED_BIT;
+
+		out_8(cpld_base + HSL_PLD_BASE + HSL_PLD_HOT_SWAP_OFF, v);
+	}
+}
+
+static void __init katana750i_clear_hotswap_events(void)
+{
+	struct pci_controller *hose;
+	u32 hs;
+
+	hose = mv64x60_find_hose(0);
+	if (!hose)
+		return;
+
+	/* Mask ENUM#, clear insertion & extraction bits. */
+	early_read_config_dword(hose, 0, PCI_DEVFN(0, 0),
+		MV64X60_PCICFG_CPCI_HOTSWAP, &hs);
+	hs |= ((1 << 17) | (1 << 22) | (1 << 23));
+	early_write_config_dword(hose, 0, PCI_DEVFN(0, 0),
+		MV64X60_PCICFG_CPCI_HOTSWAP, hs);
+}
+
+static void __init katana750i_enable_ipmi(void)
+{
+	u8 reset_out;
+
+	/* Enable access to IPMI ctlr by clearing IPMI PORTSEL bit in CPLD */
+	reset_out = in_8(cpld_base + CPLD_RESET_OUT);
+	reset_out &= ~CPLD_RESET_OUT_PORTSEL;
+	out_8(cpld_base + CPLD_RESET_OUT, reset_out);
+}
+
+static void __init katana750i_setup_arch(void)
+{
+	struct device_node *np;
+	phys_addr_t paddr;
+	const unsigned int *reg;
+
+	/*
+	 * ioremap mpp and gpp registers in case they are later
+	 * needed by katana750i_reset_board().
+	 */
+	np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-mpp");
+	reg = of_get_property(np, "reg", NULL);
+	paddr = of_translate_address(np, reg);
+	of_node_put(np);
+	mv64x60_mpp_reg_base = ioremap(paddr, reg[1]);
+
+	np = of_find_compatible_node(NULL, NULL, "marvell,mv64360-gpp");
+	reg = of_get_property(np, "reg", NULL);
+	paddr = of_translate_address(np, reg);
+	of_node_put(np);
+	mv64x60_gpp_reg_base = ioremap(paddr, reg[1]);
+
+#ifdef CONFIG_PCI
+	mv64x60_pci_init();
+#endif
+
+	np = of_find_compatible_node(NULL, NULL, "katana750i,cpld");
+	reg = of_get_property(np, "reg", NULL);
+	paddr = of_translate_address(np, reg);
+	of_node_put(np);
+	cpld_base = ioremap(paddr, reg[1]);
+
+	katana750i_enable_ipmi();
+	katana750i_clear_hotswap_events();
+	katana750i_set_led(LED_OFF);
+
+	printk("Emerson %s\n", katana750i_platform_name);
+}
+
+struct __initdata i2c_board_info i2c_info;
+
+static int __init katana750i_register_rtc(void)
+{
+	struct device_node *np;
+	const u32 *addr;
+	int len;
+
+	np = of_find_compatible_node(NULL, NULL, "dallas,ds1307");
+	if (np) {
+		addr = of_get_property(np, "reg", &len);
+		if (!addr || (len != sizeof(len))) {
+			printk(KERN_WARNING "Invalid I2C/RTC DT entry\n");
+			goto exit;
+		}
+
+		i2c_info.irq = irq_of_parse_and_map(np, 0);
+		if (i2c_info.irq == NO_IRQ)
+			i2c_info.irq = -1;
+
+		i2c_info.addr = *addr;
+		strlcpy(i2c_info.driver_name, "rtc-ds1307", KOBJ_NAME_LEN);
+		strlcpy(i2c_info.type, "ds1307", I2C_NAME_SIZE);
+
+		i2c_register_board_info(0, &i2c_info, 1);
+	}
+
+exit:
+	of_node_put(np);
+	return 0;
+}
+arch_initcall(katana750i_register_rtc);
+
+static int __init katana750i_register_mtd(void)
+{
+	struct device_node *np;
+
+	for_each_compatible_node(np, NULL, "cfi-flash")
+		of_platform_device_create(np, NULL, NULL);
+
+	return 0;
+}
+device_initcall(katana750i_register_mtd);
+
+static void __init katana750i_fixup_resources(struct pci_dev *dev)
+{
+	u16 v16;
+
+	pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, L1_CACHE_BYTES >> 2);
+
+	pci_read_config_word(dev, PCI_COMMAND, &v16);
+	v16 |= PCI_COMMAND_INVALIDATE | PCI_COMMAND_FAST_BACK;
+	pci_write_config_word(dev, PCI_COMMAND, v16);
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_MV64360,
+		katana750i_fixup_resources);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MARVELL, PCI_DEVICE_ID_MARVELL_MV64460,
+		katana750i_fixup_resources);
+
+static void katana750i_restart(char *cmd)
+{
+	ulong	i = 10000000;
+
+	katana750i_set_led(LED_ON);
+
+	/* issue hard reset to the reset command register */
+	out_8(cpld_base + CPLD_RST_CMD, CPLD_RST_CMD_HR);
+	while (i-- > 0) ;
+}
+
+static void katana750i_halt(void)
+{
+	katana750i_set_led(LED_ON);
+}
+
+#ifdef CONFIG_NOT_COHERENT_CACHE
+#define KATANA750I_COHERENCY_SETTING "off"
+#else
+#define KATANA750I_COHERENCY_SETTING "on"
+#endif
+
+void katana750i_show_cpuinfo(struct seq_file *m)
+{
+	seq_printf(m, "Vendor\t\t: Emerson\n");
+	seq_printf(m, "product id\t: 0x%x\n",
+			in_8(cpld_base + CPLD_PRODUCT_ID));
+	seq_printf(m, "hardware rev\t: 0x%x\n",
+			in_8(cpld_base + CPLD_HARDWARE_VER));
+	seq_printf(m, "pld rev\t\t: 0x%x\n",
+			in_8(cpld_base + CPLD_PLD_VER));
+	seq_printf(m, "coherency\t: %s\n", KATANA750I_COHERENCY_SETTING);
+}
+
+/*
+ * Called very early, device-tree isn't unflattened
+ */
+static int __init katana750i_probe(void)
+{
+	unsigned long root = of_get_flat_dt_root();
+	unsigned long len = PLATFORM_NAME_MAX;
+	void *m;
+
+	if (!of_flat_dt_is_compatible(root, "emerson,katana-750i"))
+		return 0;
+
+	/* Update ppc_md.name with name from dt */
+	m = of_get_flat_dt_prop(root, "model", &len);
+	if (m)
+		strncpy(katana750i_platform_name, m,
+			min((int)len, PLATFORM_NAME_MAX - 1));
+
+	board_type = KATANA750I_BD_TYPE_750I;
+	if (!strncmp(m, "Katana-752i", PLATFORM_NAME_MAX))
+		board_type = KATANA750I_BD_TYPE_752I;
+
+	_set_L2CR(_get_L2CR() | L2CR_L2E | L2CR_L2PE);
+	return 1;
+}
+
+define_machine(katana750i){
+	.name			= katana750i_platform_name,
+	.probe			= katana750i_probe,
+	.setup_arch		= katana750i_setup_arch,
+	.init_early		= mv64x60_init_early,
+	.show_cpuinfo		= katana750i_show_cpuinfo,
+	.init_IRQ		= mv64x60_init_irq,
+	.get_irq		= mv64x60_get_irq,
+	.restart		= katana750i_restart,
+	.halt			= katana750i_halt,
+	.power_off		= katana750i_halt,
+	.calibrate_decr		= generic_calibrate_decr,
+#ifdef CONFIG_KEXEC
+	.machine_kexec		= default_machine_kexec,
+	.machine_kexec_prepare	= default_machine_kexec_prepare,
+	.machine_crash_shutdown	= default_machine_crash_shutdown,
+#endif
+};

^ permalink raw reply related

* [PATCH 3/4] powerpc: Katana750i - Add DTS file
From: Mark A. Greer @ 2008-01-14 22:59 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: linuxppc-dev
In-Reply-To: <20080114225150.GB21940@mag.az.mvista.com>

From: Mark A. Greer <mgreer@mvista.com>

Add DTS file for the Emerson Katana 750i & 752i platforms.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
 arch/powerpc/boot/dts/katana750i.dts |  372 +++++++++++++++++++++++++
 1 file changed, 372 insertions(+)

diff --git a/arch/powerpc/boot/dts/katana750i.dts b/arch/powerpc/boot/dts/katana750i.dts
new file mode 100644
index 0000000..03d9fd1
--- /dev/null
+++ b/arch/powerpc/boot/dts/katana750i.dts
@@ -0,0 +1,372 @@
+/* Device Tree Source for Emerson Katana 750i/752i
+ *
+ * Author: Mark A. Greer <mgreer@mvista.com>
+ *
+ * 2007 (c) MontaVista, Software, Inc.  This file is licensed under
+ * the terms of the GNU General Public License version 2.  This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ *
+ * Property values that are labeled as "Default" will be updated by bootwrapper
+ * if it can determine the exact PrPMC type.
+ */
+
+/dts-v1/;
+
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	model = "Katana-75xi";	/* Default */
+	compatible = "emerson,katana-750i";
+	coherency-off;
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		PowerPC,750 {
+			device_type = "cpu";
+			reg = <0>;
+			clock-frequency = <733333333>;		/* Default */
+			bus-frequency = <133333333>;		/* Default */
+			timebase-frequency = <33333333>;	/* Default */
+			i-cache-line-size = <0x20>;
+			d-cache-line-size = <0x20>;
+			i-cache-size = <0x8000>;
+			d-cache-size = <0x8000>;
+		};
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x04000000>;	/* Default (64MB) */
+	};
+
+	mv64x60@f8100000 { /* Marvell Discovery */
+		#address-cells = <1>;
+		#size-cells = <1>;
+		model = "mv64360";	/* Default */
+		compatible = "marvell,mv64360";
+		clock-frequency = <133333333>;
+		hs_reg_valid;
+		reg = <0xf8100000 0x00010000>;
+		virtual-reg = <0xf8100000>;
+		ranges = <0xb0000000 0xb0000000 0x04000000 /* PCI 1 I/O Space */
+			  0x80000000 0x80000000 0x30000000 /* PCI 1 MEM Space */
+			  0xe8000000 0xe8000000 0x10000000 /* User FLASH */
+			  0x00000000 0xf8100000 0x00010000 /* Bridge's regs */
+			  0xf8080000 0xf8080000 0x00010000 /* PCI 0 I/O Space */
+			  0xf8090000 0xf8090000 0x00010000 /* PCI 0 MEM Space */
+			  0xf8200000 0xf8200000 0x00200000 /* CPLD & HSL Regs */
+			  0xf8300000 0xf8300000 0x00040000>;/* Integrated SRAM*/
+
+		cpld@f8200000 {
+			compatible = "katana750i,cpld";
+			reg = <0xf8200000 0x00200000>;
+			virtual-reg = <0xf8200000>;
+		};
+
+		flash@e8000000 {
+			#address-cells = <1>;
+			#size-cells = <1>;
+			compatible = "cfi-flash";
+			bank-width = <4>;
+			device-width = <2>;
+			reg = <0xe8000000 0x04000000>;
+			monitor@0 {
+				label = "Monitor";
+				reg = <0x00000000 0x00100000>;
+			};
+			pkernel@100000 {
+				label = "Primary Kernel";
+				reg = <0x00100000 0x00180000>;
+			};
+			pfs@280000 {
+				label = "Primary Filesystem";
+				reg = <0x00280000 0x01e00000>;
+			};
+			skernel@2080000 {
+				label = "Secondary Kernel";
+				reg = <0x02080000 0x00180000>;
+			};
+			sfs@2200000 {
+				label = "Secondary Filesystem";
+				reg = <0x02200000 0x01e00000>;
+			};
+			user@100000 { /* overlay all but monitor */
+				label = "User FLASH";
+				reg = <0x00100000 0x03f00000>;
+			};
+		};
+
+		mdio {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			device_type = "mdio";
+			compatible = "marvell,mv64360-mdio";
+			PHY0: ethernet-phy@12 {
+				device_type = "ethernet-phy";
+				compatible = "broadcom,bcm5461";
+				reg = <12>;
+			};
+			PHY1: ethernet-phy@11 {
+				device_type = "ethernet-phy";
+				compatible = "broadcom,bcm5461";
+				reg = <11>;
+			};
+			PHY2: ethernet-phy@4 {
+				device_type = "ethernet-phy";
+				compatible = "broadcom,bcm5461";
+				reg = <4>;
+			};
+		};
+
+		multiethernet@2000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x2000 0x2000>;
+			ethernet@0 {
+				device_type = "network";
+				compatible = "marvell,mv64360-eth";
+				reg = <0>;
+				interrupts = <32>;
+				interrupt-parent = <&PIC>;
+				phy = <&PHY0>;
+				local-mac-address = [ 00 00 00 00 00 00 ];
+			};
+			ethernet@1 {
+				device_type = "network";
+				compatible = "marvell,mv64360-eth";
+				reg = <1>;
+				interrupts = <33>;
+				interrupt-parent = <&PIC>;
+				phy = <&PHY1>;
+				local-mac-address = [ 00 00 00 00 00 00 ];
+			};
+			ethernet@2 {
+				device_type = "network";
+				compatible = "marvell,mv64360-eth";
+				reg = <2>;
+				interrupts = <34>;
+				interrupt-parent = <&PIC>;
+				phy = <&PHY2>;
+				local-mac-address = [ 00 00 00 00 00 00 ];
+			};
+		};
+
+		SDMA0: sdma@4000 {
+			compatible = "marvell,mv64360-sdma";
+			reg = <0x4000 0xc18>;
+			virtual-reg = <0xf8104000>;
+			interrupt-base = <0>;
+			interrupts = <36>;
+			interrupt-parent = <&PIC>;
+		};
+
+		SDMA1: sdma@6000 {
+			compatible = "marvell,mv64360-sdma";
+			reg = <0x6000 0xc18>;
+			virtual-reg = <0xf8106000>;
+			interrupt-base = <0>;
+			interrupts = <38>;
+			interrupt-parent = <&PIC>;
+		};
+
+		BRG0: brg@b200 {
+			compatible = "marvell,mv64360-brg";
+			reg = <0xb200 0x8>;
+			clock-src = <8>;
+			clock-frequency = <133333333>;
+			current-speed = <9600>;
+			bcr = <0>;
+		};
+
+		BRG1: brg@b208 {
+			compatible = "marvell,mv64360-brg";
+			reg = <0xb208 0x8>;
+			clock-src = <8>;
+			clock-frequency = <133333333>;
+			current-speed = <9600>;
+			bcr = <0>;
+		};
+
+		CUNIT: cunit@f200 {
+			reg = <0xf200 0x200>;
+		};
+
+		MPSCROUTING: mpscrouting@b400 {
+			reg = <0xb400 0xc>;
+		};
+
+		MPSCINTR: mpscintr@b800 {
+			reg = <0xb800 0x100>;
+			virtual-reg = <0xf810b800>;
+		};
+
+		mpsc@8000 {
+			device_type = "serial";
+			compatible = "marvell,mv64360-mpsc";
+			reg = <0x8000 0x38>;
+			virtual-reg = <0xf8108000>;
+			sdma = <&SDMA0>;
+			brg = <&BRG0>;
+			cunit = <&CUNIT>;
+			mpscrouting = <&MPSCROUTING>;
+			mpscintr = <&MPSCINTR>;
+			cell-index = <0>;
+			max_idle = <40>;
+			chr_1 = <0>;
+			chr_2 = <0>;
+			chr_10 = <3>;
+			mpcr = <0>;
+			interrupts = <40>;
+			interrupt-parent = <&PIC>;
+		};
+
+		mpsc@9000 {
+			device_type = "serial";
+			compatible = "marvell,mv64360-mpsc";
+			reg = <0x9000 0x38>;
+			virtual-reg = <0xf8109000>;
+			sdma = <&SDMA1>;
+			brg = <&BRG1>;
+			cunit = <&CUNIT>;
+			mpscrouting = <&MPSCROUTING>;
+			mpscintr = <&MPSCINTR>;
+			cell-index = <1>;
+			max_idle = <40>;
+			chr_1 = <0>;
+			chr_2 = <0>;
+			chr_10 = <3>;
+			mpcr = <0>;
+			interrupts = <42>;
+			interrupt-parent = <&PIC>;
+		};
+
+		wdt@b410 {			/* watchdog timer */
+			compatible = "marvell,mv64360-wdt";
+			reg = <0xb410 0x8>;
+		};
+
+		i2c@c000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			device_type = "i2c";
+			compatible = "marvell,mv64360-i2c";
+			reg = <0xc000 0x20>;
+			virtual-reg = <0xf810c000>;
+			freq_m = <8>;
+			freq_n = <3>;
+			interrupts = <37>;
+			interrupt-parent = <&PIC>;
+			rtc@68 {
+				compatible = "dallas,ds1307";
+				reg = <0x68>;
+			};
+		};
+
+		PIC: pic {
+			#interrupt-cells = <1>;
+			#address-cells = <0>;
+			compatible = "marvell,mv64360-pic";
+			reg = <0x0000 0x88>;
+			interrupt-controller;
+		};
+
+		mpp@f000 {
+			compatible = "marvell,mv64360-mpp";
+			reg = <0xf000 0x10>;
+		};
+
+		gpp@f100 {
+			compatible = "marvell,mv64360-gpp";
+			reg = <0xf100 0x20>;
+		};
+
+		pci@80000000 {
+			#address-cells = <3>;
+			#size-cells = <2>;
+			#interrupt-cells = <1>;
+			device_type = "pci";
+			compatible = "marvell,mv64360-pci";
+			cell-index = <1>;
+			reg = <0x0c78 0x8>;
+			ranges = <0x01000000 0x0 0x0
+					0xb0000000 0x0 0x04000000
+				  0x02000000 0x0 0x80000000
+					0x80000000 0x0 0x30000000>;
+			bus-range = <0x0 0xff>;
+			clock-frequency = <66000000>;
+			interrupt-pci-iack = <0x0cb4>;
+			interrupt-parent = <&PIC>;
+			interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
+			interrupt-map = <
+				/* IDSEL 0x04 - PMC 1 */
+				0x2000 0 0 1 &PIC 73
+				0x2000 0 0 2 &PIC 74
+				0x2000 0 0 3 &PIC 78
+				0x2000 0 0 4 &PIC 72
+
+				/* IDSEL 0x05 - PMC 2 */
+				0x2800 0 0 1 &PIC 74
+				0x2800 0 0 2 &PIC 78
+				0x2800 0 0 3 &PIC 72
+				0x2800 0 0 4 &PIC 73
+
+				/* IDSEL 0x06 - T8110 */
+				0x3000 0 0 1 &PIC 78
+
+				/* IDSEL 0x08 - i82544 */
+				0x4000 0 0 1 &PIC 78
+			>;
+		};
+
+		pci@f8080000 { /* Required to acces Hotswap register */
+			#address-cells = <3>;
+			#size-cells = <2>;
+			#interrupt-cells = <1>;
+			device_type = "pci";
+			compatible = "marvell,mv64360-pci";
+			cell-index = <0>;
+			reg = <0x0cf8 0x8>;
+			ranges = <0x01000000 0x0 0x0
+					0xf8080000 0x0 0x00010000
+				  0x02000000 0x0 0xf8090000
+					0xf8090000 0x0 0x00010000>;
+			bus-range = <0x0 0xff>;
+		};
+
+		cpu-error@70 {
+			compatible = "marvell,mv64360-cpu-error";
+			reg = <0x0070 0x10 0x0128 0x28>;
+			interrupts = <3>;
+			interrupt-parent = <&PIC>;
+		};
+
+		sram-ctrl@380 {
+			compatible = "marvell,mv64360-sram-ctrl";
+			reg = <0x0380 0x80>;
+			interrupts = <13>;
+			interrupt-parent = <&PIC>;
+		};
+
+		pci-error@1d40 {
+			compatible = "marvell,mv64360-pci-error";
+			reg = <0x1d40 0x40 0x0c28 0x4>;
+			interrupts = <12>;
+			interrupt-parent = <&PIC>;
+		};
+
+		mem-ctrl@1400 {
+			compatible = "marvell,mv64360-mem-ctrl";
+			reg = <0x1400 0x60>;
+			interrupts = <17>;
+			interrupt-parent = <&PIC>;
+		};
+	};
+
+	chosen {
+		bootargs = "ip=on";
+		linux,stdout-path = "/mv64x60@f8100000/mpsc@8000";
+	};
+};

^ permalink raw reply related

* [PATCH 2/4] powerpc: mv64x60 - Exit when no hs_reg_valid property
From: Mark A. Greer @ 2008-01-14 22:58 UTC (permalink / raw)
  To: Mark A. Greer; +Cc: linuxppc-dev
In-Reply-To: <20080114225150.GB21940@mag.az.mvista.com>

From: Mark A. Greer <mgreer@mvista.com>

mv64x60_sysfs_init() should exit as soon as it discovers there is no
'hs_reg_valid' property in the Device Tree.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
 arch/powerpc/sysdev/mv64x60_pci.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
index 2115177..7cc1abf 100644
--- a/arch/powerpc/sysdev/mv64x60_pci.c
+++ b/arch/powerpc/sysdev/mv64x60_pci.c
@@ -97,6 +97,8 @@ static int __init mv64x60_sysfs_init(void)
 
 	prop = of_get_property(np, "hs_reg_valid", NULL);
 	of_node_put(np);
+	if (!prop)
+		return 0;
 
 	pdev = platform_device_register_simple("marvell,mv64360", 0, NULL, 0);
 	if (IS_ERR(pdev))

^ permalink raw reply related

* Re: [DTC PATCH] libfdt: Add ft_get_next_node(), ft_get_next_prop(), and ft_getprop_offset().
From: Stephen Rothwell @ 2008-01-14 22:54 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, jdl
In-Reply-To: <478BE5D1.9080300@freescale.com>

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

On Mon, 14 Jan 2008 16:44:33 -0600 Scott Wood <scottwood@freescale.com> wrote:
>
> Stephen Rothwell wrote:
> >> +++ b/libfdt/libfdt.h
> > 
> >> +#define FDT_ERR_BADDEPTH	8
> > 
> > Wouldn't it have been less intrusive to just use the next error number
> > rather than inserting this here?
> 
> Yes, but then either the order in errtable[] wouldn't match the order in 
> the header file, or the error type grouping would be broken.
> 
> If we want to maintain such a grouping, we should probably leave some 
> number space between the groups.

OK.

> "pointer to a string" could be interpreted as "char *", not "char **".

Yeah, it has always been a bit ambiguous.

> I'll fix the others; thanks for pointing them out.

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

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

^ permalink raw reply

* [PATCH 1/4] powerpc: mv64x60 - Use early_* PCI accessors for hotswap reg
From: Mark A. Greer @ 2008-01-14 22:51 UTC (permalink / raw)
  To: linuxppc-dev

From: Mark A. Greer <mgreer@mvista.com>

The mv64x60 Hotswap register is on the first hose of the mv64x60
hostbridge.  To access it, manually find the hose structure and
use the early_* PCI accessor routines because the hostbridge is
normally hidden.

Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
 arch/powerpc/sysdev/mv64x60.h     |   22 ++++++++++++++++++++++
 arch/powerpc/sysdev/mv64x60_pci.c |   25 +++++++++++++++----------
 2 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/sysdev/mv64x60.h b/arch/powerpc/sysdev/mv64x60.h
index 4f618fa..27e22f4 100644
--- a/arch/powerpc/sysdev/mv64x60.h
+++ b/arch/powerpc/sysdev/mv64x60.h
@@ -3,10 +3,32 @@
 
 #include <linux/init.h>
 
+#include <asm/prom.h>
+#include <asm/pci-bridge.h>
+
 extern void __init mv64x60_init_irq(void);
 extern unsigned int mv64x60_get_irq(void);
 
 extern void __init mv64x60_pci_init(void);
 extern void __init mv64x60_init_early(void);
 
+static inline struct pci_controller *mv64x60_find_hose(u32 idx)
+{
+	struct device_node *phb;
+	struct pci_controller *hose;
+	const u32 *prop;
+	int len;
+
+	for_each_compatible_node(phb, "pci", "marvell,mv64360-pci") {
+		prop = of_get_property(phb, "cell-index", &len);
+		if (prop && (len == sizeof(prop)) && (*prop == idx)) {
+			hose = pci_find_hose_for_OF_device(phb);
+			of_node_put(phb);
+			return hose;
+		}
+	}
+
+	return NULL;
+}
+
 #endif /* __MV64X60_H__ */
diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
index 1456015..2115177 100644
--- a/arch/powerpc/sysdev/mv64x60_pci.c
+++ b/arch/powerpc/sysdev/mv64x60_pci.c
@@ -17,6 +17,8 @@
 #include <asm/prom.h>
 #include <asm/pci-bridge.h>
 
+#include <sysdev/mv64x60.h>
+
 #define PCI_HEADER_TYPE_INVALID		0x7f	/* Invalid PCI header type */
 
 #ifdef CONFIG_SYSFS
@@ -24,11 +26,12 @@
 #define MV64X60_VAL_LEN_MAX		11
 #define MV64X60_PCICFG_CPCI_HOTSWAP	0x68
 
+/* cPCI Hotswap register only supported on PCI 0 interface */
 static ssize_t mv64x60_hs_reg_read(struct kobject *kobj,
 				   struct bin_attribute *attr, char *buf,
 				   loff_t off, size_t count)
 {
-	struct pci_dev *phb;
+	struct pci_controller *hose;
 	u32 v;
 
 	if (off > 0)
@@ -36,11 +39,12 @@ static ssize_t mv64x60_hs_reg_read(struct kobject *kobj,
 	if (count < MV64X60_VAL_LEN_MAX)
 		return -EINVAL;
 
-	phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
-	if (!phb)
+	hose = mv64x60_find_hose(0);
+	if (!hose)
 		return -ENODEV;
-	pci_read_config_dword(phb, MV64X60_PCICFG_CPCI_HOTSWAP, &v);
-	pci_dev_put(phb);
+
+	early_read_config_dword(hose, 0, PCI_DEVFN(0, 0),
+			MV64X60_PCICFG_CPCI_HOTSWAP, &v);
 
 	return sprintf(buf, "0x%08x\n", v);
 }
@@ -49,7 +53,7 @@ static ssize_t mv64x60_hs_reg_write(struct kobject *kobj,
 				    struct bin_attribute *attr, char *buf,
 				    loff_t off, size_t count)
 {
-	struct pci_dev *phb;
+	struct pci_controller *hose;
 	u32 v;
 
 	if (off > 0)
@@ -60,11 +64,12 @@ static ssize_t mv64x60_hs_reg_write(struct kobject *kobj,
 	if (sscanf(buf, "%i", &v) != 1)
 		return -EINVAL;
 
-	phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
-	if (!phb)
+	hose = mv64x60_find_hose(0);
+	if (!hose)
 		return -ENODEV;
-	pci_write_config_dword(phb, MV64X60_PCICFG_CPCI_HOTSWAP, v);
-	pci_dev_put(phb);
+
+	early_write_config_dword(hose, 0, PCI_DEVFN(0, 0),
+			MV64X60_PCICFG_CPCI_HOTSWAP, v);
 
 	return count;
 }

^ permalink raw reply related

* Re: [PATCH 1/3] 8xx: Analogue & Micro Adder875 board support.
From: Scott Wood @ 2008-01-14 22:49 UTC (permalink / raw)
  To: Bryan O'Donoghue; +Cc: linuxppc-dev
In-Reply-To: <1200350407.4061.19.camel@neuromancer.mindspace>

Bryan O'Donoghue wrote:
> Ah.
> 
> This explains eveything then.. there _is_ a magic image and I haven't
> been booting it !
> 
> Typical.
> 
> I'll give the 8xx-centric ucImage a go.

It is not 8xx centric; it is a compatibility layer for old, 
non-device-tree aware u-boots (regardless of what chip you're using).

> It occurs to me that this type of procedure should really be added to
> the Documentation... 
> 
> There's no mention of it in the Linux documentation, nor in the u-boot
> documentation and uncle Google was not informative for the types of
> searches I was doing....

Search for "device tree" in u-boot's README.

-Scott

^ permalink raw reply

* Re: [DTC PATCH] libfdt: Add ft_get_next_node(), ft_get_next_prop(), and ft_getprop_offset().
From: Scott Wood @ 2008-01-14 22:44 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, jdl
In-Reply-To: <20080115093149.39a1d703.sfr@canb.auug.org.au>

Stephen Rothwell wrote:
>> +++ b/libfdt/libfdt.h
> 
>> +#define FDT_ERR_BADDEPTH	8
> 
> Wouldn't it have been less intrusive to just use the next error number
> rather than inserting this here?

Yes, but then either the order in errtable[] wouldn't match the order in 
the header file, or the error type grouping would be broken.

If we want to maintain such a grouping, we should probably leave some 
number space between the groups.

>> + * fdt_getprop_offset - retrieve the value of a given property by offset
>> + * @fdt: pointer to the device tree blob
>> + * @propoffset: offset of the property to read
>> + * @name: pointer to a character pointer (will be overwritten) or NULL
>                           ^^^^^^^^^^^^^^^^^
> "string"?

"pointer to a string" could be interpreted as "char *", not "char **".

I'll fix the others; thanks for pointing them out.

-Scott

^ permalink raw reply

* Re: [PATCH 1/3] 8xx: Analogue & Micro Adder875 board support.
From: Bryan O'Donoghue @ 2008-01-14 22:40 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20080114152859.GA26907@ld0162-tx32.am.freescale.net>

On Mon, 2008-01-14 at 09:28 -0600, Scott Wood wrote:
> On Sun, Jan 13, 2008 at 02:26:12PM +0000, Bryan O'Donoghue wrote:
> > I've applied your code against Linus' git v2.6.26-rc7 as at today.
> > I have to apply 
> 
> It should apply against paulus's tree.
> 
> > make adder87x-uboot_defconfig
> > 
> > make uImage
> 
> make zImage, not uImage.

Will try.

> > cp arch/powerpc/boot/uImage /tftpboot - which is my tftpd root
> > directory.
> 
> Use cuImage.8xx, not uImage.
> 
> > In U-Boot then.
> > 
> > => tftpboot 0x400000 uImage
> > => bootm 0x400000
> 
> 0x400000 is where u-boot is going to want to relocate the image to, so
> loading the uImage there may not work.

Hmm, some old code I did to make Linux boot from the former ppc stuff
works fine to the loading and booting @ 0x4000000 - this step is pretty
much fine, I think.

> Yes, a uImage target will be expecting to be handed a device tree.  The
> cuImage target has a device tree embedded and accepts the old-style bd_t.

Ah.

This explains eveything then.. there _is_ a magic image and I haven't
been booting it !

Typical.

I'll give the 8xx-centric ucImage a go.

> > /* pass open firmware flat tree */
> > #define CONFIG_OF_LIBFDT      1
> > #undef  CONFIG_OF_FLAT_TREE
> > #define CONFIG_OF_BOARD_SETUP 1
> > #define CONFIG_OF_HAS_BD_T    1
> > #define CONFIG_OF_HAS_UBOOT_ENV       1
> > 
> > #define OF_CPU                        "PowerPC,875 at 0"
> > #define OF_SOC                        "soc875 at ff000000"
> > #define OF_TBCLK              (bd->bi_busfreq / 4)
> 
> You'll probably need some 8xx-specific code if you want to go this route. 
> You'd also need to change the bootm command line to the three-argument
> version, with the third argument being the address of the device tree
> blob (the second argument can be - if there's no initrd).

Ah OK, I see so the procedure would be to dtc a dts representing the
Adder.

Download both this and a uImage ... and then as you say pass the address
of the blob to Linux via U-Boot.

It occurs to me that this type of procedure should really be added to
the Documentation... 

There's no mention of it in the Linux documentation, nor in the u-boot
documentation and uncle Google was not informative for the types of
searches I was doing....

Somebody - possibly even me, since I'm mentioning it - should write a
copule of paragraphs on booting a ucImage with a of-blob and add it to
both U-Boot and Linux..

> If you're not comfortable with the device tree stuff, I recommend just
> using cuImage for now.

Indeed.

Thanks for the response Scott. I'll try out the ucImage and all going
well with that will try the three parameter Linux + blob based on
the .dts, hopefully over the next three or four days....

If I'm unlucky I might bug you again... and if I have more luck, I'll do
a follow up on the list.

Happy Monday !

Regards,
Bryan

^ permalink raw reply

* Re: [DTC PATCH] libfdt: Add ft_get_next_node(), ft_get_next_prop(), and ft_getprop_offset().
From: Stephen Rothwell @ 2008-01-14 22:31 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev, jdl
In-Reply-To: <20080114163004.GA27880@ld0162-tx32.am.freescale.net>

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

Hi Scott,

On Mon, 14 Jan 2008 10:30:04 -0600 Scott Wood <scottwood@freescale.com> wrote:
>
> ft_get_next_node() enumerates children of a given node.
> ft_get_next_prop() enumerates propreties of a given node.
                                ^^^^^^^^^^
typo.

> ft_getprop_offset() is like ft_getprop(), but takes a property offset rather
> than a node offset and property name; it is primarily intended for use
> with ft_get_next_prop().

All the "ft_" above should be "fdt_".

> +const void *fdt_getprop_offset(const void *fdt, int propoffset,
> +                               const char **name, int *lenp)
> +{

> +	tag = fdt_next_tag(fdt,propoffset, NULL);
                              ^
space after ','

> +++ b/libfdt/libfdt.h

> +#define FDT_ERR_BADDEPTH	8

Wouldn't it have been less intrusive to just use the next error number
rather than inserting this here?

> + * fdt_getprop_offset - retrieve the value of a given property by offset
> + * @fdt: pointer to the device tree blob
> + * @propoffset: offset of the property to read
> + * @name: pointer to a character pointer (will be overwritten) or NULL
                          ^^^^^^^^^^^^^^^^^
"string"?

> + * @lenp: pointer to an integer variable (will be overwritten) or NULL
> + *
> + * fdt_getprop() retrieves a pointer to the value of the property

fdt_getprop_offset

> + * named 'name' of the node at offset nodeoffset (this will be a
> + * pointer to within the device blob itself, not a copy of the value).
> + * If lenp is non-NULL, the length of the property value also
> + * returned, in the integer pointed to by lenp.
> + *
> + * returns:
> + *	pointer to the property's value

		if name is non-NULL, *name points to ...

> + *		if lenp is non-NULL, *lenp contains the length of the property
> + *		value (>=0)

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

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

^ permalink raw reply

* Re: [PATCH 1/3] drivers/misc :UCC based TDM driver for MPC83xx platforms.
From: Andrew Morton @ 2008-01-14 21:14 UTC (permalink / raw)
  To: Poonam_Aggrwal-b10812
  Cc: kumar.gala, michael.barkowski, netdev, linux-kernel, rubini,
	linuxppc-dev, ashish.kalra, rich.cutler
In-Reply-To: <Pine.LNX.4.64.0712101710270.29623@linux121>

On Mon, 10 Dec 2007 17:34:44 +0530 (IST)
Poonam_Aggrwal-b10812 <b10812@freescale.com> wrote:

> From: Poonam Aggrwal <b10812@freescale.com>
> 
> The UCC TDM driver basically multiplexes and demultiplexes data from 
> different channels. It can interface with for example SLIC kind of devices 
> to receive TDM data  demultiplex it and send to upper applications. At the 
> transmit end it receives data for different channels multiplexes it and 
> sends them on the TDM channel. It internally uses TSA( Time Slot Assigner) 
> which does multiplexing and demultiplexing, UCC to perform SDMA between 
> host buffers and the TSA, CMX to connect TSA to UCC.
> 
> This driver will run on MPC8323E-RDB platforms.
> 
> ...
>
> +#define PREV_PHASE(x) ((x == 0) ? MAX_PHASE : (x - 1))
> +#define NEXT_PHASE(x) (((x + 1) > MAX_PHASE) ? 0 : (x + 1))

These macros can reference their arg more than once and are hence
dangerous.  What does PREV_PHASE(foo++) do to foo?

And, in general: do not implement in cpp that which could have been
implemented in C.

> +static struct ucc_tdm_info utdm_primary_info = {
> +	.uf_info = {
> +		.tsa = 1,
> +		.cdp = 1,
> +		.cds = 1,
> +		.ctsp = 1,
> +		.ctss = 1,
> +		.revd = 1,
> +		.urfs = 0x128,
> +		.utfs = 0x128,
> +		.utfet = 0,
> +		.utftt = 0x128,
> +		.ufpt = 256,
> +		.ttx_trx = UCC_FAST_GUMR_TRANSPARENT_TTX_TRX_TRANSPARENT,
> +		.tenc = UCC_FAST_TX_ENCODING_NRZ,
> +		.renc = UCC_FAST_RX_ENCODING_NRZ,
> +		.tcrc = UCC_FAST_16_BIT_CRC,
> +		.synl = UCC_FAST_SYNC_LEN_NOT_USED,
> +	},
> +	.ucc_busy = 0,
> +};
> +
> +static struct ucc_tdm_info utdm_info[8];
> +
> +static void dump_siram(struct tdm_ctrl *tdm_c)
> +{
> +#if defined(DEBUG)

Microscopic note: kernel code tends to do

	#ifdef FOO

if only one identifier is being tested and

	#if defined(FOO) && defined(BAR)

if more than one is being tested.

There is no rational reason for this ;)

> +	int i;
> +	u16 phy_num_ts;
> +
> +	phy_num_ts = tdm_c->physical_num_ts;
> +
> +	pr_debug("SI TxRAM dump\n");
> +	/* each slot entry in SI RAM is of 2 bytes */
> +	for (i = 0; i < phy_num_ts * 2; i++)
> +		pr_debug("%x ", in_8(&qe_immr->sir.tx[i]));
> +	pr_debug("\nSI RxRAM dump\n");
> +	for (i = 0; i < phy_num_ts * 2; i++)
> +		pr_debug("%x ", in_8(&qe_immr->sir.rx[i]));
> +	pr_debug("\n");
> +#endif
> +}
> +
> +/*
> + * converts u-law compressed samples to linear PCM
> + * If the CONFIG_TDM_LINEAR_PCM flag is not set the
> + * TDM driver receives u-law compressed data from the
> + * SLIC device. This function converts the compressed
> + * data to linear PCM and sends it to upper layers.
> + */
> +static inline int ulaw2int(unsigned char log)
> +{
> +	u32 sign, segment, temp, quant;
> +	int val;
> +
> +	temp = log ^ 0xFF;
> +	sign = (temp & 0x80) >> 7;
> +	segment = (temp & 0x70) >> 4;
> +	quant = temp & 0x0F;
> +	quant <<= 1;
> +	quant += 33;
> +	quant <<= segment;
> +	if (sign)
> +		val = 33 - quant;
> +	else
> +		val = quant - 33;
> +
> +	val *= 4;
> +	return val;
> +}
> +
> +/*
> + * converts linear PCM samples to u-law compressed format.
> + * If the CONFIG_TDM_LINEAR_PCM flag is not set the
> + * TDM driver calls this function to convert the PCM samples
> + * to u-law compressed format before sending them to SLIC
> + * device.
> + */
> +static inline u8 int2ulaw(short linear)
> +{
> +	u8  quant, ret;
> +	u16 output, absol, temp;
> +	u32 i, sign;
> +	char segment;
> +
> +	ret = 0;
> +	if (linear >= 0)
> +		linear = (linear >> 2);
> +	else
> +		linear = (0xc000 | (linear >> 2));
> +
> +	absol = abs(linear) + 33;
> +	temp = absol;
> +	sign = (linear >= 0) ? 1 : 0;
> +	for (i = 0; i < 16; i++) {
> +		output = temp & 0x8000;
> +		if (output)
> +			break;
> +		temp <<= 1;
> +	}
> +	segment = 11 - i;
> +	quant = (absol >> segment) & 0x0F;
> +	segment--;
> +	segment <<= 4;
> +	output = segment + quant;
> +	if (absol > 8191)
> +		output = 0x7F;
> +	if (sign)
> +		ret ^= 0xFF;
> +	else
> +		ret ^= 0x7F;
> +	return ret;
> +}

hrm, how many copies of ulaw/alaw conversion functions do we need in the
tree before someone writes a library function for it?

> +	out_be16(&rx_bd->status, bd_status);
> +	out_be32(&rx_bd->buf,
> +		 tdm_c->dma_input_addr + i * SAMPLE_DEPTH * act_num_ts);
> +
> +	bd_status = (u16) ((T_R | T_CM | T_W) >> 16);
> +	bd_len =  SAMPLE_DEPTH * act_num_ts;
> +	out_be16(&tx_bd->length, bd_len);
> +	out_be16(&tx_bd->status, bd_status);
> +	out_be32(&tx_bd->buf,
> +		 tdm_c->dma_output_addr + i * SAMPLE_DEPTH * act_num_ts);
> +
> +	config_si(tdm_c);
> +
> +	setbits32(&qe_immr->ic.qimr, (0x80000000 >> ucc));

The compiler treats 0xNNN constants as unsigned so this works OK.  I'd have
put a UL on the end of the constant to be sure ;)

> +static int tdm_start(struct tdm_ctrl *tdm_c)
> +{
> +	if (request_irq(tdm_c->ut_info->uf_info.irq, tdm_isr,
> +					0, "tdm", tdm_c)) {
> +		printk(KERN_ERR "%s: request_irq for tdm_isr failed\n",
> +			__FUNCTION__);
> +		return -ENODEV;
> +	}
> +
> +	ucc_fast_enable(tdm_c->uf_private, COMM_DIR_RX | COMM_DIR_TX);
> +
> +#if !defined(CONFIG_TDM_LINEAR_PCM)
> +	pr_info("%s 8-bit u-law compressed mode active\n", __FUNCTION__);
> +#else
> +	pr_info("%s 16-bit linear pcm mode active with"
> +		" slots 0 & 2\n", __FUNCTION__);
> +#endif

Is this the sort of thing which should be controlled at compile-time?  I'd
have thought that a runtime control would be more appropriate (a sysfs knob
or a module parameter).  Or just work it out automagically?


> +	dump_siram(tdm_c);
> +	dump_ucc(tdm_c);
> +
> +	setbits8(&(qe_immr->si1.siglmr1_h), (0x1 << tdm_c->tdm_port));
> +	pr_info("%s UCC based TDM enabled\n", __FUNCTION__);
> +
> +	return 0;
> +}
>
> ...
>
> +static void tdm_read(u32 driver_handle, short chn_id, short *pcm_buffer,
> +								short len)
> +{
> +	int i;
> +	u32 phase_rx;
> +	/* point to where to start for the current phase data processing */
> +	u32 temp_rx;
> +
> +	struct tdm_ctrl *tdm_c = (struct tdm_ctrl *)(driver_handle);

eek.  What are we doing here, casting a 32-bit quantity to a kernel pointer?

a) Seems to rule out ever using this driver on a 64-bit system

b) It's generally suspicious and indicates that some rethinking is needed.

> +#if !defined(CONFIG_TDM_LINEAR_PCM)
> +	u8 *input_tdm_buffer = tdm_c->tdm_input_data;
> +
> +#else
> +	u16 *input_tdm_buffer =
> +		(u16 *)tdm_c->tdm_input_data;
> +
> +#endif
> +	phase_rx = tdm_c->phase_rx;
> +	phase_rx = PREV_PHASE(phase_rx);
> +
> +	temp_rx = phase_rx * SAMPLE_DEPTH * EFF_ACTIVE_CH;
> +
> +#if defined(UCC_CACHE_SNOOPING_DISABLED)
> +	flush_dcache_range((size_t) &input_tdm_buffer[temp_rx],
> +				(size_t) &input_tdm_buffer[temp_rx +
> +						SAMPLE_DEPTH * ACTIVE_CH]);
> +#endif

Again, is it appropriate that this behaviour be determined at compile-time?
This is very user- and packager- and distributor-unfriendly.

> +	for (i = 0; i < len; i++) {
> +#if !defined(CONFIG_TDM_LINEAR_PCM)
> +		pcm_buffer[i] =
> +			ulaw2int(input_tdm_buffer[i * EFF_ACTIVE_CH +
> +						temp_rx + chn_id]);
> +#else
> +		pcm_buffer[i] =
> +			input_tdm_buffer[i * EFF_ACTIVE_CH + temp_rx + chn_id];
> +#endif
> +
> +	}
> +
> +}
> +
> +static int ucc_tdm_probe(struct of_device *ofdev,
> +			 const struct of_device_id *match)
> +{
> +	struct device_node *np = ofdev->node;
> +	struct resource res;
> +	const unsigned int *prop;
> +	u32 ucc_num, device_num, err, ret = 0;
> +	struct device_node *np_tmp = NULL;
> +	dma_addr_t physaddr;
> +	void *tdm_buff;
> +	struct ucc_tdm_info *ut_info;
> +
> +	prop = of_get_property(np, "device-id", NULL);
> +	ucc_num = *prop - 1;
> +	if ((ucc_num < 0) || (ucc_num > 7))
> +		return -ENODEV;
> +
> +	ut_info = &utdm_info[ucc_num];
> +	if (ut_info == NULL) {
> +		printk(KERN_ERR "additional data missing\n");
> +		return -ENODEV;
> +	}
> +	if (ut_info->ucc_busy) {
> +		printk(KERN_ERR "UCC in use by another TDM driver instance\n");
> +		return -EBUSY;
> +	}
> +
> +	ut_info->ucc_busy = 1;
> +	tdm_ctrl[num_tdm_devices++] =
> +		kzalloc(sizeof(struct tdm_ctrl), GFP_KERNEL);

Shouldn't this check for (num_tdm_devices > MAX_NUM_TDM_DEVICES))?

> +	if (!tdm_ctrl[num_tdm_devices - 1]) {
> +		printk(KERN_ERR "%s: no memory to allocate for"
> +			" tdm control structure\n", __FUNCTION__);
> +		num_tdm_devices--;
> +		return -ENOMEM;
> +	}
> +	device_num = num_tdm_devices - 1;
> +
> +	tdm_ctrl[device_num]->device = &ofdev->dev;
> +	tdm_ctrl[device_num]->ut_info = ut_info;
> +
> +	tdm_ctrl[device_num]->ut_info->uf_info.ucc_num = ucc_num;
> +
> +	prop = of_get_property(np, "fsl,tdm-num", NULL);
> +	if (prop == NULL) {
> +		ret = -EINVAL;
> +		goto get_property_error;
> +	}
>
> ...
>
> +
> +#define SET_RX_SI_RAM(n, val)		\
> +		out_be16((u16 *)&qe_immr->sir.rx[(n)*2], (u16)(val))
> +
> +#define SET_TX_SI_RAM(n, val)		\
> +		out_be16((u16 *)&qe_immr->sir.tx[(n)*2], (u16)(val))

I don't think there's anything which requires that these be imlemented in
the preprocessor?

> +struct tdm_cfg {
> +	u8 com_pin;		/* Common receive and transmit pins
> +				 * 0 = separate pins
> +				 * 1 = common pins
> +				 */
> +
> +	u8 fr_sync_level;	/* SLx bit Frame Sync Polarity
> +				 * 0 = L1R/TSYNC active logic "1"
> +				 * 1 = L1R/TSYNC active logic "0"
> +				 */
> +
> +	u8 clk_edge;		/* CEx bit Tx Rx Clock Edge
> +				 * 0 = TX data on rising edge of clock
> +				 * RX data on falling edge
> +				 * 1 = TX data on falling edge of clock
> +				 * RX data on rising edge
> +				 */
> +
> +	u8 fr_sync_edge;	/* FEx bit Frame sync edge
> +				 * Determine when the sync pulses are sampled
> +				 * 0 = Falling edge
> +				 * 1 = Rising edge
> +				 */
> +
> +	u8 rx_fr_sync_delay;	/* TFSDx/RFSDx bits Frame Sync Delay
> +				 * 00 = no bit delay
> +				 * 01 = 1 bit delay
> +				 * 10 = 2 bit delay
> +				 * 11 = 3 bit delay
> +				 */
> +
> +	u8 tx_fr_sync_delay;	/* TFSDx/RFSDx bits Frame Sync Delay
> +				 * 00 = no bit delay
> +				 * 01 = 1 bit delay
> +				 * 10 = 2 bit delay
> +				 * 11 = 3 bit delay
> +				 */
> +
> +	u8 active_num_ts;	/* Number of active time slots in TDM
> +				 * assume same active Rx/Tx time slots
> +				 */
> +};

Nice commenting.

^ permalink raw reply

* RE: Problem booting Linux 2.6 on Virtex-4
From: Stephen Neuendorffer @ 2008-01-14 21:09 UTC (permalink / raw)
  To: David Baird, linuxppc-embedded
In-Reply-To: <440abda90801141211m52bd0a3bk67014c6df2bf406c@mail.gmail.com>

What kernel version are you targeting? Are you using arch/powerpc or =
arch/ppc?  V4 has a data cache errata, which isn't currently in mainline =
arch/powerpc.

        if((mfpvr() & 0xfffff000) =3D=3D 0x20011000) {
            /* PPC errata 213: only for Virtex-4 FX */
            __asm__("mfccr0  0\n\t"
                    "oris    0,0,0x50000000@h\n\t"
                    "mtccr0  0"
                    : : : "0");
        }

Steve

> -----Original Message-----
> From: linuxppc-embedded-bounces+stephen=3Dneuendorffer.name@ozlabs.org =
[mailto:linuxppc-embedded-
> bounces+stephen=3Dneuendorffer.name@ozlabs.org] On Behalf Of David =
Baird
> Sent: Monday, January 14, 2008 12:12 PM
> To: linuxppc-embedded@ozlabs.org
> Subject: Re: Problem booting Linux 2.6 on Virtex-4
>=20
> On Jan 14, 2008 1:37 AM, Enno L=FCbbers <enno.luebbers@upb.de> wrote:
> > Hello David,
> >
> > Am 14.01.2008 um 06:12 schrieb David Baird:
> >
> > > I'm having trouble with getting Linux to boot farther than =
early_init.
> > > [...]
> > > So, I experimented further and discovered that different memory
> > > regions seem to be aliased on to each other every 2*32*256 bytes.
> >
> >
> > This sounds either like a wrong programming of an BRx/ORx memory
> > controller register pair (which, AFAIK, the PPC405 does not have), =
or
> > like a messed up address map in EDK. My guess is that an optimized/
> > sloppy implementation of the address decoder for some peripheral in =
an
> > EDK system could produce something like you described; or there's a
> > block RAM that's attached to a controller in the wrong way; or the
> > bank/address parameters of the DDR controller don't match the =
physical
> > setup... there's a lot that can go wrong obviously on a configurable
> > SoC.
>=20
> What has been confusing me is that I am unable to reproduce the
> problem in real mode.  I can only reproduce the problem in virtual
> mode.  This leads me to believe, perhaps mistakenly, that the hardware
> is implemented okay.  OTOH, neither can I see anything wrong with the
> software.
>=20
> > Can you be more specific about your hardware platform? Is this a
> > reference design? What board are you using?
>=20
> I am currently testing code on the ML403 evaluation board.  I used the
> Base System Builder in EDK to create the hardware design and DDR SDRAM
> is being used as the main RAM starting at address 0x00000000 and also
> with OCM BRAM mapped at the very end of the address space (so that
> 0xfffffffc can contain code to execute on startup).
>=20
> I am now trying to experiment with the hardware and see if I can find
> a hardware reference design.  I will let you know what I figure out.
>=20
> -David
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* Re: Problem booting Linux 2.6 on Virtex-4
From: David Baird @ 2008-01-14 20:11 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <62D97388-4D65-4B40-A0D1-847963FF0A16@upb.de>

On Jan 14, 2008 1:37 AM, Enno L=FCbbers <enno.luebbers@upb.de> wrote:
> Hello David,
>
> Am 14.01.2008 um 06:12 schrieb David Baird:
>
> > I'm having trouble with getting Linux to boot farther than early_init.
> > [...]
> > So, I experimented further and discovered that different memory
> > regions seem to be aliased on to each other every 2*32*256 bytes.
>
>
> This sounds either like a wrong programming of an BRx/ORx memory
> controller register pair (which, AFAIK, the PPC405 does not have), or
> like a messed up address map in EDK. My guess is that an optimized/
> sloppy implementation of the address decoder for some peripheral in an
> EDK system could produce something like you described; or there's a
> block RAM that's attached to a controller in the wrong way; or the
> bank/address parameters of the DDR controller don't match the physical
> setup... there's a lot that can go wrong obviously on a configurable
> SoC.

What has been confusing me is that I am unable to reproduce the
problem in real mode.  I can only reproduce the problem in virtual
mode.  This leads me to believe, perhaps mistakenly, that the hardware
is implemented okay.  OTOH, neither can I see anything wrong with the
software.

> Can you be more specific about your hardware platform? Is this a
> reference design? What board are you using?

I am currently testing code on the ML403 evaluation board.  I used the
Base System Builder in EDK to create the hardware design and DDR SDRAM
is being used as the main RAM starting at address 0x00000000 and also
with OCM BRAM mapped at the very end of the address space (so that
0xfffffffc can contain code to execute on startup).

I am now trying to experiment with the hardware and see if I can find
a hardware reference design.  I will let you know what I figure out.

-David

^ permalink raw reply

* Re: [PATCH] MTD for Taco
From: Sean MacLennan @ 2008-01-14 20:04 UTC (permalink / raw)
  To: Stefan Roese; +Cc: linuxppc-dev
In-Reply-To: <200801142042.56847.sr@denx.de>

Stefan Roese wrote:
> And the EBC0_BxCR & EBC0BxAP registers for the CS where the NAND is connected? 
> How are they configured?
>   
EBC0_B1CR d001c000
EBC0_B1AP 18003c0

Which matches the defines in include/configs/warp.h:

    #define CFG_EBC_PB1AP        0x018003c0
    #define CFG_EBC_PB1CR        (CFG_NAND_ADDR | 0x1c000)

It also matches the defines in sequoia.h except that we are on CS1 and 
the sequoia is on CS3.

Cheers,
   Sean

^ permalink raw reply

* Re: [i2c] [PATCH] update module-init-tools to support the i2c subsystem
From: Jean Delvare @ 2008-01-14 19:46 UTC (permalink / raw)
  To: Kay Sievers; +Cc: Geert Uytterhoeven, linuxppc-dev, linux-kernel, i2c
In-Reply-To: <3ae72650801141138t27666bcerd66e96f836d1ab2b@mail.gmail.com>

On Mon, 14 Jan 2008 20:38:28 +0100, Kay Sievers wrote:
> On Jan 14, 2008 6:50 PM, Jean Delvare <khali@linux-fr.org> wrote:
> > I am under the impression that modules.*map are the old way to get
> > automatic driver loading and aliases are the new way to do the same.
> > But maybe that's just me.
> 
> Right, nothing on recent systems is using the map files. This patch
> should not be needed.
> The plan is to deprecate the creation of these files in depmod.

OK, great. Thanks for the info, Kay!

-- 
Jean Delvare

^ permalink raw reply

* Re: [PATCH] MTD for Taco
From: Stefan Roese @ 2008-01-14 19:42 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev
In-Reply-To: <478B9CB6.7000408@pikatech.com>

On Monday 14 January 2008, Sean MacLennan wrote:
> Josh Boyer wrote:
> > But did you go back and verify the EBC settings were correct on your
> > board?  This shouldn't be needed at all if the EBC bank settings and
> > timings are correct.
> >
> > josh
>
> In the EBC0_CFG register we set the RTC (Ready Timeout Count) to 0 and
> the sequoia uses 7. Also we set the EMS (External Master Size) to none
> and the sequoia sets it to 8 bit.
>
> This is in uboot, the dts are basically the same.

And the EBC0_BxCR & EBC0BxAP registers for the CS where the NAND is connected? 
How are they configured?

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office@denx.de
=====================================================================

^ permalink raw reply

* Re: [i2c] [PATCH] update module-init-tools to support the i2c subsystem
From: Kay Sievers @ 2008-01-14 19:38 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Geert Uytterhoeven, linuxppc-dev, linux-kernel, i2c
In-Reply-To: <20080114185056.05b75fd1@hyperion.delvare>

On Jan 14, 2008 6:50 PM, Jean Delvare <khali@linux-fr.org> wrote:
> On Mon, 14 Jan 2008 18:08:16 +0100 (CET), Geert Uytterhoeven wrote:
> > On Mon, 14 Jan 2008, Jean Delvare wrote:
> > > I thought that the module aliases were generated by
> > > scripts/mod/modpost? As a matter of fact, I did not apply Jon's patch
> >
> > Sorry, you're right. Too early in the morning :-)
> >
> > > to module-init-tools, and "modinfo" shows me module aliases properly
> > > for i2c drivers that call MODULE_DEVICE_TABLE():
> >
> > I've just looked it up again (I had to do a similar thing for Zorro bus
> > support).  Module-init-tools (depmod) also creates the modules.*map files,
> > which are used to map from device IDs to module names. I think these are used
> > by udev to load the appropriate module when a device with a specific device ID
> > pops up in sysfs.
>
> Ah, right. I see it now, there's modules.isapnpmap,
> modules.ieee1394map, modules.pcimap etc. but no modules.i2cmap.
> However, there is modules.alias which contains the i2c aliases for all
> device types (including one ieee1394 and many pci aliases) which seems
> somewhat redundant with the modules.*map files.
>
> > > $ /sbin/modinfo lm90
> > > filename:       /lib/modules/2.6.24-rc7-git4/kernel/drivers/hwmon/lm90.ko
> > > author:         Jean Delvare <khali@linux-fr.org>
> > > description:    LM90/ADM1032 driver
> > > license:        GPL
> > > vermagic:       2.6.24-rc7-git4 mod_unload
> > > depends:        hwmon
> > > alias:          i2c:Nlm90*
> > > alias:          i2c:Nadm1032*
> > > alias:          i2c:Nlm99*
> > > alias:          i2c:Nlm86*
> > > alias:          i2c:Nmax6657*
> > > alias:          i2c:Nadt7461*
> > > alias:          i2c:Nmax6680*
> > > $
> > >
> > > "modprobe i2c:Nadm1032" loads the lm90 driver as expected.
> >
> > Yes, it's also still not 100% clear to me when `i2c:Nadm1032' is used, and when
> > modules.i2cmap would be used...
>
> I am under the impression that modules.*map are the old way to get
> automatic driver loading and aliases are the new way to do the same.
> But maybe that's just me.

Right, nothing on recent systems is using the map files. This patch
should not be needed.
The plan is to deprecate the creation of these files in depmod.

Thanks,
Kay

^ permalink raw reply

* Re: I2C and CAN bus on MPC5200B device tree
From: Scott Wood @ 2008-01-14 19:04 UTC (permalink / raw)
  To: Olof Johansson; +Cc: ppc-dev, linuxppc-embedded
In-Reply-To: <20080114044216.GA23349@lixom.net>

On Sun, Jan 13, 2008 at 10:42:16PM -0600, Olof Johansson wrote:
> I think simple devices might have been agreed upon (but it's been a
> while since it was covered). Muxed busses probably hasn't. Either that
> or I completely missed the emails.

I posted something in one of the i2c device tree threads a while ago:
http://ozlabs.org/pipermail/linuxppc-dev/2007-May/036353.html

Basically, you just have a node that is both an i2c device and an i2c
controller, and the mux driver binds to it and registers the subordinate
buses as new i2c controllers.

-Scott

^ permalink raw reply

* RE: Linux for ml310
From: Stephen Neuendorffer @ 2008-01-14 18:47 UTC (permalink / raw)
  To: greenlean, linuxppc-embedded
In-Reply-To: <14808605.post@talk.nabble.com>


If you are using the secretlab.ca or git.xilinx.com trees, then you
should *not* follow the normal BSP generation process.  You need to
generate the BSP in a dummy location and then copy only the
xparameters_*.h file over the appropriate one in
arch/ppc/platforms/4xx/xparameters and make menuconfig.

Steve

> -----Original Message-----
> From: linuxppc-embedded-bounces+stephen=3Dneuendorffer.name@ozlabs.org
[mailto:linuxppc-embedded-
> bounces+stephen=3Dneuendorffer.name@ozlabs.org] On Behalf Of greenlean
> Sent: Monday, January 14, 2008 10:42 AM
> To: linuxppc-embedded@ozlabs.org
> Subject: Re: Linux for ml310
>=20
>=20
> Hi, I was reading this post and a question came to my mind.
>=20
> When I try to compile, did I have to copy the EDK driver folder to my
Xilinx
> 2.6 kernel tree and run the cow.tcl script generated by EDK?? Or this
is
> unnecesay??
>=20
>=20
>=20
>=20
> Grant Likely-2 wrote:
> >
> > On 1/9/08, Joachim Meyer <Jogi95@web.de> wrote:
> >> Hi
> >>
> >> I switched "Xilinx uartlite serieal port support" and "Support for
> >> console on Xilinxuartlite serialport" on and "8250/16550 and
compatible
> >> serial support" off, in the kernel config.
> >> Then I removed the things I added in the xparameters.h and compiled
> >> successfully.
> >> But I have yet a few Questions:
> >>
> >> - What would you recommend to use? UART-Lite or a 16550 serial
port. Can
> >> I get a console running on the RS232 Port of the Board with both
> >> possibilities?
> >
> > if you don't need to change the baud rate at runtime then use the
> > uartlite.
> >
> > Console works on both.
> >
> >>
> >> - Can you recommend anything for my next steps to get an running
linux
> >> (rootfs usw.)? So far I oriented myself on the Klingauf page, but I
think
> >> it is perhaps not the best one because its too old and some things
will
> >> probably not work the way he did it anymore.
> >
> > Use either ELDK or buildroot.  Personally, I'd like to be using
> > OpenEmbedded, but I haven't been successful with that yet.
> >
> > Cheers,
> > g.
> >
> > --
> > Grant Likely, B.Sc., P.Eng.
> > Secret Lab Technologies Ltd.
> > _______________________________________________
> > Linuxppc-embedded mailing list
> > Linuxppc-embedded@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> >
> >
>=20
> --
> View this message in context:
http://www.nabble.com/Linux-for-ml310-tp14675554p14808605.html
> Sent from the linuxppc-embedded mailing list archive at Nabble.com.
>=20
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* Re: Linux for ml310
From: greenlean @ 2008-01-14 18:42 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <fa686aa40801091410k5d83f124ve009c96683f78ad2@mail.gmail.com>


Hi, I was reading this post and a question came to my mind.

When I try to compile, did I have to copy the EDK driver folder to my Xilinx
2.6 kernel tree and run the cow.tcl script generated by EDK?? Or this is
unnecesay??




Grant Likely-2 wrote:
> 
> On 1/9/08, Joachim Meyer <Jogi95@web.de> wrote:
>> Hi
>>
>> I switched "Xilinx uartlite serieal port support" and "Support for
>> console on Xilinxuartlite serialport" on and "8250/16550 and compatible
>> serial support" off, in the kernel config.
>> Then I removed the things I added in the xparameters.h and compiled
>> successfully.
>> But I have yet a few Questions:
>>
>> - What would you recommend to use? UART-Lite or a 16550 serial port. Can
>> I get a console running on the RS232 Port of the Board with both
>> possibilities?
> 
> if you don't need to change the baud rate at runtime then use the
> uartlite.
> 
> Console works on both.
> 
>>
>> - Can you recommend anything for my next steps to get an running linux
>> (rootfs usw.)? So far I oriented myself on the Klingauf page, but I think
>> it is perhaps not the best one because its too old and some things will
>> probably not work the way he did it anymore.
> 
> Use either ELDK or buildroot.  Personally, I'd like to be using
> OpenEmbedded, but I haven't been successful with that yet.
> 
> Cheers,
> g.
> 
> -- 
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> 
> 

-- 
View this message in context: http://www.nabble.com/Linux-for-ml310-tp14675554p14808605.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.

^ permalink raw reply

* Re: [i2c] [PATCH] update module-init-tools to support the i2c   subsystem
From: Jean Delvare @ 2008-01-14 17:50 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linuxppc-dev, linux-kernel, i2c
In-Reply-To: <Pine.LNX.4.64.0801141752450.3058@vixen.sonytel.be>

On Mon, 14 Jan 2008 18:08:16 +0100 (CET), Geert Uytterhoeven wrote:
> On Mon, 14 Jan 2008, Jean Delvare wrote:
> > I thought that the module aliases were generated by
> > scripts/mod/modpost? As a matter of fact, I did not apply Jon's patch
> 
> Sorry, you're right. Too early in the morning :-)
> 
> > to module-init-tools, and "modinfo" shows me module aliases properly
> > for i2c drivers that call MODULE_DEVICE_TABLE():
> 
> I've just looked it up again (I had to do a similar thing for Zorro bus
> support).  Module-init-tools (depmod) also creates the modules.*map files,
> which are used to map from device IDs to module names. I think these are used
> by udev to load the appropriate module when a device with a specific device ID
> pops up in sysfs.

Ah, right. I see it now, there's modules.isapnpmap,
modules.ieee1394map, modules.pcimap etc. but no modules.i2cmap.
However, there is modules.alias which contains the i2c aliases for all
device types (including one ieee1394 and many pci aliases) which seems
somewhat redundant with the modules.*map files.

> > $ /sbin/modinfo lm90
> > filename:       /lib/modules/2.6.24-rc7-git4/kernel/drivers/hwmon/lm90.ko
> > author:         Jean Delvare <khali@linux-fr.org>
> > description:    LM90/ADM1032 driver
> > license:        GPL
> > vermagic:       2.6.24-rc7-git4 mod_unload
> > depends:        hwmon
> > alias:          i2c:Nlm90*
> > alias:          i2c:Nadm1032*
> > alias:          i2c:Nlm99*
> > alias:          i2c:Nlm86*
> > alias:          i2c:Nmax6657*
> > alias:          i2c:Nadt7461*
> > alias:          i2c:Nmax6680*
> > $
> > 
> > "modprobe i2c:Nadm1032" loads the lm90 driver as expected.
> 
> Yes, it's also still not 100% clear to me when `i2c:Nadm1032' is used, and when
> modules.i2cmap would be used...

I am under the impression that modules.*map are the old way to get
automatic driver loading and aliases are the new way to do the same.
But maybe that's just me.

-- 
Jean Delvare

^ permalink raw reply

* Re: [PATCH] MTD for Taco
From: Sean MacLennan @ 2008-01-14 17:32 UTC (permalink / raw)
  To: Josh Boyer; +Cc: linuxppc-dev, Stefan Roese
In-Reply-To: <20080114024432.1dcba2f7@vader.jdub.homelinux.org>

Josh Boyer wrote:
>
> But did you go back and verify the EBC settings were correct on your
> board?  This shouldn't be needed at all if the EBC bank settings and
> timings are correct.
>
> josh
>   

In the EBC0_CFG register we set the RTC (Ready Timeout Count) to 0 and 
the sequoia uses 7. Also we set the EMS (External Master Size) to none 
and the sequoia sets it to 8 bit.

This is in uboot, the dts are basically the same.

Cheers,
    Sean

^ permalink raw reply

* Re: [PATCH 1/5] Warp Base Platform
From: Sean MacLennan @ 2008-01-14 17:18 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linuxppc-dev, Stefan Roese
In-Reply-To: <20080113113545.f08d9199.sfr@canb.auug.org.au>

This should have all of Stephen Rothwell's recommended changes.

Cheers,
    Sean

Signed-off-by: Sean MacLennan <smaclennan@pikatech.com>
---
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 66a3d8c..b3e4c35 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -469,7 +469,7 @@ config MCA
 config PCI
 	bool "PCI support" if 40x || CPM2 || PPC_83xx || PPC_85xx || PPC_86xx \
 		|| PPC_MPC52xx || (EMBEDDED && (PPC_PSERIES || PPC_ISERIES)) \
-		|| PPC_PS3
+		|| PPC_PS3 || 44x
 	default y if !40x && !CPM2 && !8xx && !PPC_83xx \
 		&& !PPC_85xx && !PPC_86xx
 	default PCI_PERMEDIA if !4xx && !CPM2 && !8xx
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index d248013..a95409e 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -53,6 +53,19 @@ config RAINIER
 	help
 	  This option enables support for the AMCC PPC440GRX evaluation board.
 
+config WARP
+	bool "PIKA Warp"
+	depends on 44x
+	default n
+	select 440EP
+	help
+	  This option enables support for the PIKA Warp(tm) Appliance. The Warp
+          is a small computer replacement with up to 9 ports of FXO/FXS plus VOIP
+	  stations and trunks.
+
+	  See http://www.pikatechnologies.com/ and follow the "PIKA for Computer
+	  Telephony Developers" link for more information.
+
 #config LUAN
 #	bool "Luan"
 #	depends on 44x
@@ -75,6 +88,7 @@ config 440EP
 	select PPC_FPU
 	select IBM440EP_ERR42
 	select IBM_NEW_EMAC_ZMII
+	select USB_ARCH_HAS_OHCI
 
 config 440EPX
 	bool
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index a2a0dc1..7aaee9d 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -5,3 +5,5 @@ obj-$(CONFIG_BAMBOO)	+= bamboo.o
 obj-$(CONFIG_SEQUOIA)	+= sequoia.o
 obj-$(CONFIG_KATMAI)	+= katmai.o
 obj-$(CONFIG_RAINIER)	+= rainier.o
+obj-$(CONFIG_WARP)	+= warp.o
+#obj-$(CONFIG_WARP)	+= warp-nand.o
diff --git a/arch/powerpc/platforms/44x/warp-nand.c b/arch/powerpc/platforms/44x/warp-nand.c
new file mode 100644
index 0000000..0053958
--- /dev/null
+++ b/arch/powerpc/platforms/44x/warp-nand.c
@@ -0,0 +1,92 @@
+/*
+ * PIKA Warp(tm) NAND flash specific routines
+ *
+ * Copyright (c) 2008 PIKA Technologies
+ *   Sean MacLennan <smaclennan@pikatech.com>
+ */
+
+#include <linux/platform_device.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/partitions.h>
+#include <linux/mtd/nand.h>
+#include <linux/mtd/ndfc.h>
+
+
+#define CS_NAND_0	1	/* use chip select 1 for NAND device 0 */
+
+#define WARP_NAND_FLASH_REG_ADDR	0xD0000000UL
+#define WARP_NAND_FLASH_REG_SIZE	0x2000
+
+static struct resource warp_ndfc = {
+	.start = WARP_NAND_FLASH_REG_ADDR,
+	.end   = WARP_NAND_FLASH_REG_ADDR + WARP_NAND_FLASH_REG_SIZE,
+	.flags = IORESOURCE_MEM,
+};
+
+static struct mtd_partition nand_parts[] = {
+	{
+		.name = "nand",
+		.offset = 0,
+		.size = MTDPART_SIZ_FULL,
+	}
+};
+
+struct ndfc_controller_settings warp_ndfc_settings = {
+	.ccr_settings = (NDFC_CCR_BS(CS_NAND_0) | NDFC_CCR_ARAC1),
+	.ndfc_erpn = 0,
+};
+
+static struct ndfc_chip_settings warp_chip0_settings = {
+	.bank_settings = 0x80002222,
+};
+
+struct platform_nand_ctrl warp_nand_ctrl = {
+	.priv = &warp_ndfc_settings,
+};
+
+static struct platform_device warp_ndfc_device = {
+	.name = "ndfc-nand",
+	.id = 0,
+	.dev = {
+		.platform_data = &warp_nand_ctrl,
+	},
+	.num_resources = 1,
+	.resource = &warp_ndfc,
+};
+
+static struct nand_ecclayout nand_oob_16 = {
+	.eccbytes = 3,
+	.eccpos = { 0, 1, 2, 3, 6, 7 },
+	.oobfree = { {.offset = 8, .length = 16} }
+};
+
+static struct platform_nand_chip warp_nand_chip0 = {
+	.nr_chips = 1,
+	.chip_offset = CS_NAND_0,
+	.nr_partitions = ARRAY_SIZE(nand_parts),
+	.partitions = nand_parts,
+	.chip_delay = 50,
+	.ecclayout = &nand_oob_16,
+	.priv = &warp_chip0_settings,
+};
+
+static struct platform_device warp_nand_device = {
+	.name = "ndfc-chip",
+	.id = 0,
+	.num_resources = 1,
+	.resource = &warp_ndfc,
+	.dev = {
+		.platform_data = &warp_nand_chip0,
+		.parent = &warp_ndfc_device.dev,
+	}
+};
+
+static int warp_setup_nand_flash(void)
+{
+	platform_device_register(&warp_ndfc_device);
+	platform_device_register(&warp_nand_device);
+
+	return 0;
+}
+device_initcall(warp_setup_nand_flash);
diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c
new file mode 100644
index 0000000..2c8c064
--- /dev/null
+++ b/arch/powerpc/platforms/44x/warp.c
@@ -0,0 +1,186 @@
+/*
+ * PIKA Warp(tm) board specific routines
+ *
+ * Copyright (c) 2008 PIKA Technologies
+ *   Sean MacLennan <smaclennan@pikatech.com>
+ *
+ * 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/init.h>
+#include <linux/of_platform.h>
+#include <linux/kthread.h>
+
+#include <asm/machdep.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <asm/time.h>
+#include <asm/uic.h>
+
+#include "44x.h"
+
+
+static __initdata struct of_device_id warp_of_bus[] = {
+	{ .compatible = "ibm,plb4", },
+	{ .compatible = "ibm,opb", },
+	{ .compatible = "ibm,ebc", },
+	{},
+};
+
+static int __init warp_device_probe(void)
+{
+	of_platform_bus_probe(NULL, warp_of_bus, NULL);
+	return 0;
+}
+machine_device_initcall(warp, warp_device_probe);
+
+static int __init warp_probe(void)
+{
+	unsigned long root = of_get_flat_dt_root();
+
+	return of_flat_dt_is_compatible(root, "pika,warp");
+}
+
+define_machine(warp) {
+	.name		= "Warp",
+	.probe 		= warp_probe,
+	.progress 	= udbg_progress,
+	.init_IRQ 	= uic_init_tree,
+	.get_irq 	= uic_get_irq,
+	.restart	= ppc44x_reset_system,
+	.calibrate_decr = generic_calibrate_decr,
+};
+
+
+#define LED_GREEN (0x80000000 >> 0)
+#define LED_RED   (0x80000000 >> 1)
+
+
+/* This is for the power LEDs 1 = on, 0 = off, -1 = leave alone */
+void warp_set_power_leds(int green, int red)
+{
+	static void __iomem *gpio_base = NULL;
+	unsigned leds;
+
+	if (gpio_base == NULL) {
+		struct device_node *np;
+
+		/* Power LEDS are on the second GPIO controller */
+		np = of_find_compatible_node(NULL, NULL, "ibm,gpio-440EP");
+		if (np)
+			np = of_find_compatible_node(np, NULL, "ibm,gpio-440EP");
+		if (np == NULL) {
+			printk(KERN_ERR __FILE__ ": Unable to find gpio\n");
+			return;
+		}
+
+		gpio_base = of_iomap(np, 0);
+		of_node_put(np);
+		if (gpio_base == NULL) {
+			printk(KERN_ERR __FILE__ ": Unable to map gpio");
+			return;
+		}
+	}
+
+	leds = in_be32(gpio_base);
+
+	switch (green) {
+	case 0: leds &= ~LED_GREEN; break;
+	case 1: leds |=  LED_GREEN; break;
+	}
+	switch (red) {
+	case 0: leds &= ~LED_RED; break;
+	case 1: leds |=  LED_RED; break;
+	}
+
+	out_be32(gpio_base, leds);
+}
+EXPORT_SYMBOL(warp_set_power_leds);
+
+
+#ifdef CONFIG_SENSORS_AD7414
+static int pika_dtm_thread(void __iomem *fpga)
+{
+	extern int ad7414_get_temp(int index);
+
+	while (!kthread_should_stop()) {
+		int temp = ad7414_get_temp(0);
+
+		out_be32(fpga, temp);
+
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ);
+	}
+
+	return 0;
+}
+
+static int pika_dtm_start(void __iomem *fpga)
+{
+	struct task_struct *dtm_thread;
+
+	dtm_thread = kthread_run(pika_dtm_thread, fpga + 0x20, "pika-dtm");
+	if (IS_ERR(dtm_thread)) {
+		printk(KERN_ERR __FILE__ ": Unable to start PIKA DTM thread\n");
+		return PTR_ERR(dtm_thread);
+	}
+
+	return 0;
+}
+#else
+static int pika_dtm_start(void __iomem *fpga)
+{
+	printk(KERN_WARNING "PIKA DTM disabled\n");
+	return 0;
+}
+#endif
+
+
+static int __devinit warp_fpga_init(void)
+{
+	struct device_node *np;
+	struct resource res;
+	void __iomem *fpga;
+	int irq;
+
+	np = of_find_compatible_node(NULL, NULL, "pika,fpga");
+	if (np == NULL) {
+		printk(KERN_ERR __FILE__ ": Unable to find fpga\n");
+		return -ENOENT;
+	}
+
+	irq = irq_of_parse_and_map(np, 0);
+	if (irq  == NO_IRQ) {
+		of_node_put(np);
+		printk(KERN_ERR __FILE__ ": irq_of_parse_and_map failed\n");
+		return -EBUSY;
+	}
+
+	/* We do not call of_iomap here since it would map in the entire
+	 * fpga space, which is over 8k.
+	 */
+	if (of_address_to_resource(np, 0, &res)) {
+		of_node_put(np);
+		printk(KERN_ERR __FILE__ ": Unable to get FPGA address\n");
+		return -ENOENT;
+	}
+	of_node_put(np);
+
+	fpga = ioremap(res.start, 0x24);
+	if (fpga == NULL) {
+		printk(KERN_ERR __FILE__ ": Unable to map FPGA\n");
+		return -ENOENT;
+	}
+
+	if (pika_dtm_start(fpga)) {
+		iounmap(fpga);
+		return -ENOENT;
+	}
+
+	/* SAM TODO: Start the watchdog here */
+
+	return 0;
+}
+device_initcall(warp_fpga_init);

^ permalink raw reply related

* Re: [i2c] [PATCH] update module-init-tools to support the i2c subsystem
From: Geert Uytterhoeven @ 2008-01-14 17:08 UTC (permalink / raw)
  To: Jean Delvare; +Cc: linuxppc-dev, linux-kernel, i2c
In-Reply-To: <20080114173835.5fe907db@hyperion.delvare>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2475 bytes --]

On Mon, 14 Jan 2008, Jean Delvare wrote:
> On Mon, 14 Jan 2008 11:57:52 +0100 (CET), Geert Uytterhoeven wrote:
> > On Sun, 13 Jan 2008, Jon Smirl wrote:
> > > I don't know exactly what those modules tables are used for. I just
> > > copied what the other subsystems do. Maybe they are used when you make
> > > an initrd to know which drivers to copy into the image.
> > 
> > Module-init-tools needs those table to create module aliases in the *.ko
> > files from the MODULE_DEVICE_TABLE(), so udev can load the modules based
> > on the device IDs when the devices appear in sysfs.
> 
> I thought that the module aliases were generated by
> scripts/mod/modpost? As a matter of fact, I did not apply Jon's patch

Sorry, you're right. Too early in the morning :-)

> to module-init-tools, and "modinfo" shows me module aliases properly
> for i2c drivers that call MODULE_DEVICE_TABLE():

I've just looked it up again (I had to do a similar thing for Zorro bus
support).  Module-init-tools (depmod) also creates the modules.*map files,
which are used to map from device IDs to module names. I think these are used
by udev to load the appropriate module when a device with a specific device ID
pops up in sysfs.

> $ /sbin/modinfo lm90
> filename:       /lib/modules/2.6.24-rc7-git4/kernel/drivers/hwmon/lm90.ko
> author:         Jean Delvare <khali@linux-fr.org>
> description:    LM90/ADM1032 driver
> license:        GPL
> vermagic:       2.6.24-rc7-git4 mod_unload
> depends:        hwmon
> alias:          i2c:Nlm90*
> alias:          i2c:Nadm1032*
> alias:          i2c:Nlm99*
> alias:          i2c:Nlm86*
> alias:          i2c:Nmax6657*
> alias:          i2c:Nadt7461*
> alias:          i2c:Nmax6680*
> $
> 
> "modprobe i2c:Nadm1032" loads the lm90 driver as expected.

Yes, it's also still not 100% clear to me when `i2c:Nadm1032' is used, and when
modules.i2cmap would be used...

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium

Phone:    +32 (0)2 700 8453
Fax:      +32 (0)2 700 8622
E-mail:   Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/

Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619

^ permalink raw reply

* Re: [i2c] [PATCH] update module-init-tools to support the i2c subsystem
From: Jean Delvare @ 2008-01-14 16:38 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linuxppc-dev, linux-kernel, i2c
In-Reply-To: <Pine.LNX.4.64.0801141154420.3058@vixen.sonytel.be>

Hi Geert,

On Mon, 14 Jan 2008 11:57:52 +0100 (CET), Geert Uytterhoeven wrote:
> On Sun, 13 Jan 2008, Jon Smirl wrote:
> > I don't know exactly what those modules tables are used for. I just
> > copied what the other subsystems do. Maybe they are used when you make
> > an initrd to know which drivers to copy into the image.
> 
> Module-init-tools needs those table to create module aliases in the *.ko
> files from the MODULE_DEVICE_TABLE(), so udev can load the modules based
> on the device IDs when the devices appear in sysfs.

I thought that the module aliases were generated by
scripts/mod/modpost? As a matter of fact, I did not apply Jon's patch
to module-init-tools, and "modinfo" shows me module aliases properly
for i2c drivers that call MODULE_DEVICE_TABLE():

$ /sbin/modinfo lm90
filename:       /lib/modules/2.6.24-rc7-git4/kernel/drivers/hwmon/lm90.ko
author:         Jean Delvare <khali@linux-fr.org>
description:    LM90/ADM1032 driver
license:        GPL
vermagic:       2.6.24-rc7-git4 mod_unload
depends:        hwmon
alias:          i2c:Nlm90*
alias:          i2c:Nadm1032*
alias:          i2c:Nlm99*
alias:          i2c:Nlm86*
alias:          i2c:Nmax6657*
alias:          i2c:Nadt7461*
alias:          i2c:Nmax6680*
$

"modprobe i2c:Nadm1032" loads the lm90 driver as expected.

> That's the generic part. How this applies to i2c devices on platforms
> without Open Firmware device trees is another question. I guess that's
> where Jean gets confused (i2c_device_id got _removed_ last year,
> because it didn't make sense (at the time?)).

The way it was implemented back then did not make sense. As it was not
clear whether we would implement something different or nothing at all,
I decided to plain remove it. Now that it seems that we want to
implement it differently, I'm looking into it again.

-- 
Jean Delvare

^ permalink raw reply

* [DTC PATCH] libfdt: Add ft_get_next_node(), ft_get_next_prop(), and ft_getprop_offset().
From: Scott Wood @ 2008-01-14 16:30 UTC (permalink / raw)
  To: jdl; +Cc: linuxppc-dev

ft_get_next_node() enumerates children of a given node.
ft_get_next_prop() enumerates propreties of a given node.

ft_getprop_offset() is like ft_getprop(), but takes a property offset rather
than a node offset and property name; it is primarily intended for use
with ft_get_next_prop().

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 libfdt/fdt_ro.c       |  134 +++++++++++++++++++++++++++++++++++++++++++++++++
 libfdt/fdt_strerror.c |    1 +
 libfdt/libfdt.h       |  123 ++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 251 insertions(+), 7 deletions(-)

diff --git a/libfdt/fdt_ro.c b/libfdt/fdt_ro.c
index 12a37d5..27c943a 100644
--- a/libfdt/fdt_ro.c
+++ b/libfdt/fdt_ro.c
@@ -293,6 +293,51 @@ const void *fdt_getprop(const void *fdt, int nodeoffset,
 	return prop->data;
 }
 
+const void *fdt_getprop_offset(const void *fdt, int propoffset,
+                               const char **name, int *lenp)
+{
+	uint32_t tag;
+	const struct fdt_property *prop;
+	int namestroff;
+	int err, len;
+
+	err = fdt_check_header(fdt);
+	if (err)
+		goto fail;
+
+	tag = fdt_next_tag(fdt,propoffset, NULL);
+	if (tag != FDT_PROP) {
+		err = -FDT_ERR_BADOFFSET;
+		goto fail;
+	}
+
+	err = -FDT_ERR_BADSTRUCTURE;
+	prop = fdt_offset_ptr(fdt, propoffset, sizeof(*prop));
+	if (!prop)
+		goto fail;
+
+	if (name) {
+		namestroff = fdt32_to_cpu(prop->nameoff);
+		*name = fdt_string(fdt, namestroff);
+	}
+
+	len = fdt32_to_cpu(prop->len);
+	if (lenp)
+		*lenp = len;
+
+	prop = fdt_offset_ptr(fdt, propoffset, sizeof(*prop) + len);
+	if (!prop)
+		goto fail;
+
+	return prop->data;
+
+fail:
+	if (lenp)
+		*lenp = err;
+
+	return NULL;
+}
+
 uint32_t fdt_get_phandle(const void *fdt, int nodeoffset)
 {
 	const uint32_t *php;
@@ -581,3 +626,92 @@ int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
 
 	return -FDT_ERR_NOTFOUND;
 }
+
+int fdt_get_next_node(const void *fdt, int startoffset,
+                      int *depth, int recursive)
+{
+	uint32_t tag;
+	int offset, nextoffset;
+
+	CHECK_HEADER(fdt);
+
+	if (startoffset >= 0) {
+		tag = fdt_next_tag(fdt, startoffset, &nextoffset);
+		if (tag != FDT_BEGIN_NODE)
+			return -FDT_ERR_BADOFFSET;
+	} else {
+		nextoffset = 0;
+	}
+
+	do {
+		offset = nextoffset;
+		tag = fdt_next_tag(fdt, offset, &nextoffset);
+
+		switch (tag) {
+		case FDT_BEGIN_NODE:
+			if ((*depth)++ == 0 || recursive) {
+				return offset;
+			}
+
+			break;
+
+		case FDT_END_NODE:
+			if (--*depth < 0)
+				return -FDT_ERR_NOTFOUND;
+
+			break;
+
+		case FDT_PROP:
+		case FDT_END:
+		case FDT_NOP:
+			break;
+
+		default:
+			return -FDT_ERR_BADSTRUCTURE;
+		}
+	} while (tag != FDT_END);
+
+	if (depth != 0)
+		return -FDT_ERR_BADSTRUCTURE;
+
+	return -FDT_ERR_NOTFOUND;
+}
+
+int fdt_get_next_prop(const void *fdt, int startoffset)
+{
+	uint32_t tag;
+	int offset, nextoffset;
+
+	CHECK_HEADER(fdt);
+
+	if (startoffset >= 0) {
+		tag = fdt_next_tag(fdt, startoffset, &nextoffset);
+		if (tag != FDT_BEGIN_NODE && tag != FDT_PROP)
+			return -FDT_ERR_BADOFFSET;
+	} else {
+		nextoffset = 0;
+	}
+
+	do {
+		offset = nextoffset;
+		tag = fdt_next_tag(fdt, offset, &nextoffset);
+
+		switch (tag) {
+		case FDT_BEGIN_NODE:
+		case FDT_END_NODE:
+			return -FDT_ERR_NOTFOUND;
+
+		case FDT_PROP:
+			return offset;
+
+		case FDT_END:
+		case FDT_NOP:
+			break;
+
+		default:
+			return -FDT_ERR_BADSTRUCTURE;
+		}
+	} while (tag != FDT_END);
+
+	return -FDT_ERR_BADSTRUCTURE;
+}
diff --git a/libfdt/fdt_strerror.c b/libfdt/fdt_strerror.c
index f9d32ef..4e87550 100644
--- a/libfdt/fdt_strerror.c
+++ b/libfdt/fdt_strerror.c
@@ -70,6 +70,7 @@ static struct errtabent errtable[] = {
 	ERRTABENT(FDT_ERR_BADOFFSET),
 	ERRTABENT(FDT_ERR_BADPATH),
 	ERRTABENT(FDT_ERR_BADSTATE),
+	ERRTABENT(FDT_ERR_BADDEPTH),
 
 	ERRTABENT(FDT_ERR_TRUNCATED),
 	ERRTABENT(FDT_ERR_BADMAGIC),
diff --git a/libfdt/libfdt.h b/libfdt/libfdt.h
index d053689..6c5d4a9 100644
--- a/libfdt/libfdt.h
+++ b/libfdt/libfdt.h
@@ -85,25 +85,28 @@
 	/* FDT_ERR_BADSTATE: Function was passed an incomplete device
 	 * tree created by the sequential-write functions, which is
 	 * not sufficiently complete for the requested operation. */
+#define FDT_ERR_BADDEPTH	8
+	/* FDT_ERR_BADDEPTH: Function was passed a negative
+	 * (or otherwise invalid) depth. */
 
 /* Error codes: codes for bad device tree blobs */
-#define FDT_ERR_TRUNCATED	8
+#define FDT_ERR_TRUNCATED	9
 	/* FDT_ERR_TRUNCATED: Structure block of the given device tree
 	 * ends without an FDT_END tag. */
-#define FDT_ERR_BADMAGIC	9
+#define FDT_ERR_BADMAGIC	10
 	/* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
 	 * device tree at all - it is missing the flattened device
 	 * tree magic number. */
-#define FDT_ERR_BADVERSION	10
+#define FDT_ERR_BADVERSION	11
 	/* FDT_ERR_BADVERSION: Given device tree has a version which
 	 * can't be handled by the requested operation.  For
 	 * read-write functions, this may mean that fdt_open_into() is
 	 * required to convert the tree to the expected version. */
-#define FDT_ERR_BADSTRUCTURE	11
+#define FDT_ERR_BADSTRUCTURE	12
 	/* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
 	 * structure block or other serious error (e.g. misnested
 	 * nodes, or subnodes preceding properties). */
-#define FDT_ERR_BADLAYOUT	12
+#define FDT_ERR_BADLAYOUT	13
 	/* FDT_ERR_BADLAYOUT: For read-write functions, the given
 	 * device tree has it's sub-blocks in an order that the
 	 * function can't handle (memory reserve map, then structure,
@@ -111,12 +114,12 @@
 	 * into a form suitable for the read-write operations. */
 
 /* "Can't happen" error indicating a bug in libfdt */
-#define FDT_ERR_INTERNAL	13
+#define FDT_ERR_INTERNAL	14
 	/* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
 	 * Should never be returned, if it is, it indicates a bug in
 	 * libfdt itself. */
 
-#define FDT_ERR_MAX		13
+#define FDT_ERR_MAX		14
 
 /**********************************************************************/
 /* Low-level functions (you probably don't need these)                */
@@ -409,6 +412,41 @@ static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
 }
 
 /**
+ * fdt_getprop_offset - retrieve the value of a given property by offset
+ * @fdt: pointer to the device tree blob
+ * @propoffset: offset of the property to read
+ * @name: pointer to a character pointer (will be overwritten) or NULL
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_getprop() retrieves a pointer to the value of the property
+ * named 'name' of the node at offset nodeoffset (this will be a
+ * pointer to within the device blob itself, not a copy of the value).
+ * If lenp is non-NULL, the length of the property value also
+ * returned, in the integer pointed to by lenp.
+ *
+ * returns:
+ *	pointer to the property's value
+ *		if lenp is non-NULL, *lenp contains the length of the property
+ *		value (>=0)
+ *	NULL, on error
+ *		if lenp is non-NULL, *lenp contains an error code (<0):
+ *		-FDT_ERR_NOTFOUND, node does not have named property
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE,
+ *		-FDT_ERR_BADSTRUCTURE,
+ *		-FDT_ERR_TRUNCATED, standard meanings
+ */
+const void *fdt_getprop_offset(const void *fdt, int propoffset,
+                               const char **name, int *lenp);
+static inline void *fdt_getprop_offset_w(void *fdt, int propoffset,
+                                      const char **name, int *lenp)
+{
+	return (void *)fdt_getprop_offset(fdt, propoffset, name, lenp);
+}
+
+/**
  * fdt_get_phandle - retreive the phandle of a given node
  * @fdt: pointer to the device tree blob
  * @nodeoffset: structure block offset of the node
@@ -651,6 +689,77 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset,
 int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
 				  const char *compatible);
 
+/**
+ * fdt_get_next_node - enumerate children of a node
+ * @fdt: pointer to the device tree blob
+ * @startoffset: only find nodes after this offset
+ * @depth: depth of the node, should be zero upon first call
+ * @recursive: only find immediate children if zero
+ *
+ * fdt_get_next_node() returns the offset of the first node after
+ * startoffset, until depth returns to zero.
+ *
+ * To iterate through all children, the following idiom can be used:
+ *	depth = 0;
+ *	offset = parent node offset;
+ *	while (1) {
+ *		offset = fdt_get_next_node(fdt, offset, &depth, recursive);
+ *		if (offset < 0)
+ *		break;
+ *
+ *		// other code here
+ *	}
+ *
+ * To find all the children of the root node, set the initial
+ * offset to zero.  To find all nodes *including* the root
+ * node, set the initial offset and depth to -1.
+ *
+ * returns:
+ *	structure block offset of the located node (>= 0, >startoffset),
+ *		 on success
+ *	-FDT_ERR_NOTFOUND, no more child nodes exist after startoffset
+ *	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_BADDEPTH, standard meanings
+ */
+int fdt_get_next_node(const void *fdt, int startoffset,
+                      int *depth, int recursive);
+
+/**
+ * fdt_get_next_prop - enumerate properties of a node
+ * @fdt: pointer to the device tree blob
+ * @startoffset: only find nodes after this offset
+ *
+ * fdt_get_next_prop() returns the offset of the first property after
+ * startoffset.
+ *
+ * To iterate through all properties, the following idiom can be used:
+ *	offset = node offset;
+ *	while (1) {
+ *		offset = fdt_get_next_prop(fdt, offset);
+ *		if (offset < 0)
+ *		break;
+ *
+ *		// other code here
+ *	}
+ *
+ * returns:
+ *	structure block offset of the located property (>= 0, >startoffset),
+ *		 on success
+ *	-FDT_ERR_NOTFOUND, no more properties exist in the current node
+ *		after startoffset
+ *	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *		or a PROP tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_get_next_prop(const void *fdt, int startoffset);
+
 /**********************************************************************/
 /* Write-in-place functions                                           */
 /**********************************************************************/
-- 
1.5.3

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox