LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: dtc: Add testcases for tree checks
From: Scott Wood @ 2007-11-20 22:23 UTC (permalink / raw)
  To: Jon Loeliger, linuxppc-dev
In-Reply-To: <20071120220309.GB13156@localhost.localdomain>

David Gibson wrote:
> On Tue, Nov 20, 2007 at 09:09:17AM -0600, Jon Loeliger wrote:
>> Actually, this is the official third time now that it would have
>> been significantly nicer had you been using git for patches as
>> it does correctly handle excute permissions properly in patches.
> 
> Well, yes.  But, IMO, every time anyone other that you or I has
> commented on one of these patches as it goes past counts as an
> occasion when it's better that I've been using patches, rather than
> pushing to you direct with git.

Generating patches with "git-format-patch -M" isn't the same as pushing 
directly...

-Scot

^ permalink raw reply

* Please pull from 'for-2.6.24' branch (fwd)
From: Kumar Gala @ 2007-11-20 23:38 UTC (permalink / raw)
  To: linuxppc-dev

didn't cc linuxppc-dev.

---------- Forwarded message ----------
Date: Tue, 20 Nov 2007 15:40:57 -0600 (CST)
From: Kumar Gala <galak@kernel.crashing.org>
To: Paul Mackerras <paulus@samba.org>
Subject: Please pull from 'for-2.6.24' branch

Please pull from 'for-2.6.24' branch of

	master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc.git for-2.6.24

to receive the following updates:

 arch/powerpc/boot/dts/mpc832x_mds.dts        |    7 ++
 arch/powerpc/boot/dts/mpc834x_mds.dts        |    9 ++
 arch/powerpc/boot/dts/mpc836x_mds.dts        |    9 ++
 arch/powerpc/configs/mpc832x_mds_defconfig   |   48 ++++++++++++++
 arch/powerpc/configs/mpc832x_rdb_defconfig   |   41 +++++++++++-
 arch/powerpc/configs/mpc834x_itx_defconfig   |    2
 arch/powerpc/configs/mpc834x_itxgp_defconfig |   88 ++++++++++++++++++++++++++-
 arch/powerpc/configs/mpc834x_mds_defconfig   |   48 ++++++++++++++
 arch/powerpc/configs/mpc836x_mds_defconfig   |   48 ++++++++++++++
 arch/powerpc/configs/mpc8568mds_defconfig    |   48 ++++++++++++++
 arch/powerpc/platforms/83xx/mpc832x_mds.c    |   24 -------
 arch/powerpc/platforms/83xx/mpc832x_rdb.c    |   14 ++--
 arch/powerpc/platforms/83xx/mpc834x_mds.c    |   24 -------
 arch/powerpc/platforms/83xx/mpc836x_mds.c    |   24 -------
 14 files changed, 346 insertions(+), 88 deletions(-)

Anton Vorontsov (2):
      [POWERPC] 83xx: MPC832x RDB - remove spidev stub, use mmc_spi
      [POWERPC] 83xx: Update mpc832x_rdb_defconfig to enable MMC-over-SPI

Grant Likely (1):
      [POWERPC] 83xx: Update mpc8349emitx(gp) defconfig for USB

Kim Phillips (1):
      [POWERPC] 8xxx: MDS board RTC fixes

^ permalink raw reply

* Re: [PATCH try2] powerpc: Add support for PORTA and PORTB odr registers
From: Scott Wood @ 2007-11-20 23:48 UTC (permalink / raw)
  To: Jochen Friedrich; +Cc: paulus, linux-kernel, linuxppc-embedded
In-Reply-To: <474316A4.4010807@scram.de>

Jochen Friedrich wrote:
> PORTA and PORTB have odr registers, as well. However, the PORTB odr
> register is only 16bit.
> 
> Signed-off-by: Jochen Friedrich <jochen@scram.de>

Acked-by: Scott Wood <scottwood@freescale.com>

BTW, you may want to send the patches to linuxppc-dev rather than 
linuxppc-embedded...  Despite what MAINTAINERS says, the former is where 
most patches get posted.

-Scott

^ permalink raw reply

* dtc: Remove some redundant testcases
From: David Gibson @ 2007-11-21  0:29 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev

This patch removes a number of testcases from the testsuite that are
extremely unlikely to find any bugs that won't be found by the other
tests.  This speeds up the testsuite.

	- Both loops across the various tree block layouts run the
tree1_tests on the basic mangled tree.  This is completely redundant,
so remove the second copy. This removes 456 testcases.

	- We currently run tree1_tests on various trees manipulated by
move_and_save.  We replace those with just a dtbs_equal_ordered test
to check that the manipulated tree is equal to the original.  What
we're testing here is that fdt_move() operates correctly - it's very
unlikely it would succeed well enough for the ordered_equal test to
succeed, but the tree1_tests would fail on the result.  This removes
162 testcases.

	- Currently we re-ordered with mangle-layout both the basic
test_tree1.dtb and sw_tree1.test.dtb.  Since we've already checked
that these dtbs are equivalent with dtbs_ordered_equal, it's very
unlikely that the tests would fail on one but not the other.
Therefore reduce this to only using test_tree1.dtb.  This removes 828
testcases.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Index: dtc/tests/run_tests.sh
===================================================================
--- dtc.orig/tests/run_tests.sh	2007-11-21 00:13:40.000000000 +1100
+++ dtc/tests/run_tests.sh	2007-11-21 00:19:11.000000000 +1100
@@ -76,13 +76,13 @@
     for tree in test_tree1.dtb sw_tree1.test.dtb unfinished_tree1.test.dtb; do
 	rm -f moved.$tree shunted.$tree deshunted.$tree
 	run_test move_and_save $tree
-	tree1_tests moved.$tree
-	tree1_tests shunted.$tree
-	tree1_tests deshunted.$tree
+	run_test dtbs_equal_ordered $tree moved.$tree
+	run_test dtbs_equal_ordered $tree shunted.$tree
+	run_test dtbs_equal_ordered $tree deshunted.$tree
     done
 
     # v16 and alternate layout tests
-    for tree in test_tree1.dtb sw_tree1.test.dtb; do
+    for tree in test_tree1.dtb; do
 	for version in 17 16; do
 	    for layout in $ALL_LAYOUTS; do
 		run_test mangle-layout $tree $version $layout
@@ -93,13 +93,12 @@
     done
 
     # Read-write tests
-    for basetree in test_tree1.dtb sw_tree1.test.dtb; do
+    for basetree in test_tree1.dtb; do
 	for version in 17 16; do
 	    for layout in $ALL_LAYOUTS; do
 		tree=v$version.$layout.$basetree
 		rm -f opened.$tree repacked.$tree
 		run_test open_pack $tree
-		tree1_tests $tree
 		tree1_tests opened.$tree
 		tree1_tests repacked.$tree
 

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* [PATCH] [POWERPC] Update iseries_defconfig
From: Stephen Rothwell @ 2007-11-21  0:45 UTC (permalink / raw)
  To: paulus; +Cc: ppc-dev

The notable changes hare are the enabling of NO_HZ and HIGH_RES_TIMERS.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/powerpc/configs/iseries_defconfig |  123 +++++++++++++++++---------------
 1 files changed, 64 insertions(+), 59 deletions(-)

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --git a/arch/powerpc/configs/iseries_defconfig b/arch/powerpc/configs/iseries_defconfig
index d78e3a6..4a87745 100644
--- a/arch/powerpc/configs/iseries_defconfig
+++ b/arch/powerpc/configs/iseries_defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.23-rc4
-# Thu Aug 30 16:37:16 2007
+# Linux kernel version: 2.6.24-rc3
+# Wed Nov 21 11:19:59 2007
 #
 CONFIG_PPC64=y
 
@@ -11,6 +11,7 @@ CONFIG_PPC64=y
 # CONFIG_POWER4_ONLY is not set
 CONFIG_POWER3=y
 CONFIG_POWER4=y
+# CONFIG_TUNE_CELL is not set
 CONFIG_PPC_FPU=y
 # CONFIG_ALTIVEC is not set
 CONFIG_PPC_STD_MMU=y
@@ -19,8 +20,13 @@ CONFIG_VIRT_CPU_ACCOUNTING=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=32
 CONFIG_64BIT=y
+CONFIG_WORD_SIZE=64
 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
@@ -63,12 +69,17 @@ 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=y
 CONFIG_AUDITSYSCALL=y
+CONFIG_AUDIT_TREE=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=17
-# CONFIG_CPUSETS is not set
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
 CONFIG_BLK_DEV_INITRD=y
@@ -89,7 +100,6 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
@@ -110,6 +120,7 @@ CONFIG_STOP_MACHINE=y
 CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 CONFIG_BLK_DEV_BSG=y
+CONFIG_BLOCK_COMPAT=y
 
 #
 # IO Schedulers
@@ -128,7 +139,6 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
 # Platform support
 #
 CONFIG_PPC_MULTIPLATFORM=y
-# CONFIG_EMBEDDED6xx is not set
 # CONFIG_PPC_82xx is not set
 # CONFIG_PPC_83xx is not set
 # CONFIG_PPC_86xx is not set
@@ -172,6 +182,10 @@ CONFIG_GENERIC_IOMAP=y
 #
 # Kernel options
 #
+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
@@ -201,6 +215,7 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=1
@@ -227,11 +242,8 @@ 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_PCI_DEBUG is not set
-
-#
-# PCCARD (PCMCIA/CardBus) support
-#
 # CONFIG_PCCARD is not set
 # CONFIG_HOTPLUG_PCI is not set
 CONFIG_KERNEL_START=0xc000000000000000
@@ -271,6 +283,7 @@ CONFIG_INET_TUNNEL=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=m
+# CONFIG_INET_LRO is not set
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
@@ -338,6 +351,7 @@ CONFIG_NETFILTER_XT_MATCH_SCTP=m
 # CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set
 CONFIG_NETFILTER_XT_MATCH_STRING=m
 CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
+CONFIG_NETFILTER_XT_MATCH_TIME=m
 # CONFIG_NETFILTER_XT_MATCH_U32 is not set
 # CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set
 
@@ -403,10 +417,6 @@ CONFIG_LLC=y
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 CONFIG_NET_CLS_ROUTE=y
 
@@ -436,6 +446,7 @@ CONFIG_NET_CLS_ROUTE=y
 #
 # Generic Driver Options
 #
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_STANDALONE=y
 CONFIG_PREVENT_FIRMWARE_BUILD=y
 CONFIG_FW_LOADER=m
@@ -508,6 +519,7 @@ CONFIG_SCSI_FC_ATTRS=y
 CONFIG_SCSI_SAS_ATTRS=m
 CONFIG_SCSI_SAS_LIBSAS=m
 CONFIG_SCSI_SAS_LIBSAS_DEBUG=y
+CONFIG_SCSI_SRP_ATTRS=m
 CONFIG_SCSI_LOWLEVEL=y
 # CONFIG_ISCSI_TCP is not set
 # CONFIG_BLK_DEV_3W_XXXX_RAID is not set
@@ -559,14 +571,8 @@ CONFIG_DM_MIRROR=m
 CONFIG_DM_ZERO=m
 # CONFIG_DM_MULTIPATH is not set
 # CONFIG_DM_DELAY is not set
-
-#
-# Fusion MPT device support
-#
+# CONFIG_DM_UEVENT is not set
 # CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -582,6 +588,8 @@ CONFIG_BONDING=m
 # CONFIG_MACVLAN is not set
 # CONFIG_EQUALIZER is not set
 CONFIG_TUN=m
+# CONFIG_VETH is not set
+# CONFIG_IP1000 is not set
 # CONFIG_ARCNET is not set
 # CONFIG_PHYLIB is not set
 CONFIG_NET_ETHERNET=y
@@ -592,6 +600,10 @@ CONFIG_MII=y
 # 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=y
 CONFIG_PCNET32_NAPI=y
@@ -599,7 +611,6 @@ CONFIG_PCNET32_NAPI=y
 # CONFIG_ADAPTEC_STARFIRE is not set
 # CONFIG_B44 is not set
 # CONFIG_FORCEDETH is not set
-# CONFIG_DGRS is not set
 # CONFIG_EEPRO100 is not set
 CONFIG_E100=y
 # CONFIG_FEALNX is not set
@@ -619,6 +630,7 @@ CONFIG_ACENIC=m
 CONFIG_E1000=m
 # 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
@@ -626,6 +638,7 @@ CONFIG_E1000=m
 # 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
@@ -634,12 +647,15 @@ CONFIG_E1000=m
 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_PASEMI_MAC is not set
 # CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
 CONFIG_TR=y
 CONFIG_IBMOL=y
 # CONFIG_3C359 is not set
@@ -669,6 +685,7 @@ CONFIG_SLHC=m
 # CONFIG_NET_FC is not set
 # CONFIG_SHAPER is not set
 CONFIG_NETCONSOLE=y
+# CONFIG_NETCONSOLE_DYNAMIC is not set
 CONFIG_NETPOLL=y
 CONFIG_NETPOLL_TRAP=y
 CONFIG_NET_POLL_CONTROLLER=y
@@ -690,7 +707,6 @@ CONFIG_INPUT_MOUSEDEV=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 # CONFIG_INPUT_EVDEV is not set
 # CONFIG_INPUT_EVBUG is not set
 
@@ -736,14 +752,11 @@ CONFIG_LEGACY_PTY_COUNT=256
 CONFIG_HVC_DRIVER=y
 CONFIG_HVC_ISERIES=y
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM 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_AGP is not set
-# CONFIG_DRM is not set
 CONFIG_RAW_DRIVER=y
 CONFIG_MAX_RAW_DEVS=256
 # CONFIG_HANGCHECK_TIMER is not set
@@ -759,6 +772,13 @@ CONFIG_DEVPORT=y
 # CONFIG_W1 is not set
 # CONFIG_POWER_SUPPLY is not set
 # CONFIG_HWMON is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Sonics Silicon Backplane
+#
+CONFIG_SSB_POSSIBLE=y
+# CONFIG_SSB is not set
 
 #
 # Multifunction device drivers
@@ -775,16 +795,17 @@ CONFIG_DEVPORT=y
 #
 # Graphics support
 #
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+# CONFIG_VIDEO_OUTPUT_CONTROL is not set
+# CONFIG_FB is not set
 # CONFIG_BACKLIGHT_LCD_SUPPORT is not set
 
 #
 # Display device support
 #
 # CONFIG_DISPLAY_SUPPORT is not set
-# CONFIG_VGASTATE is not set
-# CONFIG_VIDEO_OUTPUT_CONTROL is not set
-# CONFIG_FB is not set
-# CONFIG_FB_IBM_GXT4500 is not set
 
 #
 # Console display driver support
@@ -806,19 +827,6 @@ CONFIG_DUMMY_CONSOLE=y
 # CONFIG_RTC_CLASS is not set
 
 #
-# DMA Engine support
-#
-# CONFIG_DMA_ENGINE is not set
-
-#
-# DMA Clients
-#
-
-#
-# DMA Devices
-#
-
-#
 # Userspace I/O
 #
 # CONFIG_UIO is not set
@@ -902,7 +910,6 @@ CONFIG_TMPFS=y
 CONFIG_TMPFS_POSIX_ACL=y
 # CONFIG_HUGETLBFS is not set
 # CONFIG_HUGETLB_PAGE is not set
-CONFIG_RAMFS=y
 CONFIG_CONFIGFS_FS=m
 
 #
@@ -921,10 +928,7 @@ CONFIG_CRAMFS=y
 # CONFIG_QNX4FS_FS is not set
 # CONFIG_SYSV_FS is not set
 # CONFIG_UFS_FS is not set
-
-#
-# Network File Systems
-#
+CONFIG_NETWORK_FILESYSTEMS=y
 CONFIG_NFS_FS=y
 CONFIG_NFS_V3=y
 CONFIG_NFS_V3_ACL=y
@@ -963,10 +967,6 @@ CONFIG_CIFS_POSIX=y
 #
 # CONFIG_PARTITION_ADVANCED is not set
 CONFIG_MSDOS_PARTITION=y
-
-#
-# Native Language Support
-#
 CONFIG_NLS=y
 CONFIG_NLS_DEFAULT="iso8859-1"
 CONFIG_NLS_CODEPAGE_437=y
@@ -1007,10 +1007,6 @@ CONFIG_NLS_ISO8859_1=y
 # CONFIG_NLS_KOI8_R is not set
 # CONFIG_NLS_KOI8_U is not set
 # CONFIG_NLS_UTF8 is not set
-
-#
-# Distributed Lock Manager
-#
 CONFIG_DLM=m
 # CONFIG_DLM_DEBUG is not set
 # CONFIG_UCC_SLOW is not set
@@ -1035,17 +1031,16 @@ CONFIG_PLIST=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT=y
 CONFIG_HAS_DMA=y
-
-#
-# Instrumentation Support
-#
+CONFIG_INSTRUMENTATION=y
 # CONFIG_PROFILING is not set
 # CONFIG_KPROBES is not set
+# CONFIG_MARKERS is not set
 
 #
 # Kernel hacking
 #
 # CONFIG_PRINTK_TIME is not set
+CONFIG_ENABLE_WARN_DEPRECATED=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_MAGIC_SYSRQ=y
 # CONFIG_UNUSED_SYMBOLS is not set
@@ -1069,14 +1064,18 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_SG is not set
 # CONFIG_FORCED_INLINING is not set
+# CONFIG_BOOT_PRINTK_DELAY is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
 CONFIG_DEBUG_STACKOVERFLOW=y
 CONFIG_DEBUG_STACK_USAGE=y
 # CONFIG_DEBUG_PAGEALLOC is not set
 # CONFIG_DEBUGGER is not set
 CONFIG_IRQSTACKS=y
+# CONFIG_VIRQ_DEBUG is not set
 # CONFIG_BOOTX_TEXT is not set
 # CONFIG_PPC_EARLY_DEBUG is not set
 
@@ -1085,8 +1084,10 @@ CONFIG_IRQSTACKS=y
 #
 # CONFIG_KEYS is not set
 # CONFIG_SECURITY is not set
+# CONFIG_SECURITY_FILE_CAPABILITIES is not set
 CONFIG_CRYPTO=y
 CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_AEAD=m
 CONFIG_CRYPTO_BLKCIPHER=y
 CONFIG_CRYPTO_HASH=y
 CONFIG_CRYPTO_MANAGER=y
@@ -1105,6 +1106,7 @@ CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_CBC=y
 CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_XTS is not set
 # CONFIG_CRYPTO_CRYPTD is not set
 CONFIG_CRYPTO_DES=y
 # CONFIG_CRYPTO_FCRYPT is not set
@@ -1119,9 +1121,12 @@ CONFIG_CRYPTO_TEA=m
 CONFIG_CRYPTO_ARC4=m
 CONFIG_CRYPTO_KHAZAD=m
 CONFIG_CRYPTO_ANUBIS=m
+CONFIG_CRYPTO_SEED=m
 CONFIG_CRYPTO_DEFLATE=m
 CONFIG_CRYPTO_MICHAEL_MIC=m
 CONFIG_CRYPTO_CRC32C=m
 # CONFIG_CRYPTO_CAMELLIA is not set
 CONFIG_CRYPTO_TEST=m
+CONFIG_CRYPTO_AUTHENC=m
 # CONFIG_CRYPTO_HW is not set
+# CONFIG_PPC_CLOCK is not set
-- 
1.5.3.6


-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

^ permalink raw reply related

* dtc: Add valgrind support to testsuite
From: David Gibson @ 2007-11-21  0:56 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev

This patch adds some options to the run_tests.sh script allowing it to
run all the testcases under valgrind to check for pointer corruption
bugs and memory leaks.  Invoking "make checkm" will run the testsuite
with valgrind.

It include a mechanism for specifying valgrind errors to be suppressed
on a per-testcase basis, and adds a couple of such suppression files
for the mangle-layout and open_pack testcases which dump for use by
other testcases a buffer which may contain uninitialized sections.  We
use suppressions rather than initializing the buffer so that valgrind
will catch any internal access s to the uninitialized data, which
would be a bug.

The patch also fixes one genuine bug caught by valgrind -
_packblocks() in fdt_rw.c was using memcpy() where it should have been
using memmove().

At present the valgrinding won't do anything useful for testcases
invoked via a shell script - which includes all the dtc testcases.  I
plan to fix that later.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Index: dtc/tests/run_tests.sh
===================================================================
--- dtc.orig/tests/run_tests.sh	2007-11-21 11:29:28.000000000 +1100
+++ dtc/tests/run_tests.sh	2007-11-21 11:44:55.000000000 +1100
@@ -2,16 +2,26 @@
 
 export QUIET_TEST=1
 
+export VALGRIND=
+VGCODE=126
+
 tot_tests=0
 tot_pass=0
 tot_fail=0
 tot_config=0
+tot_vg=0
 tot_strange=0
 
 run_test () {
     tot_tests=$[tot_tests + 1]
     echo -n "$@:	"
-    if "./$@"; then
+    VGLOCAL="$VALGRIND"
+    if [ -n "$VALGRIND" ]; then
+	if [ -f $1.supp ]; then
+	    VGLOCAL="$VGLOCAL --suppressions=$1.supp"
+	fi
+    fi
+    if $VGLOCAL "./$@"; then
 	tot_pass=$[tot_pass + 1]
     else
 	ret="$?"
@@ -19,6 +29,8 @@
 	    tot_config=$[tot_config + 1]
 	elif [ "$ret" == "2" ]; then
 	    tot_fail=$[tot_fail + 1]
+	elif [ "$ret" == "$VGCODE" ]; then
+	    tot_vg=$[tot_vg + 1]
 	else
 	    tot_strange=$[tot_strange + 1]
 	fi
@@ -148,7 +160,7 @@
     run_test dtc-checkfails.sh -I dts -O dtb minusone-phandle.dts
 }
 
-while getopts "vdt:" ARG ; do
+while getopts "vt:m" ARG ; do
     case $ARG in
 	"v")
 	    unset QUIET_TEST
@@ -156,6 +168,9 @@
 	"t")
 	    TESTSETS=$OPTARG
 	    ;;
+	"m")
+	    VALGRIND="valgrind --tool=memcheck -q --error-exitcode=$VGCODE"
+	    ;;
     esac
 done
 
@@ -182,6 +197,9 @@
 echo -e "*                PASS:	$tot_pass"
 echo -e "*                FAIL:	$tot_fail"
 echo -e "*   Bad configuration:	$tot_config"
+if [ -n "$VALGRIND" ]; then
+    echo -e "*    valgrind errors:	$tot_vg"
+fi
 echo -e "* Strange test result:	$tot_strange"
 echo -e "**********"
 
Index: dtc/tests/Makefile.tests
===================================================================
--- dtc.orig/tests/Makefile.tests	2007-11-21 11:29:29.000000000 +1100
+++ dtc/tests/Makefile.tests	2007-11-21 11:29:39.000000000 +1100
@@ -26,7 +26,7 @@
 TESTS_DEPFILES = $(TESTS:%=%.d) \
 	$(addprefix $(TESTS_PREFIX),testutils.d trees.d dumptrees.d)
 
-TESTS_CLEANFILES_L =  *.output vgcore.* *.dtb *.test.dts
+TESTS_CLEANFILES_L =  *.output vglog.* vgcore.* *.dtb *.test.dts
 TESTS_CLEANFILES = $(TESTS_CLEANFILES_L:%=$(TESTS_PREFIX)%)
 
 BIN += $(TESTS) $(TESTS_PREFIX)dumptrees
@@ -52,6 +52,9 @@
 check:	tests dtc
 	cd $(TESTS_PREFIX); ./run_tests.sh
 
+checkm: tests dtc
+	cd $(TESTS_PREFIX); ./run_tests.sh -m 2>&1 | tee vglog.$$$$
+
 checkv:	tests dtc
 	cd $(TESTS_PREFIX); ./run_tests.sh -v
 
Index: dtc/libfdt/fdt_rw.c
===================================================================
--- dtc.orig/libfdt/fdt_rw.c	2007-11-21 11:29:28.000000000 +1100
+++ dtc/libfdt/fdt_rw.c	2007-11-21 11:29:39.000000000 +1100
@@ -358,12 +358,12 @@
 	memmove(buf + mem_rsv_off, fdt + fdt_off_mem_rsvmap(fdt), mem_rsv_size);
 	fdt_set_off_mem_rsvmap(buf, mem_rsv_off);
 
-	memcpy(buf + struct_off, fdt + fdt_off_dt_struct(fdt), struct_size);
+	memmove(buf + struct_off, fdt + fdt_off_dt_struct(fdt), struct_size);
 	fdt_set_off_dt_struct(buf, struct_off);
 	fdt_set_size_dt_struct(buf, struct_size);
 
-	memcpy(buf + strings_off, fdt + fdt_off_dt_strings(fdt),
-	       fdt_size_dt_strings(fdt));
+	memmove(buf + strings_off, fdt + fdt_off_dt_strings(fdt),
+		fdt_size_dt_strings(fdt));
 	fdt_set_off_dt_strings(buf, strings_off);
 	fdt_set_size_dt_strings(buf, fdt_size_dt_strings(fdt));
 }
Index: dtc/tests/open_pack.supp
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ dtc/tests/open_pack.supp	2007-11-21 11:29:39.000000000 +1100
@@ -0,0 +1,7 @@
+{
+   opened blob dumps uninitialized data
+   Memcheck:Param
+   write(buf)
+   obj:/lib/ld-2.6.1.so
+   fun:main
+}
Index: dtc/tests/mangle-layout.supp
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ dtc/tests/mangle-layout.supp	2007-11-21 11:34:33.000000000 +1100
@@ -0,0 +1,7 @@
+{
+   uninitialized alignment gaps can be dumped to output
+   Memcheck:Param
+   write(buf)
+   obj:/lib/ld-2.6.1.so
+   fun:main
+}

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* [PATCH] powerpc/pseries: tell phyp to auto-restart
From: Linas Vepstas @ 2007-11-21  2:09 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, strosake


The pseries hypervisor attempts to detect and prevent an 
infinite loop of kernel crashes and auto-reboots. It does 
so by refusing to auto-reboot unless we indicate that the
current boot was sucessful.  So, indicate success late in
the boot sequence.

Signed-off-by: Linas Vepstas <linas@austin.ibm.com>

----
Sigh. This is a side-effect of the patch I sent yesterday.
Its supposed to simplify the management large numbers of 
partitions. 

 arch/powerpc/platforms/pseries/setup.c |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

Index: linux-2.6.24-rc3-git1/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- linux-2.6.24-rc3-git1.orig/arch/powerpc/platforms/pseries/setup.c	2007-11-20 18:37:14.000000000 -0600
+++ linux-2.6.24-rc3-git1/arch/powerpc/platforms/pseries/setup.c	2007-11-20 19:08:12.000000000 -0600
@@ -491,6 +491,37 @@ void pSeries_power_off(void)
 	for (;;);
 }
 
+/**
+ * pSeries_auto_restart - tell hypervisor that boot succeeded.
+ *
+ * The pseries hypervisor attempts to detect and prevent an
+ * infinite loop of kernel crashes and auto-reboots. It does
+ * so by refusing to auto-reboot unless we indicate that the
+ * current boot was sucessful.  So, indicate success late in
+ * the boot sequence.
+ */
+static int __init pSeries_auto_restart(void)
+{
+	static char buff[3]; /* static so that its in RMO region */
+	int rc;
+	int token = rtas_token("ibm,set-system-parameter");
+	if (!token)
+		return 0;
+
+	/* partition_auto_restart is 21; set to to 1 to auto-restart the OS. */
+	buff[0] = 0;
+	buff[1] = 1; /* length */
+	buff[2] = 1; /* value */
+	do {
+		rc = rtas_call (token, 2, 1, NULL, 21, buff);
+	} while (rtas_busy_delay(rc));
+	if (rc)
+		printk(KERN_INFO "pSeries_auto_restart(): "
+		       "unable to setup autorestart, rc=%d\n", rc);
+	return 0;
+}
+late_initcall(pSeries_auto_restart);
+
 #ifndef CONFIG_PCI
 void pSeries_final_fixup(void) { }
 #endif

^ permalink raw reply

* [PATCH] sys_indirect kernel implementation for PowerPC
From: Paul Mackerras @ 2007-11-21  3:08 UTC (permalink / raw)
  To: Ulrich Drepper, linuxppc-dev

This implements sys_indirect for 32-bit and 64-bit powerpc machines,
including a 32-bit compatibility implementation for 64-bit powerpc.
I decided to use assembly language for call_syscall because on 64-bit
powerpc the system call table has the addresses of the function text
rather than pointers to function descriptors; hence the system call
functions can't be called from C via the system call table.

Signed-off-by: Paul Mackerras <paulus@samba.org>
---
This patch applies on top of Ulrich Drepper's series adding the
generic and x86-specific code for sys_indirect.

diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 69a91bd..fd6781c 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -461,6 +461,25 @@ ppc_swapcontext:
 	b	sys_swapcontext
 
 /*
+ * long call_compat_syscall(struct indirect_registers32 *regs)
+ * This function assumes that regs->syscall_nr has already been validated.
+ */
+_GLOBAL(call_syscall)
+	lwz	r0,0(r3)	/* system call number */
+	lis	r11,sys_call_table@ha
+	addi	r11,r11,sys_call_table@l
+	slwi	r0,r0,2
+	lwzx	r10,r11,r0
+	mtctr	r10
+	lwz	r4,8(r3)
+	lwz	r5,12(r3)
+	lwz	r6,16(r3)
+	lwz	r7,20(r3)
+	lwz	r8,24(r3)
+	lwz	r3,4(r3)
+	bctr
+
+/*
  * Top-level page fault handling.
  * This is in assembler because if do_page_fault tells us that
  * it is a bad kernel page fault, we want to save the non-volatile
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 148a354..516ee70 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -315,6 +315,43 @@ _GLOBAL(ret_from_fork)
 	b	syscall_exit
 
 /*
+ * long call_syscall(struct indirect_registers *regs)
+ * This function assumes that regs->syscall_nr has already been validated.
+ */
+_GLOBAL(call_syscall)
+	ld	r11,.SYS_CALL_TABLE@toc(2)
+	ld	r0,0(r3)	/* system call number */
+	sldi	r0,r0,4
+	ldx	r10,r11,r0
+	mtctr	r10
+	ld	r4,16(r3)
+	ld	r5,24(r3)
+	ld	r6,32(r3)
+	ld	r7,40(r3)
+	ld	r8,48(r3)
+	ld	r3,8(r3)
+	bctr
+
+/*
+ * long call_compat_syscall(struct indirect_registers32 *regs)
+ * This function assumes that regs->syscall_nr has already been validated.
+ */
+_GLOBAL(call_compat_syscall)
+	ld	r11,.SYS_CALL_TABLE@toc(2)
+	lwz	r0,0(r3)	/* system call number */
+	sldi	r0,r0,4
+	addi	r11,r11,8
+	ldx	r10,r11,r0
+	mtctr	r10
+	lwz	r4,8(r3)
+	lwz	r5,12(r3)
+	lwz	r6,16(r3)
+	lwz	r7,20(r3)
+	lwz	r8,24(r3)
+	lwz	r3,4(r3)
+	bctr
+
+/*
  * This routine switches between two different tasks.  The process
  * state of one is saved on its kernel stack.  Then the state
  * of the other is restored from its kernel stack.  The memory
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index 4a4f5c6..fcaf0b2 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -826,3 +826,37 @@ asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags,
 
 	return sys_sync_file_range(fd, offset, nbytes, flags);
 }
+
+long compat_sys_indirect(struct indirect_registers32 __user *userregs,
+			 void __user *userparams, size_t paramslen,
+			 int flags)
+{
+	struct indirect_registers32 regs;
+	long result;
+
+	if (unlikely(flags != 0))
+		return -EINVAL;
+
+	if (copy_from_user(&regs, userregs, sizeof(regs)))
+		return -EFAULT;
+
+	switch (regs.syscall_nr) {
+#define INDSYSCALL(name) __NR_##name
+#include <linux/indirect.h>
+		break;
+
+	default:
+		return -EINVAL;
+	}
+
+	if (paramslen > sizeof(union indirect_params))
+		return -EINVAL;
+
+	result = -EFAULT;
+	if (!copy_from_user(&current->indirect_params, userparams, paramslen))
+		result = call_compat_syscall(&regs);
+
+	memset(&current->indirect_params, '\0', paramslen);
+
+	return result;
+}
diff --git a/include/asm-powerpc/indirect.h b/include/asm-powerpc/indirect.h
new file mode 100644
index 0000000..fcc6729
--- /dev/null
+++ b/include/asm-powerpc/indirect.h
@@ -0,0 +1,32 @@
+#ifndef _ASM_POWERPC_INDIRECT_H_
+#define _ASM_POWERPC_INDIRECT_H_
+/*
+ * Copyright 2007 Paul Mackerras <paulus@au1.ibm.com>, IBM Corporation.
+ *
+ * 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.
+ */
+
+struct indirect_registers {
+	unsigned long syscall_nr;
+	unsigned long args[6];
+};
+
+extern long call_syscall(struct indirect_registers *regs);
+
+#define INDIRECT_SYSCALL(regs)		(regs)->syscall_nr
+#define CALL_INDIRECT(regs)		call_syscall(regs)
+
+#ifdef CONFIG_PPC64
+struct indirect_registers32 {
+	unsigned int syscall_nr;
+	unsigned int args[6];
+};
+
+extern long call_compat_syscall(struct indirect_registers32 *regs);
+
+#endif /* CONFIG_PPC64 */
+
+#endif /* _ASM_POWERPC_INDIRECT_H_ */
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h
index 11d5383..de2f4d7 100644
--- a/include/asm-powerpc/systbl.h
+++ b/include/asm-powerpc/systbl.h
@@ -313,3 +313,4 @@ COMPAT_SYS_SPU(timerfd)
 SYSCALL_SPU(eventfd)
 COMPAT_SYS_SPU(sync_file_range2)
 COMPAT_SYS(fallocate)
+COMPAT_SYS(indirect)
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index 97d82b6..400e4a6 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -332,10 +332,11 @@
 #define __NR_eventfd		307
 #define __NR_sync_file_range2	308
 #define __NR_fallocate		309
+#define __NR_indirect		310
 
 #ifdef __KERNEL__
 
-#define __NR_syscalls		310
+#define __NR_syscalls		311
 
 #define __NR__exit __NR_exit
 #define NR_syscalls	__NR_syscalls

^ permalink raw reply related

* Re: [PATCH] sys_indirect kernel implementation for PowerPC
From: Stephen Rothwell @ 2007-11-21  3:29 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Ulrich Drepper
In-Reply-To: <18243.41278.72798.100000@cargo.ozlabs.ibm.com>

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

On Wed, 21 Nov 2007 14:08:46 +1100 Paul Mackerras <paulus@samba.org> wrote:
>
> +++ b/arch/powerpc/kernel/entry_32.S
> @@ -461,6 +461,25 @@ ppc_swapcontext:
>  	b	sys_swapcontext
>  
>  /*
> + * long call_compat_syscall(struct indirect_registers32 *regs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Presumably a copy and paste glitch.

-- 
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 v7 3/9] add Freescale SerDes PHY support
From: Kumar Gala @ 2007-11-21  3:31 UTC (permalink / raw)
  To: Li Yang; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <fa686aa40710190835t4329d52bt74fb3b8f30b25847@mail.gmail.com>


On Oct 19, 2007, at 10:35 AM, Grant Likely wrote:

> On 10/19/07, Li Yang <leoli@freescale.com> wrote:
>> The SerDes(serializer/deserializer) PHY block is a new SoC block used
>> in Freescale chips to support multiple serial interfaces, such as PCI
>> Express, SGMII, SATA.
>
> This looks like board setup behaviour.  Shouldn't setting this up be
> the responsibility firmware?  And failing that, I think it should be
> done directly by the platform setup function (in other words; make it
> a helper function and call it at board setup time).  Besides, you want
> to provide guarantees that the board is setup correctly before the
> device driver that uses it gets probed.
>
> Cheers,
> g.

Upon further review of all this I don't think this belongs in the  
kernel at all.  This is one time setup and should be done in firmware.

- k

^ permalink raw reply

* Re: [PATCH] sys_indirect kernel implementation for PowerPC
From: Stephen Rothwell @ 2007-11-21  3:42 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Ulrich Drepper
In-Reply-To: <18243.41278.72798.100000@cargo.ozlabs.ibm.com>

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

On Wed, 21 Nov 2007 14:08:46 +1100 Paul Mackerras <paulus@samba.org> wrote:
>
> +#ifdef CONFIG_PPC64

Use CONFIG_COMPAT?

> +struct indirect_registers32 {
> +	unsigned int syscall_nr;
> +	unsigned int args[6];

These could (should?) be compat_ulong_t

> +++ b/include/asm-powerpc/systbl.h
> @@ -313,3 +313,4 @@ COMPAT_SYS_SPU(timerfd)
>  SYSCALL_SPU(eventfd)
>  COMPAT_SYS_SPU(sync_file_range2)
>  COMPAT_SYS(fallocate)
> +COMPAT_SYS(indirect)

Do the SPUs want this?

-- 
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 v7 3/9] add Freescale SerDes PHY support
From: Li Yang @ 2007-11-21  3:48 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <68738B73-92D6-459F-88A7-BBE66967A3A0@kernel.crashing.org>

> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]=20
> Sent: Wednesday, November 21, 2007 11:32 AM
> To: Li Yang
> Cc: Paul Mackerras; linuxppc-dev@ozlabs.org; Grant Likely
> Subject: Re: [PATCH v7 3/9] add Freescale SerDes PHY support
>=20
>=20
> On Oct 19, 2007, at 10:35 AM, Grant Likely wrote:
>=20
> > On 10/19/07, Li Yang <leoli@freescale.com> wrote:
> >> The SerDes(serializer/deserializer) PHY block is a new SoC=20
> block used=20
> >> in Freescale chips to support multiple serial interfaces,=20
> such as PCI=20
> >> Express, SGMII, SATA.
> >
> > This looks like board setup behaviour.  Shouldn't setting=20
> this up be=20
> > the responsibility firmware?  And failing that, I think it=20
> should be=20
> > done directly by the platform setup function (in other=20
> words; make it=20
> > a helper function and call it at board setup time). =20
> Besides, you want=20
> > to provide guarantees that the board is setup correctly before the=20
> > device driver that uses it gets probed.
> >
> > Cheers,
> > g.
>=20
> Upon further review of all this I don't think this belongs in=20
> the kernel at all.  This is one time setup and should be done=20
> in firmware.

I'm ok for it to be taken care of in u-boot for now.  However, if we
later plan to add power management support to this block.  We probably
have to do it in kernel.

- Leo

^ permalink raw reply

* RE: [PATCH v7 3/9] add Freescale SerDes PHY support
From: Liu Dave @ 2007-11-21  3:48 UTC (permalink / raw)
  To: Kumar Gala, Li Yang; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <68738B73-92D6-459F-88A7-BBE66967A3A0@kernel.crashing.org>

> On Oct 19, 2007, at 10:35 AM, Grant Likely wrote:
>=20
> > On 10/19/07, Li Yang <leoli@freescale.com> wrote:
> >> The SerDes(serializer/deserializer) PHY block is a new SoC=20
> block used
> >> in Freescale chips to support multiple serial interfaces,=20
> such as PCI
> >> Express, SGMII, SATA.
> >
> > This looks like board setup behaviour.  Shouldn't setting this up be
> > the responsibility firmware?  And failing that, I think it should be
> > done directly by the platform setup function (in other=20
> words; make it
> > a helper function and call it at board setup time). =20
> Besides, you want
> > to provide guarantees that the board is setup correctly before the
> > device driver that uses it gets probed.
> >
> > Cheers,
> > g.
>=20
> Upon further review of all this I don't think this belongs in the =20
> kernel at all.  This is one time setup and should be done in firmware.

The latest u-boot supports the serdes initialization for 837x.
So, it can be dropped from kernel for now.

Dave

^ permalink raw reply

* Re: [PATCH] sys_indirect kernel implementation for PowerPC
From: Stephen Rothwell @ 2007-11-21  3:49 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev, Ulrich Drepper
In-Reply-To: <20071121144245.e8abf9e8.sfr@canb.auug.org.au>

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

On Wed, 21 Nov 2007 14:08:46 +1100 Paul Mackerras <paulus@samba.org> wrote:
>
> +struct indirect_registers32 {

In fact, you should probably call this struct compat_indirect_registers ...

-- 
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 v7 3/9] add Freescale SerDes PHY support
From: Kumar Gala @ 2007-11-21  4:01 UTC (permalink / raw)
  To: Li Yang; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <989B956029373F45A0B8AF029708189001A1C7DF@zch01exm26.fsl.freescale.net>

>> Upon further review of all this I don't think this belongs in
>> the kernel at all.  This is one time setup and should be done
>> in firmware.
>
> I'm ok for it to be taken care of in u-boot for now.  However, if we
> later plan to add power management support to this block.  We probably
> have to do it in kernel.

How does pwr mgmt come into play w/SerDes?

- k

^ permalink raw reply

* Re: [PATCH v7 3/9] add Freescale SerDes PHY support
From: Kumar Gala @ 2007-11-21  4:05 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev, Li Yang, Paul Mackerras
In-Reply-To: <56B46498-9213-49A1-B667-40B286291461@kernel.crashing.org>


On Nov 20, 2007, at 10:01 PM, Kumar Gala wrote:

>>> Upon further review of all this I don't think this belongs in
>>> the kernel at all.  This is one time setup and should be done
>>> in firmware.
>>
>> I'm ok for it to be taken care of in u-boot for now.  However, if we
>> later plan to add power management support to this block.  We  
>> probably
>> have to do it in kernel.
>
> How does pwr mgmt come into play w/SerDes?

Never mind, if we do add pwr mgmt it looks like all we need to know is  
what SerDes is associated with the device.

- k

^ permalink raw reply

* Re: [PATCH] sys_indirect kernel implementation for PowerPC
From: Kumar Gala @ 2007-11-21  4:45 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <18243.41278.72798.100000@cargo.ozlabs.ibm.com>


On Nov 20, 2007, at 9:08 PM, Paul Mackerras wrote:

> This implements sys_indirect for 32-bit and 64-bit powerpc machines,
> including a 32-bit compatibility implementation for 64-bit powerpc.
> I decided to use assembly language for call_syscall because on 64-bit
> powerpc the system call table has the addresses of the function text
> rather than pointers to function descriptors; hence the system call
> functions can't be called from C via the system call table.

Admit it you were bored and wanted to write some PPC asm ;)

- k

^ permalink raw reply

* [PATCH 0/3] Device tree docs updates for FSL periphs
From: Kumar Gala @ 2007-11-21  5:11 UTC (permalink / raw)
  To: linuxppc-dev

All,

Please review these updates to booting-without-of.txt for the FSL periphs:
* SATA
* RapidIO
* DMA

They are intended to encompass patches posted before with some changes
that I've made.

- k

^ permalink raw reply

* [PATCH 1/3] [POWERPC] Add docs for Freescale 83xx SATA device tree nodes
From: Kumar Gala @ 2007-11-21  5:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Li Yang
In-Reply-To: <Pine.LNX.4.64.0711202310280.24220@blarg.am.freescale.net>

---
 Documentation/powerpc/booting-without-of.txt |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index e9a3cb1..eb14dd5 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -2514,6 +2514,29 @@ platforms are moved over to use the flattened-device-tree model.
       Requred properties:
        - current-speed : Baud rate of uartlite

+    * Freescale 8xxx/3.0 Gb/s SATA nodes
+
+    SATA nodes are defined to describe on-chip Serial ATA controllers.
+    Each SATA port should have its own node.
+
+    Required properties:
+    - compatible        : compatible list, contains 2 entries, first is
+			 "fsl,sata-CHIP", where CHIP is the processor
+			 (mpc8315, mpc8379, etc.) and the second is
+			 "fsl,sata-pq2pro"
+    - interrupts        : <interrupt mapping for SATA IRQ>
+    - interrupt-parent  : optional, if needed for interrupt mapping
+    - reg               : <registers mapping>
+
+   Example:
+
+	sata@19000 {
+		compatible = "fsl,mpc8315-sata", "fsl,sata-pq2pro;
+		reg = <19000 1000>;
+		interrupts = <2d 8>;
+		interrupt-parent = < &ipic >;
+        };
+
    More devices will be defined as this spec matures.

 VII - Specifying interrupt information for devices
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 2/3] [POWERPC] Add docs for Freescale RapidIO device tree node
From: Kumar Gala @ 2007-11-21  5:13 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0711202310280.24220@blarg.am.freescale.net>

---
 Documentation/powerpc/booting-without-of.txt |   47 ++++++++++++++++++++++++--
 1 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index eb14dd5..3d959d6 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -2521,9 +2521,9 @@ platforms are moved over to use the flattened-device-tree model.

     Required properties:
     - compatible        : compatible list, contains 2 entries, first is
-			 "fsl,sata-CHIP", where CHIP is the processor
+			 "fsl,CHIP-sata", where CHIP is the processor
 			 (mpc8315, mpc8379, etc.) and the second is
-			 "fsl,sata-pq2pro"
+			 "fsl,pq2pro-sata"
     - interrupts        : <interrupt mapping for SATA IRQ>
     - interrupt-parent  : optional, if needed for interrupt mapping
     - reg               : <registers mapping>
@@ -2531,12 +2531,53 @@ platforms are moved over to use the flattened-device-tree model.
    Example:

 	sata@19000 {
-		compatible = "fsl,mpc8315-sata", "fsl,sata-pq2pro;
+		compatible = "fsl,mpc8315-sata", "fsl,pq2pro-sata;
 		reg = <19000 1000>;
 		interrupts = <2d 8>;
 		interrupt-parent = < &ipic >;
         };

+   * Frescale Serial RapidIO bus controller
+
+   RapidIO is a definition of a system interconnect. This node add
+   the support for RapidIO processor in kernel. The node name is
+   suggested to be 'rapidio'.
+
+   Required properties:
+
+    - compatible        : compatible list, contains 2 entries, first is
+			 "fsl,CHIP-rapidio", where CHIP is the processor
+			 (mpc8572, mpc8641, etc.) and the second is
+			 "fsl,delta-rapidio"
+    - interrupts	: interrupts are expected in the following
+			  order:
+      				* Error/port write
+				* Outbound Doorbell
+				* Inbound Doorbell
+				* Outbound Msg Unit 1
+				* Inbound Msg Unit 1
+				* Outbound Msg Unit 2
+				* Inbound Msg Unit 2
+    - interrupt-parent  : optional, if needed for interrupt mapping
+    - reg               : <registers mapping>
+    - #address-cells	: Should always be 2
+    - #size--cells	: Should always be 2
+    - ranges		: Details processor physical addr to RapidIO address
+
+  Example:
+
+	rapidio@c0000 {
+		compatible = "fsl,mpc8641-rapidio", "fsl,delta-rapidio;
+		#address-cells = <2>;
+		#size-cells = <2>;
+		reg = <c0000 20000>;
+		ranges = <0 0 c0000000 20000000>;
+		interrupt-parent = <&mpic>;
+		/* err_irq bell_outb_irq bell_inb_irq msg1_tx_irq msg1_rx_irq
+						      msg2_tx_irq msg2_rx_irq */
+		interrupts = <30 2 31 2 32 2 35 2 36 2 37 2 38 2>;
+	};
+
    More devices will be defined as this spec matures.

 VII - Specifying interrupt information for devices
-- 
1.5.3.4

^ permalink raw reply related

* [PATCH 3/3] [POWERPC] Add docs for Freescale DMA & DMA channel device tree nodes
From: Kumar Gala @ 2007-11-21  5:14 UTC (permalink / raw)
  To: linuxppc-dev
In-Reply-To: <Pine.LNX.4.64.0711202310280.24220@blarg.am.freescale.net>

---
 Documentation/powerpc/booting-without-of.txt |  113 ++++++++++++++++++++++++++
 1 files changed, 113 insertions(+), 0 deletions(-)

diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index 3d959d6..161fb0d 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -2578,6 +2578,119 @@ platforms are moved over to use the flattened-device-tree model.
 		interrupts = <30 2 31 2 32 2 35 2 36 2 37 2 38 2>;
 	};

+   * Freescale 83xx DMA Controller
+
+    Freescale PowerPC 83xx have on chip general purpose DMA controllers.
+
+    Required properties:
+
+    - compatible        : compatible list, contains 2 entries, first is
+			 "fsl,CHIP-dma", where CHIP is the processor
+			 (mpc8349, mpc8360, etc.) and the second is
+			 "fsl,elo-dma"
+    - reg               : <registers mapping for DMA general status reg>
+    - ranges 		: Should be defined as specified in 1) to describe the
+			  DMA controller channels.
+    - interrupts        : <interrupt mapping for DMA IRQ>
+    - interrupt-parent  : optional, if needed for interrupt mapping
+
+
+    - DMA channel nodes:
+	    - compatible        : compatible list, contains 2 entries, first is
+				 "fsl,CHIP-dma-channel", where CHIP is the processor
+				 (mpc8349, mpc8350, etc.) and the second is
+				 "fsl,elo-dma-channel"
+	    - reg               : <registers mapping for channel>
+
+    Optional properties:
+	    - interrupts        : <interrupt mapping for DMA channel IRQ>
+				  (on 83xx this is expected to be identical to
+				   the interrupts property of the parent node)
+	    - interrupt-parent  : optional, if needed for interrupt mapping
+
+  Example:
+	dma@21000 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "fsl,mpc8349-dma", "fsl,elo-dma";
+		reg = <21300 4>;
+		ranges = <0 21100 200>;
+		interrupt-parent = <&ipic>;
+		interrupts = <14 2>;
+		dma-channel@0 {
+			compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
+			reg = <0 80>;
+		};
+		dma-channel@80 {
+			compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
+			reg = <80 80>;
+		};
+		dma-channel@100 {
+			compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
+			reg = <100 80>;
+		};
+		dma-channel@180 {
+			compatible = "fsl,mpc8349-dma-channel", "fsl,elo-dma-channel";
+			reg = <180 80>;
+		};
+	};
+
+   * Freescale 85xx DMA Controller
+
+    Freescale PowerPC 85xx have on chip general purpose DMA controllers.
+
+    Required properties:
+
+    - compatible        : compatible list, contains 2 entries, first is
+			 "fsl,CHIP-dma", where CHIP is the processor
+			 (mpc8540, mpc8540, etc.) and the second is
+			 "fsl,eloplus-dma"
+    - reg               : <registers mapping for DMA general status reg>
+    - ranges 		: Should be defined as specified in 1) to describe the
+			  DMA controller channels.
+
+    - DMA channel nodes:
+	    - compatible        : compatible list, contains 2 entries, first is
+				 "fsl,CHIP-dma-channel", where CHIP is the processor
+				 (mpc8540, mpc8560, etc.) and the second is
+				 "fsl,eloplus-dma-channel"
+	    - reg               : <registers mapping for channel>
+	    - interrupts        : <interrupt mapping for DMA channel IRQ>
+	    - interrupt-parent  : optional, if needed for interrupt mapping
+
+  Example:
+	dma@21000 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "fsl,mpc8540-dma", "fsl,eloplus-dma";
+		reg = <21300 4>;
+		ranges = <0 21100 200>;
+		dma-channel@0 {
+			compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
+			reg = <0 80>;
+			interrupt-parent = <&mpic>;
+			interrupts = <14 2>;
+		};
+		dma-channel@80 {
+			compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
+			reg = <80 80>;
+			interrupt-parent = <&mpic>;
+			interrupts = <15 2>;
+		};
+		dma-channel@100 {
+			compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
+			reg = <100 80>;
+			interrupt-parent = <&mpic>;
+			interrupts = <16 2>;
+		};
+		dma-channel@180 {
+			compatible = "fsl,mpc8540-dma-channel", "fsl,eloplus-dma-channel";
+			reg = <180 80>;
+			interrupt-parent = <&mpic>;
+			interrupts = <17 2>;
+		};
+	};
+
    More devices will be defined as this spec matures.

 VII - Specifying interrupt information for devices
-- 
1.5.3.4

^ permalink raw reply related

* dtc: Flexible tree checking infrastructure
From: David Gibson @ 2007-11-21  5:38 UTC (permalink / raw)
  To: Jon Loeliger; +Cc: linuxppc-dev

Here, at last, is a substantial start on revising dtc's infrastructure
for checking the tree; this is the rework I've been saying was
necessary practically since dtc was first release.

In the new model, we have a table of "check" structures, each with a
name, references to checking functions, and status variables.  Each
check can (in principle) be individually switched off or on (as either
a warning or error).  Checks have a list of prerequisites, so if
checks need to rely on results from earlier checks to make sense (or
even to avoid crashing) they just need to list the relevant other
checks there.

For now, only the "structural" checks and the fixups for phandle
references are converted to the new mechanism.  The rather more
involved semantic checks (which is where this new mechanism will
really be useful) will have to be converted in future patches.

At present, there's no user interface for turning on/off the checks -
the -f option now forces output even if "error" level checks fail.
Again, future patches will be needed to add the fine-grained control,
but that should be quite straightforward with the infrastructure
implemented here.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>

Index: dtc/checks.c
===================================================================
--- dtc.orig/checks.c	2007-11-21 12:27:13.000000000 +1100
+++ dtc/checks.c	2007-11-21 16:28:08.000000000 +1100
@@ -20,104 +20,281 @@
 
 #include "dtc.h"
 
-/*
- * Structural check functions
- */
+enum checklevel {
+	IGNORE = 0,
+	WARN = 1,
+	ERROR = 2,
+};
 
-#define ERRMSG(...) if (quiet < 2) fprintf(stderr, "ERROR: " __VA_ARGS__)
-#define WARNMSG(...) if (quiet < 1) fprintf(stderr, "Warning: " __VA_ARGS__)
+enum checkstatus {
+	UNCHECKED = 0,
+	PREREQ,
+	PASSED,
+	FAILED,
+};
 
-#define DO_ERR(...) do {ERRMSG(__VA_ARGS__); ok = 0; } while (0)
+struct check;
+
+typedef void (*tree_check_fn)(struct check *c, struct node *dt);
+typedef void (*node_check_fn)(struct check *c, struct node *dt, struct node *node);
+typedef void (*prop_check_fn)(struct check *c, struct node *dt,
+			      struct node *node, struct property *prop);
+
+struct check {
+	const char *name;
+	tree_check_fn tree_fn;
+	node_check_fn node_fn;
+	prop_check_fn prop_fn;
+	void *data;
+	enum checklevel level;
+	enum checkstatus status;
+	int inprogress;
+	int num_prereqs;
+	struct check **prereq;
+};
 
-static int check_names(struct node *tree)
+#define CHECK(nm, tfn, nfn, pfn, d, lvl, ...) \
+	static struct check *nm##_prereqs[] = { __VA_ARGS__ }; \
+	static struct check nm = { \
+		.name = #nm, \
+		.tree_fn = (tfn), \
+		.node_fn = (nfn), \
+		.prop_fn = (pfn), \
+		.data = (d), \
+		.level = (lvl), \
+		.status = UNCHECKED, \
+		.num_prereqs = ARRAY_SIZE(nm##_prereqs), \
+		.prereq = nm##_prereqs, \
+	};
+
+#define TREE_CHECK(nm, d, lvl, ...) \
+	CHECK(nm, check_##nm, NULL, NULL, d, lvl, __VA_ARGS__)
+#define NODE_CHECK(nm, d, lvl, ...) \
+	CHECK(nm, NULL, check_##nm, NULL, d, lvl, __VA_ARGS__)
+#define PROP_CHECK(nm, d, lvl, ...) \
+	CHECK(nm, NULL, NULL, check_##nm, d, lvl, __VA_ARGS__)
+#define BATCH_CHECK(nm, lvl, ...) \
+	CHECK(nm, NULL, NULL, NULL, NULL, lvl, __VA_ARGS__)
+
+#define CHECKMSG(c, fmt, ...) \
+	do { \
+		if (quiet < (c)->level) \
+			; /* Suppress message */ \
+		else if ((c)->level == ERROR) \
+			fprintf(stderr, "ERROR (%s): " fmt "\n", \
+				(c)->name, __VA_ARGS__); \
+		else if ((c)->level == WARN) \
+			fprintf(stderr, "Warning (%s): " fmt "\n", \
+				(c)->name, __VA_ARGS__); \
+	} while (0)
+
+#define FAIL(c, fmt, ...) \
+	do { \
+		(c)->status = FAILED; \
+		CHECKMSG((c), fmt, __VA_ARGS__); \
+	} while (0)
+
+static void check_nodes_props(struct check *c, struct node *dt, struct node *node)
 {
-	struct node *child, *child2;
-	struct property *prop, *prop2;
-	int len = strlen(tree->name);
-	int ok = 1;
+	struct node *child;
+	struct property *prop;
 
-	if (len == 0 && tree->parent)
-		DO_ERR("Empty, non-root nodename at %s\n", tree->fullpath);
+	if (c->node_fn)
+		c->node_fn(c, dt, node);
 
-	if (len > MAX_NODENAME_LEN)
-		WARNMSG("Overlength nodename at %s\n", tree->fullpath);
+	if (c->prop_fn)
+		for_each_property(node, prop)
+			c->prop_fn(c, dt, node, prop);
 
-	for_each_property(tree, prop) {
-		/* check for duplicates */
-		/* FIXME: do this more efficiently */
-		for (prop2 = prop->next; prop2; prop2 = prop2->next) {
-			if (streq(prop->name, prop2->name)) {
-				DO_ERR("Duplicate propertyname %s in node %s\n",
-					prop->name, tree->fullpath);
-			}
-		}
+	for_each_child(node, child)
+		check_nodes_props(c, dt, child);
+}
+
+static int run_check(struct check *c, struct node *dt)
+{
+	int error = 0;
+	int i;
+
+	assert(!c->inprogress);
 
-		/* check name length */
-		if (strlen(prop->name) > MAX_PROPNAME_LEN)
-			WARNMSG("Property name %s is too long in %s\n",
-				prop->name, tree->fullpath);
+	if (c->status != UNCHECKED)
+		goto out;
+
+	c->inprogress = 1;
+
+	for (i = 0; i < c->num_prereqs; i++) {
+		struct check *prq = c->prereq[i];
+		error |= run_check(prq, dt);
+		if (prq->status != PASSED) {
+			c->status = PREREQ;
+			CHECKMSG(c, "Failed prerequisite '%s'",
+				 c->prereq[i]->name);
+		}
 	}
 
-	for_each_child(tree, child) {
-		/* Check for duplicates */
+	if (c->status != UNCHECKED)
+		goto out;
+
+	if (c->node_fn || c->prop_fn)
+		check_nodes_props(c, dt, dt);
+
+	if (c->tree_fn)
+		c->tree_fn(c, dt);
+	if (c->status == UNCHECKED)
+		c->status = PASSED;
+
+out:
+	c->inprogress = 0;
+	if ((c->status != PASSED) && (c->level == ERROR))
+		error = 1;
+	return error;
+}
+
+/*
+ * Structural check functions
+ */
+
+static void check_duplicate_node_names(struct check *c, struct node *dt,
+				       struct node *node)
+{
+	struct node *child, *child2;
 
+	for_each_child(node, child)
 		for (child2 = child->next_sibling;
 		     child2;
-		     child2 = child2->next_sibling) {
+		     child2 = child2->next_sibling)
 			if (streq(child->name, child2->name))
-				DO_ERR("Duplicate node name %s\n",
-					child->fullpath);
-		}
-		if (! check_names(child))
-			ok = 0;
-	}
+				FAIL(c, "Duplicate node name %s",
+				     child->fullpath);
+}
+NODE_CHECK(duplicate_node_names, NULL, ERROR);
 
-	return ok;
+static void check_duplicate_property_names(struct check *c, struct node *dt,
+					   struct node *node)
+{
+	struct property *prop, *prop2;
+
+	for_each_property(node, prop)
+		for (prop2 = prop->next; prop2; prop2 = prop2->next)
+			if (streq(prop->name, prop2->name))
+				FAIL(c, "Duplicate property name %s in %s",
+				     prop->name, node->fullpath);
 }
+NODE_CHECK(duplicate_property_names, NULL, ERROR);
 
-static int check_phandles(struct node *root, struct node *node)
+static void check_explicit_phandles(struct check *c, struct node *root,
+					  struct node *node)
 {
 	struct property *prop;
-	struct node *child, *other;
+	struct node *other;
 	cell_t phandle;
-	int ok = 1;
 
 	prop = get_property(node, "linux,phandle");
-	if (prop) {
-		phandle = propval_cell(prop);
-		if ((phandle == 0) || (phandle == -1)) {
-			DO_ERR("%s has invalid linux,phandle %x\n",
-			       node->fullpath, phandle);
-		} else {
-			other = get_node_by_phandle(root, phandle);
-			if (other)
-				DO_ERR("%s has duplicated phandle %x (seen before at %s)\n",
-				       node->fullpath, phandle, other->fullpath);
+	if (! prop)
+		return; /* No phandle, that's fine */
 
-			node->phandle = phandle;
-		}
+	if (prop->val.len != sizeof(cell_t)) {
+		FAIL(c, "%s has bad length (%d) linux,phandle property",
+		     node->fullpath, prop->val.len);
+		return;
 	}
 
-	for_each_child(node, child)
-		ok = ok && check_phandles(root, child);
+	phandle = propval_cell(prop);
+	if ((phandle == 0) || (phandle == -1)) {
+		FAIL(c, "%s has invalid linux,phandle value 0x%x",
+		     node->fullpath, phandle);
+		return;
+	}
 
-	return ok;
+	other = get_node_by_phandle(root, phandle);
+	if (other) {
+		FAIL(c, "%s has duplicated phandle 0x%x (seen before at %s)",
+		     node->fullpath, phandle, other->fullpath);
+		return;
+	}
+
+	node->phandle = phandle;
 }
+NODE_CHECK(explicit_phandles, NULL, ERROR);
+
+/*
+ * Reference fixup functions
+ */
 
-int check_structure(struct node *dt)
+static void fixup_references(struct check *c, struct node *dt,
+			     struct node *node, struct property *prop)
 {
-	int ok = 1;
+      struct fixup *f = prop->val.refs;
+      struct node *refnode;
+      cell_t phandle;
+
+      while (f) {
+	      if (f->ref[0] == '/') {
+		      /* Reference to full path */
+		      refnode = get_node_by_path(dt, f->ref);
+		      if (! refnode)
+			      FAIL(c, "Reference to non-existent node \"%s\"\n",
+				   f->ref);
+	      } else {
+		      refnode = get_node_by_label(dt, f->ref);
+		      if (! refnode)
+			      FAIL(c, "Reference to non-existent node label \"%s\"\n",
+				   f->ref);
+	      }
+
+	      phandle = get_node_phandle(dt, refnode);
+
+	      assert(f->offset + sizeof(cell_t) <= prop->val.len);
+
+	      *((cell_t *)(prop->val.val + f->offset)) = cpu_to_be32(phandle);
+
+              prop->val.refs = f->next;
+              fixup_free(f);
+              f = prop->val.refs;
+      }
+}
+CHECK(references, NULL, NULL, fixup_references, NULL, ERROR,
+      &duplicate_node_names, &explicit_phandles);
+
+static struct check *check_table[] = {
+	&duplicate_node_names, &duplicate_property_names,
+	&explicit_phandles,
+	&references,
+};
 
-	ok = ok && check_names(dt);
-	ok = ok && check_phandles(dt, dt);
+void process_checks(int force, struct node *dt)
+{
+	int i;
+	int error = 0;
 
-	return ok;
+	for (i = 0; i < ARRAY_SIZE(check_table); i++) {
+		struct check *c = check_table[i];
+
+		if (c->level != IGNORE)
+			error = error || run_check(c, dt);
+	}
+
+	if (error) {
+		if (!force) {
+			fprintf(stderr, "ERROR: Input tree has errors, aborting "
+				"(use -f to force output)\n");
+			exit(2);
+		} else if (quiet < 3) {
+			fprintf(stderr, "Warning: Input tree has errors, "
+				"output forced\n");
+		}
+	}
 }
 
 /*
  * Semantic check functions
  */
 
+#define ERRMSG(...) if (quiet < 2) fprintf(stderr, "ERROR: " __VA_ARGS__)
+#define WARNMSG(...) if (quiet < 1) fprintf(stderr, "Warning: " __VA_ARGS__)
+
+#define DO_ERR(...) do {ERRMSG(__VA_ARGS__); ok = 0; } while (0)
+
 static int must_be_one_cell(struct property *prop, struct node *node)
 {
 	if (prop->val.len != sizeof(cell_t)) {
Index: dtc/dtc.c
===================================================================
--- dtc.orig/dtc.c	2007-11-21 12:27:13.000000000 +1100
+++ dtc/dtc.c	2007-11-21 16:27:16.000000000 +1100
@@ -193,17 +193,7 @@ int main(int argc, char *argv[])
 	if (! bi || ! bi->dt)
 		die("Couldn't read input tree\n");
 
-	structure_ok = check_structure(bi->dt);
-	if (!structure_ok) {
-		if (!force) {
-			fprintf(stderr, "ERROR: Input tree has structural errors, aborting (use -f to force output)\n");
-			exit(2);
-		} else if (quiet < 3) {
-			fprintf(stderr, "Warning: Input tree has structural errors, output forced\n");
-		}
-	}
-
-	fixup_references(bi->dt);
+	process_checks(force, bi->dt);
 
 	if (check) {
 		if (!structure_ok) {
Index: dtc/dtc.h
===================================================================
--- dtc.orig/dtc.h	2007-11-21 12:27:13.000000000 +1100
+++ dtc/dtc.h	2007-11-21 16:27:16.000000000 +1100
@@ -193,9 +193,10 @@ char *get_unitname(struct node *node);
 struct property *get_property(struct node *node, char *propname);
 cell_t propval_cell(struct property *prop);
 struct node *get_subnode(struct node *node, char *nodename);
+struct node *get_node_by_path(struct node *tree, char *path);
+struct node *get_node_by_label(struct node *tree, const char *label);
 struct node *get_node_by_phandle(struct node *tree, cell_t phandle);
-
-void fixup_references(struct node *dt);
+cell_t get_node_phandle(struct node *root, struct node *node);
 
 /* Boot info (tree plus memreserve information */
 
@@ -224,7 +225,7 @@ struct boot_info *build_boot_info(struct
 
 /* Checks */
 
-int check_structure(struct node *dt);
+void process_checks(int force, struct node *dt);
 int check_semantics(struct node *dt, int outversion, int boot_cpuid_phys);
 
 /* Flattened trees */
Index: dtc/livetree.c
===================================================================
--- dtc.orig/livetree.c	2007-11-21 16:27:09.000000000 +1100
+++ dtc/livetree.c	2007-11-21 16:27:16.000000000 +1100
@@ -216,7 +216,7 @@ struct node *get_subnode(struct node *no
 	return NULL;
 }
 
-static struct node *get_node_by_path(struct node *tree, char *path)
+struct node *get_node_by_path(struct node *tree, char *path)
 {
 	char *p;
 	struct node *child;
@@ -239,7 +239,7 @@ static struct node *get_node_by_path(str
 	return NULL;
 }
 
-static struct node *get_node_by_label(struct node *tree, const char *label)
+struct node *get_node_by_label(struct node *tree, const char *label)
 {
 	struct node *child, *node;
 
@@ -275,7 +275,7 @@ struct node *get_node_by_phandle(struct 
 	return NULL;
 }
 
-static cell_t get_node_phandle(struct node *root, struct node *node)
+cell_t get_node_phandle(struct node *root, struct node *node)
 {
 	static cell_t phandle = 1; /* FIXME: ick, static local */
 
@@ -295,56 +295,3 @@ static cell_t get_node_phandle(struct no
 
 	return node->phandle;
 }
-
-/*
- * Reference fixup functions
- */
-
-static void apply_fixup(struct node *root, struct property *prop,
-			struct fixup *f)
-{
-	struct node *refnode;
-	cell_t phandle;
-
-	if (f->ref[0] == '/') {
-		/* Reference to full path */
-		refnode = get_node_by_path(root, f->ref);
-		if (! refnode)
-			die("Reference to non-existent node \"%s\"\n", f->ref);
-	} else {
-		refnode = get_node_by_label(root, f->ref);
-		if (! refnode)
-			die("Reference to non-existent node label \"%s\"\n", f->ref);
-	}
-
-	phandle = get_node_phandle(root, refnode);
-
-	assert(f->offset + sizeof(cell_t) <= prop->val.len);
-
-	*((cell_t *)(prop->val.val + f->offset)) = cpu_to_be32(phandle);
-}
-
-static void fixup_phandles(struct node *root, struct node *node)
-{
-	struct property *prop;
-	struct node *child;
-
-	for_each_property(node, prop) {
-		struct fixup *f = prop->val.refs;
-
-		while (f) {
-			apply_fixup(root, prop, f);
-			prop->val.refs = f->next;
-			fixup_free(f);
-			f = prop->val.refs;
-		}
-	}
-
-	for_each_child(node, child)
-		fixup_phandles(root, child);
-}
-
-void fixup_references(struct node *dt)
-{
-	fixup_phandles(dt, dt);
-}

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* [PATCH 0/8] ibm_newemac: Candidate patches for 2.6.25
From: Benjamin Herrenschmidt @ 2007-11-21  6:06 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-dev

Here are the patches I have pending for EMAC. With some non-released
patches from Hugh Blemings, I get a taishan (440GX) booting now,
in addition to Ebony (440GP) and various 405GP boards.

This is 2.6.25 material except for patch #1 which has already been
posted separately and is candidate for 2.6.24 (and possibly stable)

^ permalink raw reply

* [PATCH 1/8] ibm_newemac: Fix possible lockup on close
From: Benjamin Herrenschmidt @ 2007-11-21  6:06 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <1195625198.76200.922309668615.qpush@grosgo>

It's a bad idea to call flush_scheduled_work from within a
netdev->stop because the linkwatch will occasionally take the
rtnl lock from a workqueue context, and thus that can deadlock.

This reworks things a bit in that area to avoid the problem.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 drivers/net/ibm_newemac/core.c |   31 ++++++++++++++++++++-----------
 drivers/net/ibm_newemac/core.h |    1 +
 2 files changed, 21 insertions(+), 11 deletions(-)

Index: linux-work/drivers/net/ibm_newemac/core.c
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/core.c	2007-11-20 14:42:50.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/core.c	2007-11-20 14:46:51.000000000 +1100
@@ -642,9 +642,11 @@ static void emac_reset_work(struct work_
 	DBG(dev, "reset_work" NL);
 
 	mutex_lock(&dev->link_lock);
-	emac_netif_stop(dev);
-	emac_full_tx_reset(dev);
-	emac_netif_start(dev);
+	if (dev->opened) {
+		emac_netif_stop(dev);
+		emac_full_tx_reset(dev);
+		emac_netif_start(dev);
+	}
 	mutex_unlock(&dev->link_lock);
 }
 
@@ -1063,10 +1065,9 @@ static int emac_open(struct net_device *
 	dev->rx_sg_skb = NULL;
 
 	mutex_lock(&dev->link_lock);
+	dev->opened = 1;
 
-	/* XXX Start PHY polling now. Shouldn't wr do like sungem instead and
-	 * always poll the PHY even when the iface is down ? That would allow
-	 * things like laptop-net to work. --BenH
+	/* Start PHY polling now.
 	 */
 	if (dev->phy.address >= 0) {
 		int link_poll_interval;
@@ -1145,9 +1146,11 @@ static void emac_link_timer(struct work_
 	int link_poll_interval;
 
 	mutex_lock(&dev->link_lock);
-
 	DBG2(dev, "link timer" NL);
 
+	if (!dev->opened)
+		goto bail;
+
 	if (dev->phy.def->ops->poll_link(&dev->phy)) {
 		if (!netif_carrier_ok(dev->ndev)) {
 			/* Get new link parameters */
@@ -1170,13 +1173,14 @@ static void emac_link_timer(struct work_
 		link_poll_interval = PHY_POLL_LINK_OFF;
 	}
 	schedule_delayed_work(&dev->link_work, link_poll_interval);
-
+ bail:
 	mutex_unlock(&dev->link_lock);
 }
 
 static void emac_force_link_update(struct emac_instance *dev)
 {
 	netif_carrier_off(dev->ndev);
+	smp_rmb();
 	if (dev->link_polling) {
 		cancel_rearming_delayed_work(&dev->link_work);
 		if (dev->link_polling)
@@ -1191,11 +1195,14 @@ static int emac_close(struct net_device 
 
 	DBG(dev, "close" NL);
 
-	if (dev->phy.address >= 0)
+	if (dev->phy.address >= 0) {
+		dev->link_polling = 0;
 		cancel_rearming_delayed_work(&dev->link_work);
-
+	}
+	mutex_lock(&dev->link_lock);
 	emac_netif_stop(dev);
-	flush_scheduled_work();
+	dev->opened = 0;
+	mutex_unlock(&dev->link_lock);
 
 	emac_rx_disable(dev);
 	emac_tx_disable(dev);
@@ -2756,6 +2763,8 @@ static int __devexit emac_remove(struct 
 
 	unregister_netdev(dev->ndev);
 
+	flush_scheduled_work();
+
 	if (emac_has_feature(dev, EMAC_FTR_HAS_TAH))
 		tah_detach(dev->tah_dev, dev->tah_port);
 	if (emac_has_feature(dev, EMAC_FTR_HAS_RGMII))
Index: linux-work/drivers/net/ibm_newemac/core.h
===================================================================
--- linux-work.orig/drivers/net/ibm_newemac/core.h	2007-11-20 14:42:50.000000000 +1100
+++ linux-work/drivers/net/ibm_newemac/core.h	2007-11-20 14:46:51.000000000 +1100
@@ -258,6 +258,7 @@ struct emac_instance {
 	int				stop_timeout;	/* in us */
 	int				no_mcast;
 	int				mcast_pending;
+	int				opened;
 	struct work_struct		reset_work;
 	spinlock_t			lock;
 };

^ permalink raw reply

* [PATCH 2/8] ibm_newemac: Add BCM5248 and Marvell 88E1111 PHY support
From: Benjamin Herrenschmidt @ 2007-11-21  6:06 UTC (permalink / raw)
  To: jgarzik; +Cc: netdev, linuxppc-dev
In-Reply-To: <1195625198.76200.922309668615.qpush@grosgo>

From: Stefan Roese <sr@denx.de>

This patch adds BCM5248 and Marvell 88E1111 PHY support to NEW EMAC driver.
These PHY chips are used on PowerPC 440EPx boards.
The PHY code is based on the previous work by Stefan Roese <sr@denx.de>

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Valentine Barshak <vbarshak@ru.mvista.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

--- linux.orig/drivers/net/ibm_newemac/phy.c	2007-06-15 21:45:18.000000000 +0400
+++ linux/drivers/net/ibm_newemac/phy.c	2007-06-15 20:45:15.000000000 +0400
@@ -306,8 +306,47 @@
 	.ops		= &cis8201_phy_ops
 };
 
+static struct mii_phy_def bcm5248_phy_def = {
+
+	.phy_id		= 0x0143bc00,
+	.phy_id_mask	= 0x0ffffff0,
+	.name		= "BCM5248 10/100 SMII Ethernet",
+	.ops		= &generic_phy_ops
+};
+
+static int m88e1111_init(struct mii_phy *phy)
+{
+	printk("%s: Marvell 88E1111 Ethernet\n", __FUNCTION__);
+	phy_write(phy, 0x14, 0x0ce3);
+	phy_write(phy, 0x18, 0x4101);
+	phy_write(phy, 0x09, 0x0e00);
+	phy_write(phy, 0x04, 0x01e1);
+	phy_write(phy, 0x00, 0x9140);
+	phy_write(phy, 0x00, 0x1140);
+
+	return  0;
+}
+
+static struct mii_phy_ops m88e1111_phy_ops = {
+	.init		= m88e1111_init,
+	.setup_aneg	= genmii_setup_aneg,
+	.setup_forced	= genmii_setup_forced,
+	.poll_link	= genmii_poll_link,
+	.read_link	= genmii_read_link
+};
+
+static struct mii_phy_def m88e1111_phy_def = {
+
+	.phy_id		= 0x01410CC0,
+	.phy_id_mask	= 0x0ffffff0,
+	.name		= "Marvell 88E1111 Ethernet",
+	.ops		= &m88e1111_phy_ops,
+};
+
 static struct mii_phy_def *mii_phy_table[] = {
 	&cis8201_phy_def,
+	&bcm5248_phy_def,
+	&m88e1111_phy_def,
 	&genmii_phy_def,
 	NULL
 };
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

^ permalink raw reply


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