* [PATCH 5/5] [POWERPC] Add 460EX PCIe support to 4xx pci driver
From: Stefan Roese @ 2008-02-21 14:01 UTC (permalink / raw)
To: linuxppc-dev
Tested on AMCC Canyonlands eval board.
Signed-off-by: Stefan Roese <sr@denx.de>
---
arch/powerpc/sysdev/ppc4xx_pci.c | 114 ++++++++++++++++++++++++++++++++++++++
arch/powerpc/sysdev/ppc4xx_pci.h | 59 +++++++++++++++++++
2 files changed, 173 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c
index 5abfcd1..d183b83 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.c
+++ b/arch/powerpc/sysdev/ppc4xx_pci.c
@@ -527,6 +527,7 @@ static void __init ppc4xx_probe_pcix_bridge(struct device_node *np)
*
* ibm,plb-pciex-440spe
* ibm,plb-pciex-405ex
+ * ibm,plb-pciex-460ex
*
* Anything else will be rejected for now as they are all subtly
* different unfortunately.
@@ -775,6 +776,117 @@ static struct ppc4xx_pciex_hwops ppc440speB_pcie_hwops __initdata =
.setup_utl = ppc440speB_pciex_init_utl,
};
+static int __init ppc460ex_pciex_core_init(struct device_node *np)
+{
+ /* Nothing to do, return 2 ports */
+ return 2;
+}
+
+static int ppc460ex_pciex_init_port_hw(struct ppc4xx_pciex_port *port)
+{
+ u32 val;
+ u32 utlset1;
+
+ if (port->endpoint) {
+ val = PTYPE_LEGACY_ENDPOINT << 20;
+ utlset1 = 0x20222222;
+ } else {
+ val = PTYPE_ROOT_PORT << 20;
+ utlset1 = 0x21222222;
+ }
+
+ if (port->index == 0) {
+ val |= LNKW_X1 << 12;
+ } else {
+ val |= LNKW_X4 << 12;
+ utlset1 |= 0x00101101;
+ }
+
+ mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET, val);
+ mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, utlset1);
+ mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x01210000);
+
+ switch (port->index) {
+ case 0:
+ mtdcri(SDR0, PESDR0_460EX_L0CDRCTL, 0x00003230);
+ mtdcri(SDR0, PESDR0_460EX_L0DRV, 0x00000136);
+ mtdcri(SDR0, PESDR0_460EX_L0CLK, 0x00000006);
+
+ mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST,0x10000000);
+ break;
+
+ case 1:
+ mtdcri(SDR0, PESDR1_460EX_L0CDRCTL, 0x00003230);
+ mtdcri(SDR0, PESDR1_460EX_L1CDRCTL, 0x00003230);
+ mtdcri(SDR0, PESDR1_460EX_L2CDRCTL, 0x00003230);
+ mtdcri(SDR0, PESDR1_460EX_L3CDRCTL, 0x00003230);
+ mtdcri(SDR0, PESDR1_460EX_L0DRV, 0x00000136);
+ mtdcri(SDR0, PESDR1_460EX_L1DRV, 0x00000136);
+ mtdcri(SDR0, PESDR1_460EX_L2DRV, 0x00000136);
+ mtdcri(SDR0, PESDR1_460EX_L3DRV, 0x00000136);
+ mtdcri(SDR0, PESDR1_460EX_L0CLK, 0x00000006);
+ mtdcri(SDR0, PESDR1_460EX_L1CLK, 0x00000006);
+ mtdcri(SDR0, PESDR1_460EX_L2CLK, 0x00000006);
+ mtdcri(SDR0, PESDR1_460EX_L3CLK, 0x00000006);
+
+ mtdcri(SDR0, PESDR1_460EX_PHY_CTL_RST,0x10000000);
+ break;
+ }
+
+ mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
+ mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) |
+ (PESDRx_RCSSET_RSTGU | PESDRx_RCSSET_RSTPYN));
+
+ /* Poll for PHY reset */
+ /* XXX FIXME add timeout */
+ switch (port->index) {
+ case 0:
+ while (!(mfdcri(SDR0, PESDR0_460EX_RSTSTA) & 0x1))
+ udelay(10);
+ break;
+ case 1:
+ while (!(mfdcri(SDR0, PESDR1_460EX_RSTSTA) & 0x1))
+ udelay(10);
+ break;
+ }
+
+ mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
+ (mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) &
+ ~(PESDRx_RCSSET_RSTGU | PESDRx_RCSSET_RSTDL)) |
+ PESDRx_RCSSET_RSTPYN);
+
+ port->has_ibpre = 1;
+
+ return 0;
+}
+
+static int ppc460ex_pciex_init_utl(struct ppc4xx_pciex_port *port)
+{
+ dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x0);
+
+ /*
+ * Set buffer allocations and then assert VRB and TXE.
+ */
+ out_be32(port->utl_base + PEUTL_PBCTL, 0x0800000c);
+ out_be32(port->utl_base + PEUTL_OUTTR, 0x08000000);
+ out_be32(port->utl_base + PEUTL_INTR, 0x02000000);
+ out_be32(port->utl_base + PEUTL_OPDBSZ, 0x04000000);
+ out_be32(port->utl_base + PEUTL_PBBSZ, 0x00000000);
+ out_be32(port->utl_base + PEUTL_IPHBSZ, 0x02000000);
+ out_be32(port->utl_base + PEUTL_IPDBSZ, 0x04000000);
+ out_be32(port->utl_base + PEUTL_RCIRQEN,0x00f00000);
+ out_be32(port->utl_base + PEUTL_PCTL, 0x80800066);
+
+ return 0;
+}
+
+static struct ppc4xx_pciex_hwops ppc460ex_pcie_hwops __initdata =
+{
+ .core_init = ppc460ex_pciex_core_init,
+ .port_init_hw = ppc460ex_pciex_init_port_hw,
+ .setup_utl = ppc460ex_pciex_init_utl,
+};
+
#endif /* CONFIG_44x */
#ifdef CONFIG_40x
@@ -896,6 +1008,8 @@ static int __init ppc4xx_pciex_check_core_init(struct device_node *np)
else
ppc4xx_pciex_hwops = &ppc440speB_pcie_hwops;
}
+ if (of_device_is_compatible(np, "ibm,plb-pciex-460ex"))
+ ppc4xx_pciex_hwops = &ppc460ex_pcie_hwops;
#endif /* CONFIG_44x */
#ifdef CONFIG_40x
if (of_device_is_compatible(np, "ibm,plb-pciex-405ex"))
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.h b/arch/powerpc/sysdev/ppc4xx_pci.h
index 1c07908..d04e40b 100644
--- a/arch/powerpc/sysdev/ppc4xx_pci.h
+++ b/arch/powerpc/sysdev/ppc4xx_pci.h
@@ -271,6 +271,59 @@
#define PESDR1_405EX_PHYSTA 0x044C
/*
+ * 460EX additional DCRs
+ */
+#define PESDR0_460EX_L0BIST 0x0308
+#define PESDR0_460EX_L0BISTSTS 0x0309
+#define PESDR0_460EX_L0CDRCTL 0x030A
+#define PESDR0_460EX_L0DRV 0x030B
+#define PESDR0_460EX_L0REC 0x030C
+#define PESDR0_460EX_L0LPB 0x030D
+#define PESDR0_460EX_L0CLK 0x030E
+#define PESDR0_460EX_PHY_CTL_RST 0x030F
+#define PESDR0_460EX_RSTSTA 0x0310
+#define PESDR0_460EX_OBS 0x0311
+#define PESDR0_460EX_L0ERRC 0x0320
+
+#define PESDR1_460EX_L0BIST 0x0348
+#define PESDR1_460EX_L1BIST 0x0349
+#define PESDR1_460EX_L2BIST 0x034A
+#define PESDR1_460EX_L3BIST 0x034B
+#define PESDR1_460EX_L0BISTSTS 0x034C
+#define PESDR1_460EX_L1BISTSTS 0x034D
+#define PESDR1_460EX_L2BISTSTS 0x034E
+#define PESDR1_460EX_L3BISTSTS 0x034F
+#define PESDR1_460EX_L0CDRCTL 0x0350
+#define PESDR1_460EX_L1CDRCTL 0x0351
+#define PESDR1_460EX_L2CDRCTL 0x0352
+#define PESDR1_460EX_L3CDRCTL 0x0353
+#define PESDR1_460EX_L0DRV 0x0354
+#define PESDR1_460EX_L1DRV 0x0355
+#define PESDR1_460EX_L2DRV 0x0356
+#define PESDR1_460EX_L3DRV 0x0357
+#define PESDR1_460EX_L0REC 0x0358
+#define PESDR1_460EX_L1REC 0x0359
+#define PESDR1_460EX_L2REC 0x035A
+#define PESDR1_460EX_L3REC 0x035B
+#define PESDR1_460EX_L0LPB 0x035C
+#define PESDR1_460EX_L1LPB 0x035D
+#define PESDR1_460EX_L2LPB 0x035E
+#define PESDR1_460EX_L3LPB 0x035F
+#define PESDR1_460EX_L0CLK 0x0360
+#define PESDR1_460EX_L1CLK 0x0361
+#define PESDR1_460EX_L2CLK 0x0362
+#define PESDR1_460EX_L3CLK 0x0363
+#define PESDR1_460EX_PHY_CTL_RST 0x0364
+#define PESDR1_460EX_RSTSTA 0x0365
+#define PESDR1_460EX_OBS 0x0366
+#define PESDR1_460EX_L0ERRC 0x0368
+#define PESDR1_460EX_L1ERRC 0x0369
+#define PESDR1_460EX_L2ERRC 0x036A
+#define PESDR1_460EX_L3ERRC 0x036B
+#define PESDR0_460EX_IHS1 0x036C
+#define PESDR0_460EX_IHS2 0x036D
+
+/*
* Of the above, some are common offsets from the base
*/
#define PESDRn_UTLSET1 0x00
@@ -353,6 +406,12 @@
#define PECFG_POM2LAL 0x390
#define PECFG_POM2LAH 0x394
+/* SDR Bit Mappings */
+#define PESDRx_RCSSET_HLDPLB 0x10000000
+#define PESDRx_RCSSET_RSTGU 0x01000000
+#define PESDRx_RCSSET_RDY 0x00100000
+#define PESDRx_RCSSET_RSTDL 0x00010000
+#define PESDRx_RCSSET_RSTPYN 0x00001000
enum
{
--
1.5.4.2
^ permalink raw reply related
* [PATCH 4/5] [POWERPC] Add Canyonlands defconfig file
From: Stefan Roese @ 2008-02-21 14:01 UTC (permalink / raw)
To: linuxppc-dev
Signed-off-by: Stefan Roese <sr@denx.de>
---
arch/powerpc/configs/canyonlands_defconfig | 721 ++++++++++++++++++++++++++++
1 files changed, 721 insertions(+), 0 deletions(-)
create mode 100644 arch/powerpc/configs/canyonlands_defconfig
diff --git a/arch/powerpc/configs/canyonlands_defconfig b/arch/powerpc/configs/canyonlands_defconfig
new file mode 100644
index 0000000..a3b763c
--- /dev/null
+++ b/arch/powerpc/configs/canyonlands_defconfig
@@ -0,0 +1,721 @@
+#
+# Automatically generated make config: don't edit
+# Linux kernel version: 2.6.25-rc1
+# Thu Feb 21 14:29:28 2008
+#
+# CONFIG_PPC64 is not set
+
+#
+# Processor support
+#
+# CONFIG_6xx is not set
+# CONFIG_PPC_85xx is not set
+# CONFIG_PPC_8xx is not set
+# CONFIG_40x is not set
+CONFIG_44x=y
+# CONFIG_E200 is not set
+CONFIG_PPC_FPU=y
+CONFIG_4xx=y
+CONFIG_BOOKE=y
+CONFIG_PTE_64BIT=y
+CONFIG_PHYS_64BIT=y
+# CONFIG_PPC_MM_SLICES is not set
+CONFIG_NOT_COHERENT_CACHE=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_HAVE_SETUP_PER_CPU_AREA is not set
+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=y
+# CONFIG_GENERIC_TBSYNC is not set
+CONFIG_AUDIT_ARCH=y
+CONFIG_GENERIC_BUG=y
+# CONFIG_DEFAULT_UIMAGE is not set
+CONFIG_PPC_DCR_NATIVE=y
+# CONFIG_PPC_DCR_MMIO is not set
+CONFIG_PPC_DCR=y
+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_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=y
+# CONFIG_RELAY is not set
+# CONFIG_NAMESPACES is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_EMBEDDED=y
+CONFIG_SYSCTL_SYSCALL=y
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_HOTPLUG=y
+CONFIG_PRINTK=y
+# CONFIG_LOGBUFFER is not set
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_COMPAT_BRK=y
+CONFIG_BASE_FULL=y
+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
+CONFIG_SLUB_DEBUG=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLOB is not set
+# CONFIG_PROFILING is not set
+# CONFIG_MARKERS is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+CONFIG_HAVE_KPROBES=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+# CONFIG_TINY_SHMEM is not set
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+CONFIG_KMOD=y
+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=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_AS=y
+# CONFIG_DEFAULT_DEADLINE is not set
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="anticipatory"
+CONFIG_CLASSIC_RCU=y
+# CONFIG_PREEMPT_RCU is not set
+CONFIG_PPC4xx_PCI_EXPRESS=y
+
+#
+# Platform support
+#
+# CONFIG_PPC_MPC512x is not set
+# CONFIG_PPC_MPC5121 is not set
+# CONFIG_PPC_CELL is not set
+# CONFIG_PPC_CELL_NATIVE is not set
+# CONFIG_PQ2ADS is not set
+# CONFIG_BAMBOO is not set
+# CONFIG_EBONY is not set
+# CONFIG_SEQUOIA is not set
+# CONFIG_TAISHAN is not set
+# CONFIG_KATMAI is not set
+# CONFIG_RAINIER is not set
+# CONFIG_WARP is not set
+CONFIG_CANYONLANDS=y
+CONFIG_460EX=y
+# CONFIG_IPIC is not set
+# 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_FSL_ULI1575 is not set
+
+#
+# Kernel options
+#
+# CONFIG_HIGHMEM is not set
+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_SCHED_HRTICK is not set
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_RCU_TRACE=y
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_MISC is not set
+# CONFIG_MATH_EMULATION is not set
+# CONFIG_IOMMU_HELPER is not set
+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
+CONFIG_ARCH_HAS_WALK_MEMORY=y
+CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
+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=y
+CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
+CONFIG_VIRT_TO_BUS=y
+CONFIG_PROC_DEVICETREE=y
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE=""
+CONFIG_SECCOMP=y
+CONFIG_WANT_DEVICE_TREE=y
+CONFIG_ISA_DMA_API=y
+
+#
+# Bus options
+#
+CONFIG_ZONE_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_PCI_DEBUG is not set
+# 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=0x01000000
+
+#
+# Networking
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# 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_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# 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 is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+# 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_CAN 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=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_SYS_HYPERVISOR is not set
+CONFIG_CONNECTOR=y
+CONFIG_PROC_EVENTS=y
+# CONFIG_MTD 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 is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_SX8 is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=35000
+# CONFIG_BLK_DEV_XIP is not set
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_XILINX_SYSACE is not set
+# CONFIG_MISC_DEVICES is not set
+CONFIG_HAVE_IDE=y
+# CONFIG_IDE is not set
+
+#
+# SCSI device support
+#
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA 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 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_ARCNET is not set
+# CONFIG_PHYLIB is not set
+CONFIG_NET_ETHERNET=y
+# CONFIG_MII is not set
+# 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=y
+CONFIG_IBM_NEW_EMAC_RXB=256
+CONFIG_IBM_NEW_EMAC_TXB=256
+CONFIG_IBM_NEW_EMAC_POLL_WEIGHT=32
+CONFIG_IBM_NEW_EMAC_RX_COPY_THRESHOLD=256
+CONFIG_IBM_NEW_EMAC_RX_SKB_HEADROOM=0
+# CONFIG_IBM_NEW_EMAC_DEBUG is not set
+CONFIG_IBM_NEW_EMAC_ZMII=y
+CONFIG_IBM_NEW_EMAC_RGMII=y
+CONFIG_IBM_NEW_EMAC_TAH=y
+CONFIG_IBM_NEW_EMAC_EMAC4=y
+# CONFIG_NET_PCI is not set
+# CONFIG_B44 is not set
+# CONFIG_NETDEV_1000 is not set
+# CONFIG_NETDEV_10000 is not set
+# CONFIG_TR is not set
+
+#
+# Wireless LAN
+#
+# CONFIG_WLAN_PRE80211 is not set
+# CONFIG_WLAN_80211 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_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 is not set
+
+#
+# Hardware I/O ports
+#
+# CONFIG_SERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+# CONFIG_VT is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_NOZOMI is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+# CONFIG_SERIAL_8250_PCI is not set
+CONFIG_SERIAL_8250_NR_UARTS=4
+CONFIG_SERIAL_8250_RUNTIME_UARTS=4
+CONFIG_SERIAL_8250_EXTENDED=y
+# CONFIG_SERIAL_8250_MANY_PORTS is not set
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+# CONFIG_SERIAL_8250_DETECT_IRQ is not set
+# CONFIG_SERIAL_8250_RSA is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_JSM is not set
+CONFIG_SERIAL_OF_PLATFORM=y
+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 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 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 is not set
+# CONFIG_THERMAL 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=y
+
+#
+# Graphics support
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_VGASTATE is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+# CONFIG_FB is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+
+#
+# Display device support
+#
+# CONFIG_DISPLAY_SUPPORT is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_INFINIBAND is not set
+# CONFIG_EDAC is not set
+# CONFIG_RTC_CLASS is not set
+
+#
+# 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 is not set
+# CONFIG_EXT4DEV_FS is not set
+# 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_DNOTIFY=y
+CONFIG_INOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_QUOTA is not set
+# 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_CRAMFS=y
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_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=y
+# CONFIG_NFS_V3_ACL 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_LOCKD_V4=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 is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_NLS is not set
+# CONFIG_DLM 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_ZLIB_INFLATE=y
+CONFIG_PLIST=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT=y
+CONFIG_HAS_DMA=y
+
+#
+# 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
+CONFIG_DEBUG_FS=y
+# CONFIG_HEADERS_CHECK is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+CONFIG_DETECT_SOFTLOCKUP=y
+CONFIG_SCHED_DEBUG=y
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_DEBUG_KOBJECT is not set
+# CONFIG_DEBUG_BUGVERBOSE is not set
+# 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_BOOT_PRINTK_DELAY is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_SAMPLES is not set
+# CONFIG_DEBUG_STACKOVERFLOW is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_PAGEALLOC is not set
+CONFIG_DEBUGGER=y
+# CONFIG_KGDB is not set
+# CONFIG_XMON is not set
+# CONFIG_VIRQ_DEBUG is not set
+# CONFIG_BDI_SWITCH 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
--
1.5.4.2
^ permalink raw reply related
* [PATCH 3/5] [POWERPC] Add Canyonlands DTS
From: Stefan Roese @ 2008-02-21 14:01 UTC (permalink / raw)
To: linuxppc-dev
Signed-off-by: Stefan Roese <sr@denx.de>
---
arch/powerpc/boot/dts/canyonlands.dts | 398 +++++++++++++++++++++++++++++++++
1 files changed, 398 insertions(+), 0 deletions(-)
create mode 100644 arch/powerpc/boot/dts/canyonlands.dts
diff --git a/arch/powerpc/boot/dts/canyonlands.dts b/arch/powerpc/boot/dts/canyonlands.dts
new file mode 100644
index 0000000..2aee74c
--- /dev/null
+++ b/arch/powerpc/boot/dts/canyonlands.dts
@@ -0,0 +1,398 @@
+/*
+ * Device Tree Source for AMCC Canyonlands (460EX)
+ *
+ * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
+ *
+ * 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.
+ */
+
+/ {
+ #address-cells = <2>;
+ #size-cells = <1>;
+ model = "amcc,canyonlands";
+ compatible = "amcc,canyonlands";
+ dcr-parent = <&/cpus/cpu@0>;
+
+ aliases {
+ ethernet0 = &EMAC0;
+ ethernet1 = &EMAC1;
+ serial0 = &UART0;
+ serial1 = &UART1;
+ };
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu@0 {
+ device_type = "cpu";
+ model = "PowerPC,460EX";
+ reg = <0>;
+ clock-frequency = <0>; /* Filled in by U-Boot */
+ timebase-frequency = <0>; /* Filled in by U-Boot */
+ i-cache-line-size = <20>;
+ d-cache-line-size = <20>;
+ i-cache-size = <20000>;
+ d-cache-size = <20000>;
+ dcr-controller;
+ dcr-access-method = "native";
+ };
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <0 0 0>; /* Filled in by U-Boot */
+ };
+
+ UIC0: interrupt-controller0 {
+ compatible = "ibm,uic-460ex","ibm,uic";
+ interrupt-controller;
+ cell-index = <0>;
+ dcr-reg = <0c0 009>;
+ #address-cells = <0>;
+ #size-cells = <0>;
+ #interrupt-cells = <2>;
+ };
+
+ UIC1: interrupt-controller1 {
+ compatible = "ibm,uic-460ex","ibm,uic";
+ interrupt-controller;
+ cell-index = <1>;
+ dcr-reg = <0d0 009>;
+ #address-cells = <0>;
+ #size-cells = <0>;
+ #interrupt-cells = <2>;
+ interrupts = <1e 4 1f 4>; /* cascade */
+ interrupt-parent = <&UIC0>;
+ };
+
+ UIC2: interrupt-controller2 {
+ compatible = "ibm,uic-460ex","ibm,uic";
+ interrupt-controller;
+ cell-index = <2>;
+ dcr-reg = <0e0 009>;
+ #address-cells = <0>;
+ #size-cells = <0>;
+ #interrupt-cells = <2>;
+ interrupts = <a 4 b 4>; /* cascade */
+ interrupt-parent = <&UIC0>;
+ };
+
+ UIC3: interrupt-controller3 {
+ compatible = "ibm,uic-460ex","ibm,uic";
+ interrupt-controller;
+ cell-index = <3>;
+ dcr-reg = <0f0 009>;
+ #address-cells = <0>;
+ #size-cells = <0>;
+ #interrupt-cells = <2>;
+ interrupts = <10 4 11 4>; /* cascade */
+ interrupt-parent = <&UIC0>;
+ };
+
+ SDR0: sdr {
+ compatible = "ibm,sdr-460ex";
+ dcr-reg = <00e 002>;
+ };
+
+ CPR0: cpr {
+ compatible = "ibm,cpr-460ex";
+ dcr-reg = <00c 002>;
+ };
+
+ plb {
+ compatible = "ibm,plb-460ex", "ibm,plb4";
+ #address-cells = <2>;
+ #size-cells = <1>;
+ ranges;
+ clock-frequency = <0>; /* Filled in by U-Boot */
+
+ SDRAM0: sdram {
+ compatible = "ibm,sdram-460ex", "ibm,sdram-405gp";
+ dcr-reg = <010 2>;
+ };
+
+ MAL0: mcmal {
+ compatible = "ibm,mcmal-460ex", "ibm,mcmal2";
+ dcr-reg = <180 62>;
+ num-tx-chans = <2>;
+ num-rx-chans = <10>;
+ interrupt-parent = <&MAL0>;
+ interrupts = <0 1 2 3 4>;
+ #interrupt-cells = <1>;
+ #address-cells = <0>;
+ #size-cells = <0>;
+ interrupt-map = </*TXEOB*/ 0 &UIC2 6 4
+ /*RXEOB*/ 1 &UIC2 7 4
+ /*SERR*/ 2 &UIC2 3 4
+ /*TXDE*/ 3 &UIC2 4 4
+ /*RXDE*/ 4 &UIC2 5 4>;
+ interrupt-map-mask = <ffffffff>;
+ };
+
+ POB0: opb {
+ compatible = "ibm,opb-460ex", "ibm,opb";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <b0000000 4 b0000000 50000000>;
+ clock-frequency = <0>; /* Filled in by U-Boot */
+
+ EBC0: ebc {
+ compatible = "ibm,ebc-460ex", "ibm,ebc";
+ dcr-reg = <012 2>;
+ #address-cells = <2>;
+ #size-cells = <1>;
+ clock-frequency = <0>; /* Filled in by U-Boot */
+ interrupts = <6 4>;
+ interrupt-parent = <&UIC1>;
+ };
+
+ UART0: serial@ef600300 {
+ device_type = "serial";
+ compatible = "ns16550";
+ reg = <ef600300 8>;
+ virtual-reg = <ef600300>;
+ clock-frequency = <0>; /* Filled in by U-Boot */
+ current-speed = <0>; /* Filled in by U-Boot */
+ interrupt-parent = <&UIC1>;
+ interrupts = <1 4>;
+ };
+
+ UART1: serial@ef600400 {
+ device_type = "serial";
+ compatible = "ns16550";
+ reg = <ef600400 8>;
+ virtual-reg = <ef600400>;
+ clock-frequency = <0>; /* Filled in by U-Boot */
+ current-speed = <0>; /* Filled in by U-Boot */
+ interrupt-parent = <&UIC0>;
+ interrupts = <1 4>;
+ };
+
+ UART2: serial@ef600500 {
+ device_type = "serial";
+ compatible = "ns16550";
+ reg = <ef600500 8>;
+ virtual-reg = <ef600500>;
+ clock-frequency = <0>; /* Filled in by U-Boot */
+ current-speed = <0>; /* Filled in by U-Boot */
+ interrupt-parent = <&UIC1>;
+ interrupts = <1d 4>;
+ };
+
+ UART3: serial@ef600600 {
+ device_type = "serial";
+ compatible = "ns16550";
+ reg = <ef600600 8>;
+ virtual-reg = <ef600600>;
+ clock-frequency = <0>; /* Filled in by U-Boot */
+ current-speed = <0>; /* Filled in by U-Boot */
+ interrupt-parent = <&UIC1>;
+ interrupts = <1e 4>;
+ };
+
+ IIC0: i2c@4ef60700 {
+ device_type = "i2c";
+ compatible = "ibm,iic-460ex", "ibm,iic";
+ reg = <ef600700 14>;
+ interrupt-parent = <&UIC0>;
+ interrupts = <2 4>;
+ };
+
+ IIC1: i2c@ef600800 {
+ device_type = "i2c";
+ compatible = "ibm,iic-460ex", "ibm,iic";
+ reg = <ef600800 14>;
+ interrupt-parent = <&UIC0>;
+ interrupts = <3 4>;
+ };
+
+ ZMII0: emac-zmii@ef600d00 {
+ compatible = "ibm,zmii-460ex", "ibm,zmii";
+ reg = <ef600d00 c>;
+ };
+
+ RGMII0: emac-rgmii@ef601500 {
+ compatible = "ibm,rgmii-460ex", "ibm,rgmii";
+ reg = <ef601500 8>;
+ has-mdio;
+ };
+
+ EMAC0: ethernet@ef600e00 {
+ linux,network-index = <0>;
+ device_type = "network";
+ compatible = "ibm,emac-460ex", "ibm,emac4";
+ interrupt-parent = <&EMAC0>;
+ interrupts = <0 1>;
+ #interrupt-cells = <1>;
+ #address-cells = <0>;
+ #size-cells = <0>;
+ interrupt-map = </*Status*/ 0 &UIC2 10 4
+ /*Wake*/ 1 &UIC2 14 4>;
+ reg = <ef600e00 70>;
+ local-mac-address = [000000000000]; /* Filled in by U-Boot */
+ mal-device = <&MAL0>;
+ mal-tx-channel = <0>;
+ mal-rx-channel = <0>;
+ cell-index = <0>;
+ max-frame-size = <2328>;
+ rx-fifo-size = <1000>;
+ tx-fifo-size = <800>;
+ phy-mode = "rgmii";
+ phy-map = <00000000>;
+ zmii-device = <&ZMII0>;
+ zmii-channel = <0>;
+ rgmii-device = <&RGMII0>;
+ rgmii-channel = <0>;
+ has-inverted-stacr-oc;
+ has-new-stacr-staopc;
+ };
+
+ EMAC1: ethernet@ef600f00 {
+ linux,network-index = <1>;
+ device_type = "network";
+ compatible = "ibm,emac-460ex", "ibm,emac4";
+ interrupt-parent = <&EMAC1>;
+ interrupts = <0 1>;
+ #interrupt-cells = <1>;
+ #address-cells = <0>;
+ #size-cells = <0>;
+ interrupt-map = </*Status*/ 0 &UIC2 11 4
+ /*Wake*/ 1 &UIC2 15 4>;
+ reg = <ef600f00 70>;
+ local-mac-address = [000000000000]; /* Filled in by U-Boot */
+ mal-device = <&MAL0>;
+ mal-tx-channel = <1>;
+ mal-rx-channel = <8>;
+ cell-index = <1>;
+ max-frame-size = <2328>;
+ rx-fifo-size = <1000>;
+ tx-fifo-size = <800>;
+ phy-mode = "rgmii";
+ phy-map = <00000000>;
+ zmii-device = <&ZMII0>;
+ zmii-channel = <1>;
+ rgmii-device = <&RGMII0>;
+ rgmii-channel = <1>;
+ has-inverted-stacr-oc;
+ has-new-stacr-staopc;
+ };
+ };
+
+ PCIX0: pci@c0ec00000 {
+ device_type = "pci";
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ compatible = "ibm,plb-pcix-460ex", "ibm,plb-pcix";
+ primary;
+ large-inbound-windows;
+ enable-msi-hole;
+ reg = <c 0ec00000 8 /* Config space access */
+ 0 0 0 /* no IACK cycles */
+ c 0ed00000 4 /* Special cycles */
+ c 0ec80000 100 /* Internal registers */
+ c 0ec80100 fc>; /* Internal messaging registers */
+
+ /* Outbound ranges, one memory and one IO,
+ * later cannot be changed
+ */
+ ranges = <02000000 0 80000000 0000000d 80000000 0 80000000
+ 01000000 0 00000000 0000000c 08000000 0 00010000>;
+
+ /* Inbound 2GB range starting at 0 */
+ dma-ranges = <42000000 0 0 0 0 0 80000000>;
+
+ /* This drives busses 0 to 0x3f */
+ bus-range = <0 3f>;
+
+ /* All PCI interrupts are routed to ext IRQ 2 -> UIC1-2 */
+ interrupt-map-mask = <0000 0 0 0>;
+ interrupt-map = < 0000 0 0 0 &UIC1 2 8 >;
+ };
+
+ PCIE0: pciex@d00000000 {
+ device_type = "pci";
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ compatible = "ibm,plb-pciex-460ex", "ibm,plb-pciex";
+ primary;
+ port = <0>; /* port number */
+ reg = <d 00000000 20000000 /* Config space access */
+ c 08010000 00001000>; /* Registers */
+ dcr-reg = <100 020>;
+ sdr-base = <300>;
+
+ /* Outbound ranges, one memory and one IO,
+ * later cannot be changed
+ */
+ ranges = <02000000 0 80000000 0000000e 00000000 0 80000000
+ 01000000 0 00000000 0000000f 80000000 0 00010000>;
+
+ /* Inbound 2GB range starting at 0 */
+ dma-ranges = <42000000 0 0 0 0 0 80000000>;
+
+ /* This drives busses 40 to 0x7f */
+ bus-range = <40 7f>;
+
+ /* Legacy interrupts (note the weird polarity, the bridge seems
+ * to invert PCIe legacy interrupts).
+ * We are de-swizzling here because the numbers are actually for
+ * port of the root complex virtual P2P bridge. But I want
+ * to avoid putting a node for it in the tree, so the numbers
+ * below are basically de-swizzled numbers.
+ * The real slot is on idsel 0, so the swizzling is 1:1
+ */
+ interrupt-map-mask = <0000 0 0 7>;
+ interrupt-map = <
+ 0000 0 0 1 &UIC3 c 4 /* swizzled int A */
+ 0000 0 0 2 &UIC3 d 4 /* swizzled int B */
+ 0000 0 0 3 &UIC3 e 4 /* swizzled int C */
+ 0000 0 0 4 &UIC3 f 4 /* swizzled int D */>;
+ };
+
+ PCIE1: pciex@d20000000 {
+ device_type = "pci";
+ #interrupt-cells = <1>;
+ #size-cells = <2>;
+ #address-cells = <3>;
+ compatible = "ibm,plb-pciex-460ex", "ibm,plb-pciex";
+ primary;
+ port = <1>; /* port number */
+ reg = <d 20000000 20000000 /* Config space access */
+ c 08011000 00001000>; /* Registers */
+ dcr-reg = <120 020>;
+ sdr-base = <340>;
+
+ /* Outbound ranges, one memory and one IO,
+ * later cannot be changed
+ */
+ ranges = <02000000 0 80000000 0000000e 80000000 0 80000000
+ 01000000 0 00000000 0000000f 80010000 0 00010000>;
+
+ /* Inbound 2GB range starting at 0 */
+ dma-ranges = <42000000 0 0 0 0 0 80000000>;
+
+ /* This drives busses 80 to 0xbf */
+ bus-range = <80 bf>;
+
+ /* Legacy interrupts (note the weird polarity, the bridge seems
+ * to invert PCIe legacy interrupts).
+ * We are de-swizzling here because the numbers are actually for
+ * port of the root complex virtual P2P bridge. But I want
+ * to avoid putting a node for it in the tree, so the numbers
+ * below are basically de-swizzled numbers.
+ * The real slot is on idsel 0, so the swizzling is 1:1
+ */
+ interrupt-map-mask = <0000 0 0 7>;
+ interrupt-map = <
+ 0000 0 0 1 &UIC3 10 4 /* swizzled int A */
+ 0000 0 0 2 &UIC3 11 4 /* swizzled int B */
+ 0000 0 0 3 &UIC3 12 4 /* swizzled int C */
+ 0000 0 0 4 &UIC3 13 4 /* swizzled int D */>;
+ };
+ };
+};
--
1.5.4.2
^ permalink raw reply related
* [PATCH 2/5] [POWERPC] Add AMCC Canyonlands 460EX eval board support to platforms/44x
From: Stefan Roese @ 2008-02-21 14:00 UTC (permalink / raw)
To: linuxppc-dev
Signed-off-by: Stefan Roese <sr@denx.de>
---
arch/powerpc/platforms/44x/Kconfig | 18 ++++++++
arch/powerpc/platforms/44x/Makefile | 1 +
arch/powerpc/platforms/44x/canyonlands.c | 64 ++++++++++++++++++++++++++++++
3 files changed, 83 insertions(+), 0 deletions(-)
create mode 100644 arch/powerpc/platforms/44x/canyonlands.c
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index c062c4c..b56690c 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -67,6 +67,16 @@ config WARP
See http://www.pikatechnologies.com/ and follow the "PIKA for Computer
Telephony Developers" link for more information.
+config CANYONLANDS
+ bool "Canyonlands"
+ depends on 44x
+ default n
+ select 460EX
+ select PCI
+ select PPC4xx_PCI_EXPRESS
+ help
+ This option enables support for the AMCC PPC460EX evaluation board.
+
#config LUAN
# bool "Luan"
# depends on 44x
@@ -122,6 +132,14 @@ config 440SPe
select IBM_NEW_EMAC_EMAC4
bool
+config 460EX
+ bool
+ select PPC_FPU
+ select IBM_NEW_EMAC_EMAC4
+ select IBM_NEW_EMAC_RGMII
+ select IBM_NEW_EMAC_ZMII
+ select IBM_NEW_EMAC_TAH
+
# 44x errata/workaround config symbols, selected by the CPU models above
config IBM440EP_ERR42
bool
diff --git a/arch/powerpc/platforms/44x/Makefile b/arch/powerpc/platforms/44x/Makefile
index 0864d4f..d70eb03 100644
--- a/arch/powerpc/platforms/44x/Makefile
+++ b/arch/powerpc/platforms/44x/Makefile
@@ -7,3 +7,4 @@ obj-$(CONFIG_KATMAI) += katmai.o
obj-$(CONFIG_RAINIER) += rainier.o
obj-$(CONFIG_WARP) += warp.o
obj-$(CONFIG_WARP) += warp-nand.o
+obj-$(CONFIG_CANYONLANDS) += canyonlands.o
diff --git a/arch/powerpc/platforms/44x/canyonlands.c b/arch/powerpc/platforms/44x/canyonlands.c
new file mode 100644
index 0000000..dac5b32
--- /dev/null
+++ b/arch/powerpc/platforms/44x/canyonlands.c
@@ -0,0 +1,64 @@
+/*
+ * Canyonlands board specific routines
+ *
+ * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de>
+ *
+ * Based on the Katmai code by
+ * Benjamin Herrenschmidt <benh@kernel.crashing.org>
+ * Copyright 2007 IBM Corp.
+ * Josh Boyer <jwboyer@linux.vnet.ibm.com>
+ * Copyright 2007 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.
+ */
+#include <linux/init.h>
+#include <linux/of_platform.h>
+
+#include <asm/machdep.h>
+#include <asm/prom.h>
+#include <asm/udbg.h>
+#include <asm/time.h>
+#include <asm/uic.h>
+#include <asm/pci-bridge.h>
+
+#include "44x.h"
+
+static __initdata struct of_device_id canyonlands_of_bus[] = {
+ { .compatible = "ibm,plb4", },
+ { .compatible = "ibm,opb", },
+ { .compatible = "ibm,ebc", },
+ {},
+};
+
+static int __init canyonlands_device_probe(void)
+{
+ of_platform_bus_probe(NULL, canyonlands_of_bus, NULL);
+
+ return 0;
+}
+machine_device_initcall(canyonlands, canyonlands_device_probe);
+
+static int __init canyonlands_probe(void)
+{
+ unsigned long root = of_get_flat_dt_root();
+
+ if (!of_flat_dt_is_compatible(root, "amcc,canyonlands"))
+ return 0;
+
+ ppc_pci_flags = PPC_PCI_REASSIGN_ALL_RSRC;
+
+ return 1;
+}
+
+define_machine(canyonlands) {
+ .name = "Canyonlands",
+ .probe = canyonlands_probe,
+ .progress = udbg_progress,
+ .init_IRQ = uic_init_tree,
+ .get_irq = uic_get_irq,
+ .restart = ppc44x_reset_system,
+ .calibrate_decr = generic_calibrate_decr,
+};
--
1.5.4.2
^ permalink raw reply related
* [PATCH 1/5] [POWERPC] Add AMCC 460EX/460GT support to cputable.c & cpu_setup_44x.S
From: Stefan Roese @ 2008-02-21 14:00 UTC (permalink / raw)
To: linuxppc-dev
Signed-off-by: Stefan Roese <sr@denx.de>
---
arch/powerpc/kernel/cpu_setup_44x.S | 5 ++++-
arch/powerpc/kernel/cputable.c | 28 +++++++++++++++++++++++++++-
2 files changed, 31 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/cpu_setup_44x.S b/arch/powerpc/kernel/cpu_setup_44x.S
index 6250443..5465e8d 100644
--- a/arch/powerpc/kernel/cpu_setup_44x.S
+++ b/arch/powerpc/kernel/cpu_setup_44x.S
@@ -3,7 +3,7 @@
* Valentine Barshak <vbarshak@ru.mvista.com>
* MontaVista Software, Inc (c) 2007
*
- * Based on cpu_setup_6xx code by
+ * Based on cpu_setup_6xx code by
* Benjamin Herrenschmidt <benh@kernel.crashing.org>
*
* This program is free software; you can redistribute it and/or
@@ -32,6 +32,9 @@ _GLOBAL(__setup_cpu_440grx)
bl __fixup_440A_mcheck
mtlr r4
blr
+_GLOBAL(__setup_cpu_460ex)
+_GLOBAL(__setup_cpu_460gt)
+ b __init_fpu_44x
_GLOBAL(__setup_cpu_440gx)
_GLOBAL(__setup_cpu_440spe)
b __fixup_440A_mcheck
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index 2a8f5cc..26ffb44 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -36,6 +36,8 @@ extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_440gx(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_440spe(unsigned long offset, struct cpu_spec* spec);
+extern void __setup_cpu_460ex(unsigned long offset, struct cpu_spec* spec);
+extern void __setup_cpu_460gt(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
@@ -1397,6 +1399,30 @@ static struct cpu_spec __initdata cpu_specs[] = {
.machine_check = machine_check_440A,
.platform = "ppc440",
},
+ { /* 460EX */
+ .pvr_mask = 0xffff0002,
+ .pvr_value = 0x13020002,
+ .cpu_name = "460EX",
+ .cpu_features = CPU_FTRS_44X,
+ .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
+ .icache_bsize = 32,
+ .dcache_bsize = 32,
+ .cpu_setup = __setup_cpu_460ex,
+ .machine_check = machine_check_440A,
+ .platform = "ppc440",
+ },
+ { /* 460GT */
+ .pvr_mask = 0xffff0002,
+ .pvr_value = 0x13020000,
+ .cpu_name = "460GT",
+ .cpu_features = CPU_FTRS_44X,
+ .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
+ .icache_bsize = 32,
+ .dcache_bsize = 32,
+ .cpu_setup = __setup_cpu_460gt,
+ .machine_check = machine_check_440A,
+ .platform = "ppc440",
+ },
#endif /* CONFIG_44x */
#ifdef CONFIG_FSL_BOOKE
#ifdef CONFIG_E200
@@ -1512,7 +1538,7 @@ struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
*t = *s;
*PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
- /* ppc64 and booke expect identify_cpu to also call
+ /* ppc64 and booke expect identify_cpu to also call
* setup_cpu for that processor. I will consolidate
* that at a later time, for now, just use #ifdef.
* we also don't need to PTRRELOC the function pointer
--
1.5.4.2
^ permalink raw reply related
* Re: [PATCH 1/1] [PPC] 8xx swap bug-fix
From: Wolfgang Denk @ 2008-02-21 12:21 UTC (permalink / raw)
To: Vitaly Bordug; +Cc: dzu, linuxppc-dev, Mackerras, Paul, Scott Wood
In-Reply-To: <20080205013857.47ebe544@kernel.crashing.org>
Dear Vitaly,
in message <20080205013857.47ebe544@kernel.crashing.org> you wrote:
> On Mon, 4 Feb 2008 12:24:21 -0600
> Scott Wood wrote:
>
> > On Sat, Feb 02, 2008 at 12:22:17PM +0100, Jochen Friedrich wrote:
> > > Hi Yuri,
> > >
> > > > Here is the patch which makes Linux-2.6 swap routines operate
> > > > correctly on the ppc-8xx-based machines.
> > >
> > > is there any 8xx board left which isn't ported to ARCH=powerpc?
> >
> > More importantly, is this something that is also broken in
> > arch/powerpc? It looks like it has the same code...
> >
> yes, it is. Though there is currently no best-at-all solution, this looks worth trying.
> I'll have a look how the 8xx feels under load and report back.
Have you been able to check if arch/powerpc needs similar fixing?
Also, what is the current state of this patch? I would like to avoid
that it get's lost completeley.
BenH commented on Tue, 05 Feb 2008 18:37:07 +1100:
> Best is to just remove writeback completely and let the generic
> code handle it.
Has this been considered / tested by anybody?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Man did not weave the web of life; he is merely a strand in it.
Whatever he does to the web, he does to himself. - Seattle [1854]
^ permalink raw reply
* Re: Please pull powerpc.git merge branch
From: Paul Mackerras @ 2008-02-21 12:15 UTC (permalink / raw)
To: torvalds; +Cc: linuxppc-dev, akpm, linux-kernel
In-Reply-To: <18363.41603.210217.163071@cargo.ozlabs.ibm.com>
Linus,
Since I send the last pull request I have added four more commits to
the powerpc.git merge branch, two from Olof Johansson fixing a bug and
a warning for the pasemi platform, and two spufs bugfixes from Jeremy
Kerr.
Please do:
git pull \
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc.git merge
The diffstat and log below reflect all the outstanding commits, not
just the new four.
Thanks,
Paul.
arch/powerpc/boot/Makefile | 8
arch/powerpc/boot/dts/bamboo.dts | 3
arch/powerpc/boot/dts/ebony.dts | 2
arch/powerpc/boot/dts/katmai.dts | 2
arch/powerpc/boot/dts/kilauea.dts | 3
arch/powerpc/boot/dts/makalu.dts | 3
arch/powerpc/boot/dts/rainier.dts | 4
arch/powerpc/boot/dts/sequoia.dts | 4
arch/powerpc/boot/dts/taishan.dts | 4
arch/powerpc/configs/bamboo_defconfig | 81 ++-
arch/powerpc/configs/ebony_defconfig | 79 ++
arch/powerpc/configs/ep405_defconfig | 92 ++-
arch/powerpc/configs/kilauea_defconfig | 69 +-
arch/powerpc/configs/makalu_defconfig | 69 +-
arch/powerpc/configs/ppc44x_defconfig | 904 ++++++++++++++++++++++++++++
arch/powerpc/configs/rainier_defconfig | 82 ++-
arch/powerpc/configs/sequoia_defconfig | 77 ++
arch/powerpc/configs/taishan_defconfig | 81 ++-
arch/powerpc/configs/walnut_defconfig | 81 ++-
arch/powerpc/configs/warp_defconfig | 139 +++-
arch/powerpc/kernel/kprobes.c | 9
arch/powerpc/kernel/prom.c | 13
arch/powerpc/platforms/44x/Kconfig | 10
arch/powerpc/platforms/cell/spu_base.c | 12
arch/powerpc/platforms/cell/spufs/run.c | 1
arch/powerpc/platforms/cell/spufs/sched.c | 8
arch/powerpc/platforms/cell/spufs/switch.c | 6
arch/powerpc/platforms/pasemi/Makefile | 2
arch/powerpc/platforms/pasemi/misc.c | 97 +++
arch/powerpc/platforms/pseries/power.c | 2
arch/powerpc/sysdev/mpic_pasemi_msi.c | 5
arch/ppc/platforms/4xx/ibm440ep.c | 6
drivers/net/ibm_newemac/rgmii.c | 1
include/asm-powerpc/spu.h | 3
34 files changed, 1605 insertions(+), 357 deletions(-)
create mode 100644 arch/powerpc/configs/ppc44x_defconfig
create mode 100644 arch/powerpc/platforms/pasemi/misc.c
Ananth N Mavinakayanahalli (1):
[POWERPC] Kill sparse warnings in kprobes
Andre Detsch (1):
[POWERPC] cell: fix spurious false return from spu_trap_data_{map,seg}
Becky Bruce (1):
[POWERPC] Fix dt_mem_next_cell() to read the full address
Jeremy Kerr (1):
[POWERPC] spufs: fix scheduler starvation by idle contexts
Josh Boyer (4):
[POWERPC] 4xx: Update defconfigs for 2.6.25
[POWERPC] 44x: Fix Kconfig formatting
[POWERPC] 44x: Add multiplatform defconfig
[POWERPC] Fix bootwrapper builds with older gcc versions
Olof Johansson (2):
[POWERPC] pasemi: Register i2c devices at boot
[POWERPC] pasemi: Remove warning in mpic_pasemi_msi.c
Stefan Roese (2):
[POWERPC] net: NEWEMAC: Remove "rgmii-interface" from rgmii matching table
[POWERPC] 4xx: Remove "i2c" and "xxmii-interface" device_types from dts
Stephen Rothwell (1):
[POWERPC] Fix warning in pseries/power.c
Wolfgang Ocker (1):
[POWERPC] PPC440EP Interrupt Triggering and Level Settings
^ permalink raw reply
* Re: [PATCHv4 2.6.25] i2c: adds support for i2c bus on Freescale CPM1/CPM2 controllers
From: Jean Delvare @ 2008-02-21 12:05 UTC (permalink / raw)
To: Jochen Friedrich; +Cc: linux-kernel, linuxppc-dev list, i2c, Scott Wood
In-Reply-To: <47A1C4E9.4000003@scram.de>
Hallo Jochen,
On Thu, 31 Jan 2008 13:54:01 +0100, Jochen Friedrich wrote:
> Using the port of 2.4 code from Vitaly Bordug <vitb@kernel.crashing.org>
> and the actual algorithm used by the i2c driver of the DBox code on
> cvs.tuxboc.org from Tmbinc, Gillem (htoa@gmx.net). Renamed i2c-rpx.c and
> i2c-algo-8xx.c to i2c-cpm.c and converted the driver to an
> of_platform_driver.
>
> Signed-off-by: Jochen Friedrich <jochen@scram.de>
> ---
> drivers/i2c/busses/Kconfig | 10 +
> drivers/i2c/busses/Makefile | 1 +
> drivers/i2c/busses/i2c-cpm.c | 759 ++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 770 insertions(+), 0 deletions(-)
> create mode 100644 drivers/i2c/busses/i2c-cpm.c
>
> diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
> index b61f56b..1d18db7 100644
> --- a/drivers/i2c/busses/Kconfig
> +++ b/drivers/i2c/busses/Kconfig
> @@ -114,6 +114,16 @@ config I2C_BLACKFIN_TWI_CLK_KHZ
> help
> The unit of the TWI clock is kHz.
>
> +config I2C_CPM
> + tristate "Freescale CPM1 or CPM2 (MPC8xx/826x)"
> + depends on (CPM1 || CPM2) && I2C && PPC_OF
The dependency on I2C is now handled at menu level, you no longer need
to mention it here.
> + help
> + This supports the use of the I2C interface on Freescale
> + processors with CPM1 or CPM2.
> +
> + This driver can also be built as a module. If so, the module
> + will be called i2c-cpm.
> +
> config I2C_DAVINCI
> tristate "DaVinci I2C driver"
> depends on ARCH_DAVINCI
> diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
> index ea7068f..1291e2b 100644
> --- a/drivers/i2c/busses/Makefile
> +++ b/drivers/i2c/busses/Makefile
> @@ -11,6 +11,7 @@ obj-$(CONFIG_I2C_AMD8111) += i2c-amd8111.o
> obj-$(CONFIG_I2C_AT91) += i2c-at91.o
> obj-$(CONFIG_I2C_AU1550) += i2c-au1550.o
> obj-$(CONFIG_I2C_BLACKFIN_TWI) += i2c-bfin-twi.o
> +obj-$(CONFIG_I2C_CPM) += i2c-cpm.o
> obj-$(CONFIG_I2C_DAVINCI) += i2c-davinci.o
> obj-$(CONFIG_I2C_ELEKTOR) += i2c-elektor.o
> obj-$(CONFIG_I2C_GPIO) += i2c-gpio.o
> diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
> new file mode 100644
> index 0000000..7191427
> --- /dev/null
> +++ b/drivers/i2c/busses/i2c-cpm.c
> @@ -0,0 +1,759 @@
> +/*
> + * Freescale CPM1/CPM2 I2C interface.
> + * Copyright (c) 1999 Dan Malek (dmalek@jlc.net).
> + *
> + * moved into proper i2c interface;
> + * Brad Parker (brad@heeltoe.com)
> + *
> + * (C) 2007 Montavista Software, Inc.
> + * Vitaly Bordug <vitb@kernel.crashing.org>
> + *
> + * RPX lite specific parts of the i2c interface
> + * Update: There actually isn't anything RPXLite-specific about this module.
> + * This should work for most any CPM board. The console messages have been
> + * changed to eliminate RPXLite references.
Maybe this block comment can be removed entirely? It adds more
confusion than value IMHO.
> + *
> + 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.
> +
> + This program is distributed in the hope that it will be useful,
> + but WITHOUT ANY WARRANTY; without even the implied warranty of
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + GNU General Public License for more details.
> +
> + You should have received a copy of the GNU General Public License
> + along with this program; if not, write to the Free Software
> + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> + *
> + * moved into proper i2c interface; separated out platform specific
> + * parts into i2c-8xx.c
> + * Brad Parker (brad@heeltoe.com)
Redundant with one of the block comments above.
> + *
> + * Parts from dbox2_i2c.c (cvs.tuxbox.org)
> + * (C) 2000-2001 Tmbinc, Gillem (htoa@gmx.net)
> + *
> + * (C) 2007 Montavista Software, Inc.
> + * Vitaly Bordug <vitb@kernel.crashing.org>
Redundant as well.
> + *
> + * Converted to of_platform_device. Renamed to i2c-cpm.c.
> + * (C) 2007 Jochen Friedrich <jochen@scram.de>
> + */
Please group all the copyright statements together, having some before
the GPL boilerplate and some after is rather confusing.
> +
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/delay.h>
> +#include <linux/slab.h>
> +#include <linux/init.h>
> +#include <linux/interrupt.h>
> +#include <linux/errno.h>
> +#include <linux/sched.h>
It's not obvious to me why you need to include <linux/sched.h>, please
clarify.
> +#include <linux/stddef.h>
> +#include <linux/i2c.h>
> +#include <linux/io.h>
> +#include <linux/time.h>
I don't think that you need <linux/time.h> either?
> +#include <linux/dma-mapping.h>
> +#include <linux/of_device.h>
> +#include <linux/of_platform.h>
> +#include <sysdev/fsl_soc.h>
> +#include <asm/cpm.h>
> +
> +/*
> + * Wait for patch from Jon Smirl
> + * #include "powerpc-common.h"
> + */
It doesn't make sense to merge this comment upstream.
> +
> +/* Try to define this if you have an older CPU (earlier than rev D4) */
> +/* However, better use a GPIO based bitbang driver in this case :/ */
> +#undef I2C_CHIP_ERRATA
> +
> +#define CPM_MAX_READ 513
> +#define CPM_MAXBD 4
> +
> +#define CPM_CR_INIT_TRX (0x00)
> +#define CPM_CR_CLOSE_RXBD (0x07)
> +
> +#define I2C_EB (0x10) /* Big endian mode */
> +
> +/* I2C parameter RAM. */
> +struct i2c_ram {
> + ushort rbase; /* Rx Buffer descriptor base address */
> + ushort tbase; /* Tx Buffer descriptor base address */
> + u_char rfcr; /* Rx function code */
> + u_char tfcr; /* Tx function code */
> + ushort mrblr; /* Max receive buffer length */
> + uint rstate; /* Internal */
> + uint rdp; /* Internal */
> + ushort rbptr; /* Rx Buffer descriptor pointer */
> + ushort rbc; /* Internal */
> + uint rxtmp; /* Internal */
> + uint tstate; /* Internal */
> + uint tdp; /* Internal */
> + ushort tbptr; /* Tx Buffer descriptor pointer */
> + ushort tbc; /* Internal */
> + uint txtmp; /* Internal */
> + char res1[4]; /* Reserved */
> + ushort rpbase; /* Relocation pointer */
> + char res2[2]; /* Reserved */
> +};
> +
> +/* I2C Registers */
> +struct i2c_reg {
> + u8 i2mod;
> + u8 res1[3];
> + u8 i2add;
> + u8 res2[3];
> + u8 i2brg;
> + u8 res3[3];
> + u8 i2com;
> + u8 res4[3];
> + u8 i2cer;
> + u8 res5[3];
> + u8 i2cmr;
> +};
> +
> +struct cpm_i2c {
> + char *base;
> + struct of_device *ofdev;
> + struct i2c_adapter adap;
> + uint dp_addr;
> + int version; /* CPM1=1, CPM2=2 */
> + int irq;
> + int cp_command;
> + struct i2c_reg __iomem *i2c_reg;
> + struct i2c_ram __iomem *i2c_ram;
> + u16 i2c_addr;
> + wait_queue_head_t i2c_wait;
> + struct mutex i2c_mutex; /* Protects I2C CPM */
"I2C CPM" isn't very descriptive. Best would be to list the structure
fields which are protected.
> + u_char *txbuf[CPM_MAXBD];
> + u_char *rxbuf[CPM_MAXBD];
> + u32 txdma[CPM_MAXBD];
> + u32 rxdma[CPM_MAXBD];
> +};
> +
> +static irqreturn_t cpm_i2c_interrupt(int irq, void *dev_id)
> +{
> + struct cpm_i2c *cpm;
> + struct i2c_reg __iomem *i2c_reg;
> + struct i2c_adapter *adap = dev_id;
> + int i;
> +
> + cpm = i2c_get_adapdata(dev_id);
> + i2c_reg = cpm->i2c_reg;
> +
> + /* Clear interrupt. */
> + i = in_8(&i2c_reg->i2cer);
> + out_8(&i2c_reg->i2cer, i);
> +
> + dev_dbg(&adap->dev, "Interrupt: %x\n", i);
> +
> + /* Get 'me going again. */
Extra '.
> + wake_up_interruptible(&cpm->i2c_wait);
> +
> + return i ? IRQ_HANDLED : IRQ_NONE;
> +}
> +
> +static void cpm_reset_i2c_params(struct cpm_i2c *cpm)
> +{
> + struct i2c_ram __iomem *i2c_ram = cpm->i2c_ram;
> +
> + /* Set up the IIC parameters in the parameter ram. */
> + out_be16(&i2c_ram->tbase, cpm->dp_addr);
> + out_be16(&i2c_ram->rbase, cpm->dp_addr + sizeof(cbd_t) * CPM_MAXBD);
> +
> + out_8(&i2c_ram->tfcr, I2C_EB);
> + out_8(&i2c_ram->rfcr, I2C_EB);
> +
> + out_be16(&i2c_ram->mrblr, CPM_MAX_READ);
> +
> + out_be32(&i2c_ram->rstate, 0);
> + out_be32(&i2c_ram->rdp, 0);
> + out_be16(&i2c_ram->rbptr, in_be16(&i2c_ram->rbase));
> + out_be16(&i2c_ram->rbc, 0);
> + out_be32(&i2c_ram->rxtmp, 0);
> + out_be32(&i2c_ram->tstate, 0);
> + out_be32(&i2c_ram->tdp, 0);
> + out_be16(&i2c_ram->tbptr, in_be16(&i2c_ram->tbase));
> + out_be16(&i2c_ram->tbc, 0);
> + out_be32(&i2c_ram->txtmp, 0);
> +}
> +
> +static void cpm_i2c_force_close(struct i2c_adapter *adap)
> +{
> + struct cpm_i2c *cpm = i2c_get_adapdata(adap);
> + struct i2c_reg __iomem *i2c_reg = cpm->i2c_reg;
> +
> + dev_dbg(&adap->dev, "cpm_i2c_force_close()\n");
> +
> + cpm_command(cpm->cp_command, CPM_CR_CLOSE_RXBD);
> +
> + out_8(&i2c_reg->i2cmr, 0x00); /* Disable all interrupts */
> + out_8(&i2c_reg->i2cer, 0xff);
> +}
> +
> +static void cpm_i2c_parse_message(struct i2c_adapter *adap,
> + struct i2c_msg *pmsg, int num, int tx, int rx)
> +{
> + cbd_t *tbdf, *rbdf;
> + u_char addr;
> + u_char *tb;
> + u_char *rb;
> + struct cpm_i2c *cpm = i2c_get_adapdata(adap);
> + struct i2c_ram __iomem *i2c_ram = cpm->i2c_ram;
> + int i, dscan;
> +
> + tbdf = (cbd_t *) cpm_muram_addr(in_be16(&i2c_ram->tbase));
> + rbdf = (cbd_t *) cpm_muram_addr(in_be16(&i2c_ram->rbase));
> +
> + /*
> + * This chip can't do zero length writes. However, the i2c core uses
> + * them to scan for devices. The best we can do is to convert them
> + * into 1 byte reads
> + */
Nack. New-style i2c drivers don't require this probing mechanism,
that's what you want to use if your I2C master doesn't support
zero-byte messages. Well, that's most probably what you want to use on
embedded platforms anyway.
So, please no hack for zero-byte messages. If they aren't supported by
the hardware, they aren't supported by the driver either.
> +
> + dscan = ((pmsg->len == 0) && (num == 1));
> +
> + addr = pmsg->addr << 1;
> + if ((pmsg->flags & I2C_M_RD) || dscan)
> + addr |= 1;
> +
> + tb = cpm->txbuf[tx];
> + rb = cpm->rxbuf[rx];
> +
> + /* Align read buffer */
> + rb = (u_char *) (((ulong) rb + 1) & ~1);
> +
> + if ((pmsg->flags & I2C_M_RD) || dscan) {
> + /*
> + * To read, we need an empty buffer of the proper length.
> + * All that is used is the first byte for address, the remainder
> + * is just used for timing (and doesn't really have to exist).
> + */
> + tb[0] = addr; /* Device address byte w/rw flag */
> +
> + dev_dbg(&adap->dev, "cpm_i2c_read(abyte=0x%x)\n", addr);
> +
> + if (dscan)
> + tbdf[tx].cbd_datlen = 2;
> + else
> + tbdf[tx].cbd_datlen = pmsg->len + 1;
> +
> + tbdf[tx].cbd_sc = 0;
> +
> + if (!(pmsg->flags & I2C_M_NOSTART))
> + tbdf[tx].cbd_sc |= BD_I2C_START;
> + if (tx + 1 == num)
> + tbdf[tx].cbd_sc |= BD_SC_LAST | BD_SC_WRAP;
> +
> + rbdf[rx].cbd_datlen = 0;
> + rbdf[rx].cbd_sc = BD_SC_EMPTY | BD_SC_INTRPT;
> +
> + if (rx + 1 == CPM_MAXBD)
> + tbdf[rx].cbd_sc |= BD_SC_WRAP;
> +
> + eieio();
> + tbdf[tx].cbd_sc |= BD_SC_READY;
> + } else {
> + tb[0] = addr; /* Device address byte w/rw flag */
> + for (i = 0; i < pmsg->len; i++)
> + tb[i+1] = pmsg->buf[i];
> +
> + dev_dbg(&adap->dev, "cpm_iic_write(abyte=0x%x)\n", addr);
> +
> + tbdf[tx].cbd_datlen = pmsg->len + 1;
> + tbdf[tx].cbd_sc = 0;
> +
> + if (!(pmsg->flags & I2C_M_NOSTART))
> + tbdf[tx].cbd_sc |= BD_I2C_START;
> +
> + if (tx + 1 == num)
> + tbdf[tx].cbd_sc |= BD_SC_LAST | BD_SC_WRAP;
> +
> + eieio();
> + tbdf[tx].cbd_sc |= BD_SC_READY | BD_SC_INTRPT;
> +
> + dev_dbg(&adap->dev, "tx sc %d %04x\n",
> + tx, tbdf[tx].cbd_sc);
> + }
> +}
> +
> +static int cpm_i2c_check_message(struct i2c_adapter *adap,
> + struct i2c_msg *pmsg, int tx, int rx)
> +{
> + cbd_t *tbdf, *rbdf;
> + u_char *tb;
> + u_char *rb;
> + struct cpm_i2c *cpm = i2c_get_adapdata(adap);
> + struct i2c_ram __iomem *i2c_ram = cpm->i2c_ram;
> + int i;
> +
> + tbdf = (cbd_t *) cpm_muram_addr(in_be16(&i2c_ram->tbase));
> + rbdf = (cbd_t *) cpm_muram_addr(in_be16(&i2c_ram->rbase));
> +
> + tb = cpm->txbuf[tx];
> + rb = cpm->rxbuf[rx];
> +
> + /* Align read buffer */
> + rb = (u_char *) (((uint) rb + 1) & ~1);
> +
> + if (pmsg->flags & I2C_M_RD) {
> + dev_dbg(&adap->dev, "rx sc %04x, rx sc %04x\n",
> + tbdf[tx].cbd_sc, rbdf[rx].cbd_sc);
> +
> + if (tbdf[tx].cbd_sc & BD_SC_NAK) {
> + dev_dbg(&adap->dev, "IIC read; No ack\n");
> +
> + if (pmsg->flags & I2C_M_IGNORE_NAK)
> + return 0;
Are there known I2C chips on this platform which need this flag? Its
implementation is purely optional, only a few broken I2C chips need it,
so it should really only be implemented when strictly needed.
> + else
> + return -EIO;
> + }
> + if (rbdf[rx].cbd_sc & BD_SC_EMPTY) {
> + dev_dbg(&adap->dev,
> + "IIC read; complete but rbuf empty\n");
> + return -EREMOTEIO;
> + }
> + if (rbdf[rx].cbd_sc & BD_SC_OV) {
> + dev_dbg(&adap->dev, "IIC read; Overrun\n");
> + return -EREMOTEIO;
> + }
> + for (i = 0; i < pmsg->len; i++)
> + pmsg->buf[i] = rb[i];
> + } else {
> + dev_dbg(&adap->dev, "tx sc %d %04x\n", tx, tbdf[tx].cbd_sc);
> +
> + if (tbdf[tx].cbd_sc & BD_SC_NAK) {
> + dev_dbg(&adap->dev, "IIC write; No ack\n");
> +
> + if (pmsg->flags & I2C_M_IGNORE_NAK)
> + return 0;
> + else
> + return -EIO;
> + }
> + if (tbdf[tx].cbd_sc & BD_SC_UN) {
> + dev_dbg(&adap->dev, "IIC write; Underrun\n");
> + return -EIO;
> + }
> + if (tbdf[tx].cbd_sc & BD_SC_CL) {
> + dev_dbg(&adap->dev, "IIC write; Collision\n");
> + return -EIO;
> + }
> + }
> + return 0;
> +}
Many of the dev_dbg() calls in the function above could be replaced
with dev_err(), methinks.
> +
> +static int cpm_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
> +{
> + struct cpm_i2c *cpm = i2c_get_adapdata(adap);
> + struct i2c_reg __iomem *i2c_reg = cpm->i2c_reg;
> + struct i2c_ram __iomem *i2c_ram = cpm->i2c_ram;
> + struct i2c_msg *pmsg, *rmsg;
> + int ret, i;
> + int tptr;
> + int rptr;
> + cbd_t *tbdf, *rbdf;
> +
> + if (num > CPM_MAXBD)
> + return -EINVAL;
> +
> + /* Check if we have any oversized READ requests */
> + for (i = 0; i < num; i++) {
> + pmsg = &msgs[i];
> + if (pmsg->len >= CPM_MAX_READ)
> + return -EINVAL;
> + }
> +
> + mutex_lock(&cpm->i2c_mutex);
> +
> + /* Reset to use first buffer */
> + out_be16(&i2c_ram->rbptr, in_be16(&i2c_ram->rbase));
> + out_be16(&i2c_ram->tbptr, in_be16(&i2c_ram->tbase));
> +
> + tbdf = (cbd_t *) cpm_muram_addr(in_be16(&i2c_ram->tbase));
> + rbdf = (cbd_t *) cpm_muram_addr(in_be16(&i2c_ram->rbase));
> +
> + tptr = 0;
> + rptr = 0;
> +
> + while (tptr < num) {
> + pmsg = &msgs[tptr];
> + dev_dbg(&adap->dev, "i2c-algo-cpm.o: " "R: %d T: %d\n",
Incorrect (and unneeded) file name reference.
> + rptr, tptr);
> +
> + cpm_i2c_parse_message(adap, pmsg, num, tptr, rptr);
> + if (pmsg->flags & I2C_M_RD)
> + rptr++;
> + tptr++;
> + }
> + /* Start transfer now */
> + /* Chip bug, set enable here */
> + out_8(&i2c_reg->i2cmr, 0x13); /* Enable RX/TX/Error interupts */
> + out_8(&i2c_reg->i2cer, 0xff); /* Clear interrupt status */
> + out_8(&i2c_reg->i2mod, in_8(&i2c_reg->i2mod) | 1); /* Enable */
> + /* Begin transmission */
> + out_8(&i2c_reg->i2com, in_8(&i2c_reg->i2com) | 0x80);
> +
> + tptr = 0;
> + rptr = 0;
> +
> + while (tptr < num) {
> + /* Check for outstanding messages */
> + dev_dbg(&adap->dev, "test ready.\n");
> + if (!(tbdf[tptr].cbd_sc & BD_SC_READY)) {
> + dev_dbg(&adap->dev, "ready.\n");
> + rmsg = &msgs[tptr];
> + ret = cpm_i2c_check_message(adap, rmsg, tptr, rptr);
> + tptr++;
> + if (rmsg->flags & I2C_M_RD)
> + rptr++;
> + if (ret)
> + goto out_err;
> + } else {
> + dev_dbg(&adap->dev, "not ready.\n");
> + ret = wait_event_interruptible_timeout(cpm->i2c_wait,
> + !(tbdf[tptr].cbd_sc & BD_SC_READY), 1 * HZ);
> + if (ret == 0) {
> + ret = -EREMOTEIO;
> + dev_dbg(&adap->dev, "I2C read: timeout!\n");
> + goto out_err;
> + }
> + }
> + }
> +#ifdef I2C_CHIP_ERRATA
> + /*
> + * Chip errata, clear enable. This is not needed on rev D4 CPUs.
> + * Disabling I2C too early may cause too short stop condition
> + */
> + udelay(4);
> + out_8(&i2c_reg->i2mod, in_8(&i2c_reg->i2mod) | ~1);
> +#endif
> + mutex_unlock(&cpm->i2c_mutex);
> + return (num);
> +
> +out_err:
> + cpm_i2c_force_close(adap);
> +#ifdef I2C_CHIP_ERRATA
> + /*
> + * Chip errata, clear enable. This is not needed on rev D4 CPUs.
> + */
> + out_8(&i2c_reg->i2mod, in_8(&i2c_reg->i2mod) | ~1);
> +#endif
> + mutex_unlock(&cpm->i2c_mutex);
> + return ret;
> +}
> +
> +static u32 cpm_i2c_func(struct i2c_adapter *adap)
> +{
> + return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
Actually I2C_FUNC_I2C | (I2C_FUNC_SMBUS_EMUL & ~I2C_FUNC_SMBUS_QUICK)
according to my comment above.
> +}
> +
> +/* -----exported algorithm data: ------------------------------------- */
> +
> +static const struct i2c_algorithm cpm_i2c_algo = {
> + .master_xfer = cpm_i2c_xfer,
> + .functionality = cpm_i2c_func,
> +};
> +
> +static const struct i2c_adapter cpm_ops = {
> + .owner = THIS_MODULE,
> + .name = "i2c-cpm",
> + .id = I2C_HW_MPC8XX_EPON,
Not defined anywhere, so this won't build. This ID is optional, so if
you don't need it, just don't set it. With the advent of new-style i2c
device drivers, the use of these IDs will hopefully phase out.
> + .algo = &cpm_i2c_algo,
> + .class = I2C_CLASS_HWMON,
> +};
> +
> +static int cpm_i2c_setup(struct cpm_i2c *cpm)
Could be __devinit.
> +{
> + struct of_device *ofdev = cpm->ofdev;
> + const u32 *data;
> + int len, ret, i;
> + void __iomem *i2c_base;
> + cbd_t *tbdf, *rbdf;
> + unsigned char brg;
> +
> + pr_debug("i2c-cpm: cpm_i2c_setup()\n");
dev_dbg()
> +
> + init_waitqueue_head(&cpm->i2c_wait);
> + mutex_init(&cpm->i2c_mutex);
> +
> + cpm->irq = of_irq_to_resource(ofdev->node, 0, NULL);
> + if (cpm->irq == NO_IRQ)
> + return -EINVAL;
> +
> + /* Install interrupt handler. */
> + ret = request_irq(cpm->irq, cpm_i2c_interrupt, 0, "cpm_i2c",
> + &cpm->adap);
> + if (ret)
> + goto out_irq;
> +
> + /* IIC parameter RAM */
> + i2c_base = of_iomap(ofdev->node, 1);
> + if (i2c_base == NULL) {
> + ret = -EINVAL;
> + goto out_irq;
> + }
> +
> + if (of_device_is_compatible(ofdev->node, "fsl,cpm1-i2c")) {
> +
> + /* Check for and use a microcode relocation patch. */
> + cpm->i2c_ram = i2c_base;
> + cpm->i2c_addr = in_be16(&cpm->i2c_ram->rpbase);
> +
> + /*
> + * Maybe should use cpm_muram_alloc instead of hardcoding
> + * this in micropatch.c
> + */
> + if (cpm->i2c_addr) {
> + cpm->i2c_ram = cpm_muram_addr(cpm->i2c_addr);
> + iounmap(i2c_base);
> + }
> +
> + cpm->version = 1;
> +
> + } else if (of_device_is_compatible(ofdev->node, "fsl,cpm2-i2c")) {
> + cpm->i2c_addr = cpm_muram_alloc(sizeof(struct i2c_ram), 64);
> + cpm->i2c_ram = cpm_muram_addr(cpm->i2c_addr);
> + out_be16(i2c_base, cpm->i2c_addr);
> + iounmap(i2c_base);
> +
> + cpm->version = 2;
> +
> + } else {
> + iounmap(i2c_base);
> + ret = -EINVAL;
> + goto out_irq;
> + }
> +
> + /* I2C control/status registers */
> + cpm->i2c_reg = of_iomap(ofdev->node, 0);
> + if (cpm->i2c_reg == NULL) {
> + ret = -EINVAL;
> + goto out_ram;
> + }
> +
> + data = of_get_property(ofdev->node, "fsl,cpm-command", &len);
> + if (!data || len != 4) {
> + ret = -EINVAL;
> + goto out_reg;
> + }
> + cpm->cp_command = *data;
> +
> + data = of_get_property(ofdev->node, "linux,i2c-class", &len);
> + if (data && len == 4)
> + cpm->adap.class = *data;
> +
> + /*
> + * Allocate space for CPM_MAXBD transmit and receive buffer
> + * descriptors in the DP ram.
> + */
> + cpm->dp_addr = cpm_muram_alloc(sizeof(cbd_t) * 2 * CPM_MAXBD, 8);
> + if (!cpm->dp_addr) {
> + ret = -ENOMEM;
> + goto out_reg;
> + }
> +
> + /* Initialize Tx/Rx parameters. */
> +
> + cpm_reset_i2c_params(cpm);
> +
> + pr_debug("i2c-cpm: i2c_ram %x, dp_addr 0x%x\n", (uint) cpm->i2c_ram,
> + cpm->dp_addr);
> + pr_debug("i2c-cpm: tbase %d, rbase %d\n",
> + in_be16(&cpm->i2c_ram->tbase), in_be16(&cpm->i2c_ram->rbase));
dev_dbg()
> +
> + tbdf = (cbd_t *) cpm_muram_addr(in_be16(&cpm->i2c_ram->tbase));
> + rbdf = (cbd_t *) cpm_muram_addr(in_be16(&cpm->i2c_ram->rbase));
> +
> + /* Allocate TX and RX buffers */
> +
> + for (i = 0; i < CPM_MAXBD; i++) {
> + cpm->rxbuf[i] = dma_alloc_coherent(
> + NULL, CPM_MAX_READ + 1, &cpm->rxdma[i], GFP_KERNEL);
> + if (!cpm->rxbuf[i]) {
> + ret = -ENOMEM;
> + goto out_muram;
> + }
> + rbdf[i].cbd_bufaddr = ((cpm->rxdma[i] + 1) & ~1);
> + cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(
> + NULL, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL);
> + if (!cpm->txbuf[i]) {
> + ret = -ENOMEM;
> + goto out_muram;
> + }
> + tbdf[i].cbd_bufaddr = cpm->txdma[i];
> + }
> +
> + cpm_command(cpm->cp_command, CPM_CR_INIT_TRX);
> +
> + /*
> + * Select an invalid address. Just make sure we don't use loopback mode
> + */
> + out_8(&cpm->i2c_reg->i2add, 0xfe);
> +
> + /* Make clock run at 60 kHz. */
> +
> + brg = get_brgfreq() / (32 * 2 * 60000) - 3;
> + out_8(&cpm->i2c_reg->i2brg, brg);
> +
> + out_8(&cpm->i2c_reg->i2mod, 0x00);
> + out_8(&cpm->i2c_reg->i2com, 0x01); /* Master mode */
> +
> + /* Disable interrupts. */
> + out_8(&cpm->i2c_reg->i2cmr, 0);
> + out_8(&cpm->i2c_reg->i2cer, 0xff);
> +
> + return 0;
> +
> +out_muram:
> + for (i = 0; i < CPM_MAXBD; i++) {
> + if (cpm->rxbuf[i])
> + dma_free_coherent(NULL, CPM_MAX_READ + 1,
> + cpm->rxbuf[i], cpm->rxdma[i]);
> + if (cpm->txbuf[i])
> + dma_free_coherent(NULL, CPM_MAX_READ + 1,
> + cpm->txbuf[i], cpm->txdma[i]);
> + }
> + cpm_muram_free(cpm->dp_addr);
> +out_reg:
> + iounmap(cpm->i2c_reg);
> +out_ram:
> + if ((cpm->version == 1) && (!cpm->i2c_addr))
> + iounmap(cpm->i2c_ram);
> + if (cpm->version == 2)
> + cpm_muram_free(cpm->i2c_addr);
> +out_irq:
> + free_irq(cpm->irq, &cpm->adap);
> + return ret;
> +}
> +
> +static void cpm_i2c_shutdown(struct cpm_i2c *cpm)
> +{
> + int i;
> +
> + /* Shut down I2C. */
> + out_8(&cpm->i2c_reg->i2mod, in_8(&cpm->i2c_reg->i2mod) | ~1);
> +
> + /* Disable interrupts */
> + out_8(&cpm->i2c_reg->i2cmr, 0);
> + out_8(&cpm->i2c_reg->i2cer, 0xff);
> +
> + free_irq(cpm->irq, &cpm->adap);
> +
> + /* Free all memory */
> + for (i = 0; i < CPM_MAXBD; i++) {
> + dma_free_coherent(NULL, CPM_MAX_READ + 1,
> + cpm->rxbuf[i], cpm->rxdma[i]);
> + dma_free_coherent(NULL, CPM_MAX_READ + 1,
> + cpm->txbuf[i], cpm->txdma[i]);
> + }
> +
> + cpm_muram_free(cpm->dp_addr);
> + iounmap(cpm->i2c_reg);
> +
> + if ((cpm->version == 1) && (!cpm->i2c_addr))
> + iounmap(cpm->i2c_ram);
> + if (cpm->version == 2)
> + cpm_muram_free(cpm->i2c_addr);
> +
> + return;
> +}
> +
> +static int __devinit cpm_i2c_probe(struct of_device *ofdev,
> + const struct of_device_id *match)
> +{
> + int result;
> + struct cpm_i2c *cpm;
> +
> + cpm = kzalloc(sizeof(struct cpm_i2c), GFP_KERNEL);
> + if (!cpm)
> + return -ENOMEM;
> +
> + cpm->ofdev = ofdev;
> +
> + dev_set_drvdata(&ofdev->dev, cpm);
> +
> + cpm->adap = cpm_ops;
> + i2c_set_adapdata(&cpm->adap, cpm);
> + cpm->adap.dev.parent = &ofdev->dev;
> +
> + result = cpm_i2c_setup(cpm);
> + if (result) {
> + printk(KERN_ERR "i2c-cpm: Unable to init hardware\n");
dev_err()
> + goto out;
> + }
> +
> + /* register new adapter to i2c module... */
> +
> + result = i2c_add_adapter(&cpm->adap);
> + if (result < 0) {
> + printk(KERN_ERR "i2c-cpm: Unable to register with I2C\n");
dev_err()
> + goto out2;
> + }
> +
> + pr_debug("i2c-cpm: hw routines for %s registered.\n", cpm->adap.name);
dev_dbg()
> +
> + /*
> + * Wait for patch from Jon Smirl
> + * of_register_i2c_devices(&cpm->adap, ofdev->node);
> + */
Again I won't merge this comment upstream.
> +
> + return 0;
> +out2:
> + cpm_i2c_shutdown(cpm);
> +out:
Better give more explicit names to your labels (for example
err_shutdown and err_free).
> + dev_set_drvdata(&ofdev->dev, NULL);
> + kfree(cpm);
> +
> + return result;
> +}
> +
> +static int __devexit cpm_i2c_remove(struct of_device *ofdev)
> +{
> + struct cpm_i2c *cpm = dev_get_drvdata(&ofdev->dev);
> +
> + i2c_del_adapter(&cpm->adap);
> +
> + cpm_i2c_shutdown(cpm);
> +
> + dev_set_drvdata(&ofdev->dev, NULL);
> + kfree(cpm);
> +
> + return 0;
> +}
> +
> +static const struct of_device_id cpm_i2c_match[] = {
> + {
> + .compatible = "fsl,cpm-i2c",
> + },
> + {},
> +};
> +
> +MODULE_DEVICE_TABLE(of, cpm_i2c_match);
> +
> +static struct of_platform_driver cpm_i2c_driver = {
> + .match_table = cpm_i2c_match,
> + .probe = cpm_i2c_probe,
> + .remove = __devexit_p(cpm_i2c_remove),
> + .driver = {
> + .name = "fsl-i2c-cpm",
> + .owner = THIS_MODULE,
> + }
> +};
> +
> +static int __init cpm_i2c_init(void)
> +{
> + return of_register_platform_driver(&cpm_i2c_driver);
> +}
> +
> +static void __exit cpm_i2c_exit(void)
> +{
> + of_unregister_platform_driver(&cpm_i2c_driver);
> +}
> +
> +module_init(cpm_i2c_init);
> +module_exit(cpm_i2c_exit);
> +
> +MODULE_AUTHOR("Dan Malek <dmalek@jlc.net>");
Why not your own name?
> +MODULE_DESCRIPTION("I2C-Bus adapter routines for CPM boards");
> +MODULE_LICENSE("GPL");
--
Jean Delvare
^ permalink raw reply
* Re: initramfs problem - /init file
From: raul.moreno @ 2008-02-21 10:38 UTC (permalink / raw)
To: dhlii; +Cc: linuxppc-embedded
In-Reply-To: <47BD1CFB.103@dlasys.lcl>
raul.moreno@telvent.abengoa.com wrote:
>> Hello everybody,
>>
>> I created a tiny root filesystem, just with Busybox, that I want to =
use
as
>> rootfs through initramfs (and keep it as the final root filesystem).=
>>
>> Then I created an init file which is a link to
>> /sbin/init and I inserted the created cpio file with this filesystem=
in
>> CONFIG_INITRAMFS_SOURCE.
> The simplest way to get initramfs working is to stuff your
>root filesystem tree in a directory, and point
> CONFIG_INITRAMFS_SOURCE at it.
> The kernel build process will take care of all the cpio stuff
>for you.
> Personally I think it is the easiest to maintain.
Hello Dave,
thanks for your answer. I agree with you, the easy way is to assign the=
rootfs directory. I gave the filesystem as a cpio file because it is th=
e
same (the kernel takes the rootfs and converts it to a cpio format), bu=
t
the compilation is faster. Anyway, although now I do as you said, I sti=
ll
get the error:
"Failed to execute /init
Kernel panic - not syncing: No init found. Try passing init=3D option =
to
kernel."
I can't understand why it happens. I check the permission of /init and
/sbin/init and everything seems to me OK.
Any idea?
Ra=FAl Moreno
=
^ permalink raw reply
* [PATCH v2] mpic: make sparse happy
From: Johannes Berg @ 2008-02-21 9:39 UTC (permalink / raw)
To: Milton Miller; +Cc: ppcdev
In-Reply-To: <91eb052edd9d5c608658fcdcfdc7589c@bga.com>
I was running sparse on something else and noticed sparse warnings
and especially the bogus code that is fixed by the first hunk of
this patch, so I fixed them all while at it.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Milton Miller <miltonm@bga.com>
---
arch/powerpc/sysdev/mpic.c | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)
--- everything.orig/arch/powerpc/sysdev/mpic.c 2008-02-20 23:22:52.000000000 +0100
+++ everything/arch/powerpc/sysdev/mpic.c 2008-02-21 10:25:53.000000000 +0100
@@ -175,13 +175,16 @@ static inline void _mpic_write(enum mpic
switch(type) {
#ifdef CONFIG_PPC_DCR
case mpic_access_dcr:
- return dcr_write(rb->dhost, reg, value);
+ dcr_write(rb->dhost, reg, value);
+ break;
#endif
case mpic_access_mmio_be:
- return out_be32(rb->base + (reg >> 2), value);
+ out_be32(rb->base + (reg >> 2), value);
+ break;
case mpic_access_mmio_le:
default:
- return out_le32(rb->base + (reg >> 2), value);
+ out_le32(rb->base + (reg >> 2), value);
+ break;
}
}
@@ -1000,7 +1003,7 @@ struct mpic * __init mpic_alloc(struct d
const char *name)
{
struct mpic *mpic;
- u32 reg;
+ u32 greg_feature;
const char *vers;
int i;
int intvec_top;
@@ -1064,7 +1067,8 @@ struct mpic * __init mpic_alloc(struct d
/* Look for protected sources */
if (node) {
- unsigned int psize, bits, mapsize;
+ int psize;
+ unsigned int bits, mapsize;
const u32 *psrc =
of_get_property(node, "protected-sources", &psize);
if (psrc) {
@@ -1107,8 +1111,7 @@ struct mpic * __init mpic_alloc(struct d
* in, try to obtain one
*/
if (paddr == 0 && !(mpic->flags & MPIC_USES_DCR)) {
- const u32 *reg;
- reg = of_get_property(node, "reg", NULL);
+ const u32 *reg = of_get_property(node, "reg", NULL);
BUG_ON(reg == NULL);
paddr = of_translate_address(node, reg);
BUG_ON(paddr == OF_BAD_ADDR);
@@ -1137,12 +1140,13 @@ struct mpic * __init mpic_alloc(struct d
* MPICs, num sources as well. On ISU MPICs, sources are counted
* as ISUs are added
*/
- reg = mpic_read(mpic->gregs, MPIC_INFO(GREG_FEATURE_0));
- mpic->num_cpus = ((reg & MPIC_GREG_FEATURE_LAST_CPU_MASK)
+ greg_feature = mpic_read(mpic->gregs, MPIC_INFO(GREG_FEATURE_0));
+ mpic->num_cpus = ((greg_feature & MPIC_GREG_FEATURE_LAST_CPU_MASK)
>> MPIC_GREG_FEATURE_LAST_CPU_SHIFT) + 1;
if (isu_size == 0)
- mpic->num_sources = ((reg & MPIC_GREG_FEATURE_LAST_SRC_MASK)
- >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1;
+ mpic->num_sources =
+ ((greg_feature & MPIC_GREG_FEATURE_LAST_SRC_MASK)
+ >> MPIC_GREG_FEATURE_LAST_SRC_SHIFT) + 1;
/* Map the per-CPU registers */
for (i = 0; i < mpic->num_cpus; i++) {
@@ -1161,7 +1165,7 @@ struct mpic * __init mpic_alloc(struct d
mpic->isu_mask = (1 << mpic->isu_shift) - 1;
/* Display version */
- switch (reg & MPIC_GREG_FEATURE_VERSION_MASK) {
+ switch (greg_feature & MPIC_GREG_FEATURE_VERSION_MASK) {
case 1:
vers = "1.0";
break;
@@ -1321,7 +1325,7 @@ void __init mpic_set_serial_int(struct m
void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
{
- int is_ipi;
+ unsigned int is_ipi;
struct mpic *mpic = mpic_find(irq, &is_ipi);
unsigned int src = mpic_irq_to_hw(irq);
unsigned long flags;
@@ -1344,7 +1348,7 @@ void mpic_irq_set_priority(unsigned int
unsigned int mpic_irq_get_priority(unsigned int irq)
{
- int is_ipi;
+ unsigned int is_ipi;
struct mpic *mpic = mpic_find(irq, &is_ipi);
unsigned int src = mpic_irq_to_hw(irq);
unsigned long flags;
^ permalink raw reply
* Re: [PATCH] mpic: make sparse happy
From: Johannes Berg @ 2008-02-21 9:23 UTC (permalink / raw)
To: Milton Miller; +Cc: ppcdev
In-Reply-To: <91eb052edd9d5c608658fcdcfdc7589c@bga.com>
[-- Attachment #1: Type: text/plain, Size: 468 bytes --]
On Wed, 2008-02-20 at 23:50 -0600, Milton Miller wrote:
> At Wed Feb 20 22:31:44 EST 2008, Johannes Berg wrote:
> > I was running sparse on something else and noticed sparse warnings
> > and especially the bogus code that is fixed by the first hunk of
> > this patch, so I fixed them all while at it.
>
> But your change is not equivalent!
> You now write to the register with dcr, big, and little endian variants!
Ouch, you're right, doh.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: MPC8641D PCI-Express error
From: Marco Stornelli @ 2008-02-21 8:02 UTC (permalink / raw)
To: Kumar Gala; +Cc: LinuxPPC-Embedded
In-Reply-To: <BA5ADBDE-BDE5-4126-B012-DA6C5A8F8EF3@kernel.crashing.org>
Kumar Gala ha scritto:
>
> On Feb 20, 2008, at 10:13 AM, Marco Stornelli wrote:
>
>> Kumar Gala wrote:
>>>> Marco Stornelli wrote:
>>>>
>>>>> No, but I can try to backport the PCI-E code from 2.6.24 to 2.6.18
>>>>> if it could help. What do you think about it? Do you think this
>>>>> problem could be not present in 2.6.24?
>>>>> I have no idea there, honestly. Sorry.
>>
>>> As Jon said, try 2.6.24 and see if it has an issue, if so we can look
>>> at helping. if not, you know you need to back port the fixes.
>>
>>> - k
>>
>> I've "backported" the PCI-Express code from 2.6.24 to 2.6.18, but it
>> still doesn't work, I have the same problem (sigh), could you give me
>> any suggestions?
>
> did 2.6.24 work for you or not?
>
> - k
>
No, it didn't. I have the same problem even with the 2.6.18 plus the
2.6.24 PCI-Express code. I performed this action because I can't change
kernel version but I can modify it.
Marco
^ permalink raw reply
* Re: [patch v8 3/4] USB: add Cypress c67x00 OTG controller HCD driver
From: Peter Korsgaard @ 2008-02-21 7:53 UTC (permalink / raw)
To: David Brownell; +Cc: dbrownell, greg, linux-usb, linuxppc-dev, stern
In-Reply-To: <200802201906.35830.david-b@pacbell.net>
>>>>> "David" == David Brownell <david-b@pacbell.net> writes:
Hi,
David> +ccflags-$(CONFIG_USB_DEBUG) += -DDEBUG
David> It's a newish idiom, most easily applied to new code before
David> it merges ... :)
Ok. I'll fix that.
David> And I realize that some of the drivers there have violated the
David> normal "alphabetical order" convention, so maybe one big
David> cleanup patch would be in order ... but still, I'd rather see
David> such new options added in the right place, rather than need
David> to see them fixed up later.
And this as well.
--
Bye, Peter Korsgaard
^ permalink raw reply
* Block devices
From: David H. Lynch Jr. @ 2008-02-21 7:05 UTC (permalink / raw)
To: linuxppc-embedded, linux-fsdevel, linux-mtd
Sometime recently it seems to have become possible to disable the
whole block device subsystem.
Though in my tests I can't quit build with it disabled.
Anyway, for an embedded device this might be appealing.
how does this interact with initramfs and flash ?
Can I boot an initramfs kernel without a block device ?
Can I write a filesystem driver for a flash device that does not
require a block device ?
Are their any examples of something even close ?
--
Dave Lynch DLA Systems
Software Development: Embedded Linux
717.627.3770 dhlii@dlasys.net http://www.dlasys.net
fax: 1.253.369.9244 Cell: 1.717.587.7774
Over 25 years' experience in platforms, languages, and technologies too numerous to list.
"Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction."
Albert Einstein
^ permalink raw reply
* Xilinx PowerPC
From: David H. Lynch Jr. @ 2008-02-21 6:58 UTC (permalink / raw)
To: Grant Likely, linuxppc-embedded
So when you have Xilinx under powerpc working, do we pull it from your
git tree or the xilinx one ?
Will there be an announcement ?
How about a one paragraph getting started guide to moving a xilinx
ppc bsp to
xilinx powerpc.
Like ?
step 1).
Generate a dts - gen-mhs-devicetree ?
And pass it to through your boot loader to Linux ?
Step 2).
the code in arch/powerpc/???? is the devicetree equvalent to
arch/ppc/platforms/4xx/xilinx_ml410.c
Step 3).
device drivers need to change initialization/setup from
???? to ???
Just something to give those of us with no clue, a small one to start.
Thanks.
^ permalink raw reply
* Re: Sample driver
From: Jeff Mock @ 2008-02-21 6:54 UTC (permalink / raw)
To: fariyaf; +Cc: linuxppc-embedded
In-Reply-To: <8024567.229231203576334424.JavaMail.nabble@isper.nabble.com>
fariyaf@gmail.com wrote:
> Hi,
>
> Thanks so much for the driver. I have a few doubts.. .may be u cud
> help me out with it.... Basically, I am working on the PPC 405EX
> processor with a peripheral attached to the EBC. I've requested for
> I/O memory & mapped it using ioremap. The following are my doubts:
>
> 1) How do I ensure that the memory range that I requested is
> non-cacheable. I've to work with non-cacheable memory. I've
> requested for memory using request_mem_region( ).
In my example the memory range is set to non-cacheable, this needs to be
done if you are talking to real hardware registers:
"vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);"
static int
pdev_mmap(struct file *file, struct vm_area_struct *vma)
{
int fpga_num = iminor(file->f_dentry->d_inode) - PDEV_SPCTL;
phys_addr_t paddr;
paddr = fpga_num ? PDEV_SP1_REG : PDEV_SP0_REG;
#ifdef PDEV_DEBUG
printk("pdev-gxctl: fpga %d reg mmap() at %016llx\n", fpga_num, paddr);
#endif
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
if (remap_pfn_range(vma,
vma->vm_start,
paddr >> PAGE_SHIFT,
vma->vm_end-vma->vm_start,
vma->vm_page_prot))
return -EAGAIN;
return 0;
}
> 2) Between any consecutive writes or any consecutive reads to the EBC
> peripheral, if I introduce a delay of 500msec, the read/write is
> completing. Does this have to do anything with caching? What could
> be the reason for this?
I have no idea where the 500ms delay comes from, this is quite a long
delay. Maybe there is some problem with the EBC programming for your
example. The EBC is quite flexible and can be programmed in any number
of insane ways that might cause trouble.
jeff
^ permalink raw reply
* Re: [PATCH] powerpc: don't create two devices for each cpm_uart device tree node
From: Nikita V. Youshchenko @ 2008-02-21 6:13 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20080220164052.GB32165@ld0162-tx32.am.freescale.net>
> On Wed, Feb 20, 2008 at 02:32:33AM +0300, Nikita V. Youshchenko wrote:
> > powerpc: don't create two devices for each cpm_uart device tree
> > node
> >
> > Code in arch/powerpc/sysdev/fsl_soc.c used to create two 'struct
> > device' objects for each cpm_uart device tree node - one
> > "fsl-cpm-scc:uart" in cpm_uart_of_init() and one "fsl-cpm-smc:uart" in
> > cpm_smc_uart_of_init().
>
> This is old code that only exists for non-CONFIG_PPC_CPM_NEW_BINDING
> boards. As there are none of these remaining in-tree, this code should
> go away soon.
Thank you for information.
I am working with vendor kernel, based on 2.6.18, and that does not have
CONFIG_PPC_CPM_NEW_BINDING. I thought that fix I made for that kernel
could be usable for mainline, but if not - nevermind.
^ permalink raw reply
* Re: [PATCH] mpic: make sparse happy
From: Milton Miller @ 2008-02-21 5:50 UTC (permalink / raw)
To: Johannes Berg; +Cc: ppcdev
In-Reply-To: <1203507104.17534.32.camel@johannes.berg>
At Wed Feb 20 22:31:44 EST 2008, Johannes Berg wrote:
> I was running sparse on something else and noticed sparse warnings
> and especially the bogus code that is fixed by the first hunk of
> this patch, so I fixed them all while at it.
But your change is not equivalent!
> --- everything.orig/arch/powerpc/sysdev/mpic.c 2008-02-20
> 12:25:41.000000000 +0100
> +++ everything/arch/powerpc/sysdev/mpic.c 2008-02-20
> 12:28:37.000000000 +0100
> @@ -175,13 +175,13 @@ static inline void _mpic_write(enum mpic
> switch(type) {
> #ifdef CONFIG_PPC_DCR
> case mpic_access_dcr:
> - return dcr_write(rb->dhost, reg, value);
> + dcr_write(rb->dhost, reg, value);
> #endif
> case mpic_access_mmio_be:
> - return out_be32(rb->base + (reg >> 2), value);
> + out_be32(rb->base + (reg >> 2), value);
> case mpic_access_mmio_le:
> default:
> - return out_le32(rb->base + (reg >> 2), value);
> + out_le32(rb->base + (reg >> 2), value);
> }
> }
You now write to the register with dcr, big, and little endian variants!
Either put a return or break after the calls to the void functions so
you don't fall through.
...
> @@ -1107,10 +1108,10 @@ struct mpic * __init mpic_alloc(struct d
> * in, try to obtain one
> */
> if (paddr == 0 && !(mpic->flags & MPIC_USES_DCR)) {
> - const u32 *reg;
> - reg = of_get_property(node, "reg", NULL);
> - BUG_ON(reg == NULL);
> - paddr = of_translate_address(node, reg);
> + const u32 *regprop;
> + regprop = of_get_property(node, "reg", NULL);
> + BUG_ON(regprop == NULL);
> + paddr = of_translate_address(node, regprop);
> BUG_ON(paddr == OF_BAD_ADDR);
> }
This is reg variable is shadowed ... ok, although i might have renamed
the outer one features or greg_feature. For that matter, I would have
initialized this reg/regprop on definition.
^ permalink raw reply
* EBC access
From: Silwer star @ 2008-02-21 5:48 UTC (permalink / raw)
To: linuxppc-embedded
Hi,
I am working on the PPC 405EX processor with a peripheral attached to the
EBC. I've requested for I/O memory & mapped it using ioremap. The following
are my doubts:
1) How do I ensure that the memory range that I requested is non-cacheable.
I've to work with non-cacheable memory. I've requested for memory using
request_mem_region( ).
2) Between any consecutive writes or any consecutive reads, if I introduce a
delay of 500msec, the read/write is completing. Does this have to do
anything with caching? What could be the reason for this?
Any help will be appreciated.
Regards,
Silwer Star
--
View this message in context: http://www.nabble.com/EBC-access-tp15605219p15605219.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
^ permalink raw reply
* Re: [Linux-fbdev-devel] [PATCH 1/2] fb: add support for foreign endianness
From: Paul Mackerras @ 2008-02-21 4:59 UTC (permalink / raw)
To: avorontsov
Cc: linux-fbdev-devel, adaplas, Krzysztof Helt, linux-kernel,
linuxppc-dev, Geert Uytterhoeven, Andrew Morton
In-Reply-To: <20080220121818.GA20836@localhost.localdomain>
Anton Vorontsov writes:
> > I was wondering if it would be sufficient to provide alternative
> > versions of fb_readl, fb_writel etc. that do byte-swapping.
>
> This is of course viable alternative. And I was considering this, but
> later I abandoned the idea: that way we'll end up doing math in the
> native endianness and then converting it to the foreign. This feels
> ugly in contrast when we can do the right math in the first place, per
> framebuffer.
OK. I guess I'm convinced then. However, your patch description
needs to be a lot better. It should describe things like why you
want to make the change and why the change you are proposing is a good
idea and is better than other alternatives. If you'd done that
originally we might not have needed to have all this discussion. :)
Paul.
^ permalink raw reply
* Re: Question about PPC_NATIVE/hash_native_64.c
From: Paul Mackerras @ 2008-02-21 4:47 UTC (permalink / raw)
To: Gerhard Pircher; +Cc: linuxppc-dev
In-Reply-To: <20080220115713.193460@gmx.net>
Gerhard Pircher writes:
> I'm a little bit confused about the hash_native_64.c file, which is compiled
> in the kernel, if PPC_NATIVE is defined. PPC_NATIVE seems to be defined also
> for 32bit platforms (CHRP, PREP, etc.), but the name of the hash_native_64.c
> file and the Makefile suggest that it is for 64bit platforms only.
> What is hash_native_64.c actually good for on 32bit platforms and which cpus
> can make use of it?
It's not included on 32-bit platforms. Here are the relevant lines
from arch/powerpc/mm/Makefile:
hash-$(CONFIG_PPC_NATIVE) := hash_native_64.o
obj-$(CONFIG_PPC64) += hash_utils_64.o \
slb_low.o slb.o stab.o mmap.o $(hash-y)
Note that the first line sets hash-y not obj-y, and $(hash-y) is only
used on 64-bit machines.
Paul.
^ permalink raw reply
* Re: [PATCH v2][POWERPC] Fix initial lmb add region with a non-zero base
From: Josh Boyer @ 2008-02-21 4:01 UTC (permalink / raw)
To: Paul Mackerras; +Cc: sparclinux, linuxppc-dev, linux-kernel, David Miller
In-Reply-To: <18364.57054.427433.405627@cargo.ozlabs.ibm.com>
On Thu, 21 Feb 2008 13:15:58 +1100
Paul Mackerras <paulus@samba.org> wrote:
> Kumar Gala writes:
>
> > np. Are we trying to get this into 2.6.25 or .26?
>
> I was going to put it into my powerpc-next branch and put it in
> 2.6.26. I don't see any need for it to go in 2.6.25.
Is that a new branch you're going to create, or the normal "for-2.6.xx"?
josh
^ permalink raw reply
* Re: [patch v8 3/4] USB: add Cypress c67x00 OTG controller HCD driver
From: David Brownell @ 2008-02-21 3:06 UTC (permalink / raw)
To: Peter Korsgaard; +Cc: dbrownell, greg, linux-usb, linuxppc-dev, stern
In-Reply-To: <20080220091401.612406000@sunsite.dk>
On Wednesday 20 February 2008, Peter Korsgaard wrote:
> +ifeq ($(CONFIG_USB_DEBUG),y)
> + EXTRA_CFLAGS += -DDEBUG
> +endif
The canonical Sam Ravnborg comment is to replace that with:
+ccflags-$(CONFIG_USB_DEBUG) += -DDEBUG
It's a newish idiom, most easily applied to new code before
it merges ... :)
> +++ linux-2.6/drivers/usb/host/Kconfig
> @@ -261,3 +261,15 @@
> To compile this driver as a module, choose M here: the
> module will be called r8a66597-hcd.
>
> +config USB_C67X00_HCD
> + tristate "Cypress C67x00 HCD support"
> + depends on USB
And I realize that some of the drivers there have violated the
normal "alphabetical order" convention, so maybe one big
cleanup patch would be in order ... but still, I'd rather see
such new options added in the right place, rather than need
to see them fixed up later.
- Dave
^ permalink raw reply
* [patch 6/6] pasemi_mac: basic ethtool support
From: Olof Johansson @ 2008-02-21 2:57 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, pasemi-linux, linuxppc-dev
In-Reply-To: <20080221025753.903665000@lixom.net>
First cut at ethtool support, to be completed over time.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: 2.6.25/drivers/net/Makefile
===================================================================
--- 2.6.25.orig/drivers/net/Makefile
+++ 2.6.25/drivers/net/Makefile
@@ -218,7 +218,8 @@ obj-$(CONFIG_SMC911X) += smc911x.o
obj-$(CONFIG_BFIN_MAC) += bfin_mac.o
obj-$(CONFIG_DM9000) += dm9000.o
obj-$(CONFIG_FEC_8XX) += fec_8xx/
-obj-$(CONFIG_PASEMI_MAC) += pasemi_mac.o
+obj-$(CONFIG_PASEMI_MAC) += pasemi_mac_driver.o
+pasemi_mac_driver-objs := pasemi_mac.o pasemi_mac_ethtool.o
obj-$(CONFIG_MLX4_CORE) += mlx4/
obj-$(CONFIG_ENC28J60) += enc28j60.o
Index: 2.6.25/drivers/net/pasemi_mac.c
===================================================================
--- 2.6.25.orig/drivers/net/pasemi_mac.c
+++ 2.6.25/drivers/net/pasemi_mac.c
@@ -55,12 +55,6 @@
* - Multiqueue RX/TX
*/
-
-/* Must be a power of two */
-#define RX_RING_SIZE 2048
-#define TX_RING_SIZE 4096
-#define CS_RING_SIZE (TX_RING_SIZE*2)
-
#define LRO_MAX_AGGR 64
#define PE_MIN_MTU 64
@@ -77,17 +71,6 @@
NETIF_MSG_RX_ERR | \
NETIF_MSG_TX_ERR)
-#define TX_DESC(tx, num) ((tx)->chan.ring_virt[(num) & (TX_RING_SIZE-1)])
-#define TX_DESC_INFO(tx, num) ((tx)->ring_info[(num) & (TX_RING_SIZE-1)])
-#define RX_DESC(rx, num) ((rx)->chan.ring_virt[(num) & (RX_RING_SIZE-1)])
-#define RX_DESC_INFO(rx, num) ((rx)->ring_info[(num) & (RX_RING_SIZE-1)])
-#define RX_BUFF(rx, num) ((rx)->buffers[(num) & (RX_RING_SIZE-1)])
-#define CS_DESC(cs, num) ((cs)->chan.ring_virt[(num) & (CS_RING_SIZE-1)])
-
-#define RING_USED(ring) (((ring)->next_to_fill - (ring)->next_to_clean) \
- & ((ring)->size - 1))
-#define RING_AVAIL(ring) ((ring->size) - RING_USED(ring))
-
MODULE_LICENSE("GPL");
MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>");
MODULE_DESCRIPTION("PA Semi PWRficient Ethernet driver");
@@ -96,6 +79,8 @@ static int debug = -1; /* -1 == use DEFA
module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "PA Semi MAC bitmapped debugging message enable value");
+extern const struct ethtool_ops pasemi_mac_ethtool_ops;
+
static int translation_enabled(void)
{
#if defined(CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE)
@@ -1148,7 +1133,7 @@ static int pasemi_mac_open(struct net_de
{
struct pasemi_mac *mac = netdev_priv(dev);
unsigned int flags;
- int ret;
+ int i, ret;
flags = PAS_MAC_CFG_TXP_FCE | PAS_MAC_CFG_TXP_FPC(3) |
PAS_MAC_CFG_TXP_SL(3) | PAS_MAC_CFG_TXP_COB(0xf) |
@@ -1171,6 +1156,10 @@ static int pasemi_mac_open(struct net_de
goto out_tx_ring;
}
+ /* Zero out rmon counters */
+ for (i = 0; i < 32; i++)
+ write_mac_reg(mac, PAS_MAC_RMON(i), 0);
+
/* 0x3ff with 33MHz clock is about 31us */
write_iob_reg(PAS_IOB_DMA_COM_TIMEOUTCFG,
PAS_IOB_DMA_COM_TIMEOUTCFG_TCNT(0x3ff));
@@ -1812,6 +1801,7 @@ pasemi_mac_probe(struct pci_dev *pdev, c
mac->bufsz = dev->mtu + ETH_HLEN + ETH_FCS_LEN + LOCAL_SKB_ALIGN + 128;
dev->change_mtu = pasemi_mac_change_mtu;
+ dev->ethtool_ops = &pasemi_mac_ethtool_ops;
if (err)
goto out;
Index: 2.6.25/drivers/net/pasemi_mac.h
===================================================================
--- 2.6.25.orig/drivers/net/pasemi_mac.h
+++ 2.6.25/drivers/net/pasemi_mac.h
@@ -26,6 +26,12 @@
#include <linux/spinlock.h>
#include <linux/phy.h>
+/* Must be a power of two */
+#define RX_RING_SIZE 2048
+#define TX_RING_SIZE 4096
+#define CS_RING_SIZE (TX_RING_SIZE*2)
+
+
#define MAX_LRO_DESCRIPTORS 8
#define MAX_CS 2
@@ -103,6 +109,16 @@ struct pasemi_mac_buffer {
dma_addr_t dma;
};
+#define TX_DESC(tx, num) ((tx)->chan.ring_virt[(num) & (TX_RING_SIZE-1)])
+#define TX_DESC_INFO(tx, num) ((tx)->ring_info[(num) & (TX_RING_SIZE-1)])
+#define RX_DESC(rx, num) ((rx)->chan.ring_virt[(num) & (RX_RING_SIZE-1)])
+#define RX_DESC_INFO(rx, num) ((rx)->ring_info[(num) & (RX_RING_SIZE-1)])
+#define RX_BUFF(rx, num) ((rx)->buffers[(num) & (RX_RING_SIZE-1)])
+#define CS_DESC(cs, num) ((cs)->chan.ring_virt[(num) & (CS_RING_SIZE-1)])
+
+#define RING_USED(ring) (((ring)->next_to_fill - (ring)->next_to_clean) \
+ & ((ring)->size - 1))
+#define RING_AVAIL(ring) ((ring->size) - RING_USED(ring))
/* PCI register offsets and formats */
@@ -114,6 +130,7 @@ enum {
PAS_MAC_CFG_ADR0 = 0x8c,
PAS_MAC_CFG_ADR1 = 0x90,
PAS_MAC_CFG_TXP = 0x98,
+ PAS_MAC_CFG_RMON = 0x100,
PAS_MAC_IPC_CHNL = 0x208,
};
@@ -185,6 +202,8 @@ enum {
#define PAS_MAC_CFG_TXP_TIFG(x) (((x) << PAS_MAC_CFG_TXP_TIFG_S) & \
PAS_MAC_CFG_TXP_TIFG_M)
+#define PAS_MAC_RMON(r) (0x100+(r)*4)
+
#define PAS_MAC_IPC_CHNL_DCHNO_M 0x003f0000
#define PAS_MAC_IPC_CHNL_DCHNO_S 16
#define PAS_MAC_IPC_CHNL_DCHNO(x) (((x) << PAS_MAC_IPC_CHNL_DCHNO_S) & \
@@ -194,4 +213,5 @@ enum {
#define PAS_MAC_IPC_CHNL_BCH(x) (((x) << PAS_MAC_IPC_CHNL_BCH_S) & \
PAS_MAC_IPC_CHNL_BCH_M)
+
#endif /* PASEMI_MAC_H */
Index: 2.6.25/drivers/net/pasemi_mac_ethtool.c
===================================================================
--- /dev/null
+++ 2.6.25/drivers/net/pasemi_mac_ethtool.c
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2006-2008 PA Semi, Inc
+ *
+ * Ethtool hooks for the PA Semi PWRficient onchip 1G/10G Ethernet MACs
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+#include <linux/netdevice.h>
+#include <linux/ethtool.h>
+#include <linux/pci.h>
+#include <linux/inet_lro.h>
+
+#include <asm/pasemi_dma.h>
+#include "pasemi_mac.h"
+
+static struct {
+ const char str[ETH_GSTRING_LEN];
+} ethtool_stats_keys[] = {
+ { "rx-drops" },
+ { "rx-bytes" },
+ { "rx-packets" },
+ { "rx-broadcast-packets" },
+ { "rx-multicast-packets" },
+ { "rx-crc-errors" },
+ { "rx-undersize-errors" },
+ { "rx-oversize-errors" },
+ { "rx-short-fragment-errors" },
+ { "rx-jabber-errors" },
+ { "rx-64-byte-packets" },
+ { "rx-65-127-byte-packets" },
+ { "rx-128-255-byte-packets" },
+ { "rx-256-511-byte-packets" },
+ { "rx-512-1023-byte-packets" },
+ { "rx-1024-1518-byte-packets" },
+ { "rx-pause-frames" },
+ { "tx-bytes" },
+ { "tx-packets" },
+ { "tx-broadcast-packets" },
+ { "tx-multicast-packets" },
+ { "tx-collisions" },
+ { "tx-late-collisions" },
+ { "tx-excessive-collisions" },
+ { "tx-crc-errors" },
+ { "tx-undersize-errors" },
+ { "tx-oversize-errors" },
+ { "tx-64-byte-packets" },
+ { "tx-65-127-byte-packets" },
+ { "tx-128-255-byte-packets" },
+ { "tx-256-511-byte-packets" },
+ { "tx-512-1023-byte-packets" },
+ { "tx-1024-1518-byte-packets" },
+};
+
+static int
+pasemi_mac_ethtool_get_settings(struct net_device *netdev,
+ struct ethtool_cmd *cmd)
+{
+ struct pasemi_mac *mac = netdev_priv(netdev);
+ struct phy_device *phydev = mac->phydev;
+
+ return phy_ethtool_gset(phydev, cmd);
+}
+
+static void
+pasemi_mac_ethtool_get_drvinfo(struct net_device *netdev,
+ struct ethtool_drvinfo *drvinfo)
+{
+ struct pasemi_mac *mac;
+ mac = netdev_priv(netdev);
+
+ /* clear and fill out info */
+ memset(drvinfo, 0, sizeof(struct ethtool_drvinfo));
+ strncpy(drvinfo->driver, "pasemi_mac", 12);
+ strcpy(drvinfo->version, "N/A");
+ strcpy(drvinfo->fw_version, "N/A");
+ strncpy(drvinfo->bus_info, pci_name(mac->pdev), 32);
+}
+
+static u32
+pasemi_mac_ethtool_get_msglevel(struct net_device *netdev)
+{
+ struct pasemi_mac *mac = netdev_priv(netdev);
+ return mac->msg_enable;
+}
+
+static void
+pasemi_mac_ethtool_set_msglevel(struct net_device *netdev,
+ u32 level)
+{
+ struct pasemi_mac *mac = netdev_priv(netdev);
+ mac->msg_enable = level;
+}
+
+
+static void
+pasemi_mac_ethtool_get_ringparam(struct net_device *netdev,
+ struct ethtool_ringparam *ering)
+{
+ struct pasemi_mac *mac = netdev->priv;
+
+ ering->tx_max_pending = TX_RING_SIZE/2;
+ ering->tx_pending = RING_USED(mac->tx)/2;
+ ering->rx_max_pending = RX_RING_SIZE/4;
+ ering->rx_pending = RING_USED(mac->rx)/4;
+}
+
+static int pasemi_mac_get_sset_count(struct net_device *netdev, int sset)
+{
+ switch (sset) {
+ case ETH_SS_STATS:
+ return ARRAY_SIZE(ethtool_stats_keys);
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+
+static void pasemi_mac_get_ethtool_stats(struct net_device *netdev,
+ struct ethtool_stats *stats, u64 *data)
+{
+ struct pasemi_mac *mac = netdev->priv;
+ int i;
+
+ data[0] = pasemi_read_dma_reg(PAS_DMA_RXINT_RCMDSTA(mac->dma_if))
+ >> PAS_DMA_RXINT_RCMDSTA_DROPS_S;
+ for (i = 0; i < 32; i++)
+ data[1+i] = pasemi_read_mac_reg(mac->dma_if, PAS_MAC_RMON(i));
+}
+
+static void pasemi_mac_get_strings(struct net_device *netdev, u32 stringset,
+ u8 *data)
+{
+ memcpy(data, ethtool_stats_keys, sizeof(ethtool_stats_keys));
+}
+
+const struct ethtool_ops pasemi_mac_ethtool_ops = {
+ .get_settings = pasemi_mac_ethtool_get_settings,
+ .get_drvinfo = pasemi_mac_ethtool_get_drvinfo,
+ .get_msglevel = pasemi_mac_ethtool_get_msglevel,
+ .set_msglevel = pasemi_mac_ethtool_set_msglevel,
+ .get_link = ethtool_op_get_link,
+ .get_ringparam = pasemi_mac_ethtool_get_ringparam,
+ .get_strings = pasemi_mac_get_strings,
+ .get_sset_count = pasemi_mac_get_sset_count,
+ .get_ethtool_stats = pasemi_mac_get_ethtool_stats,
+};
+
--
^ permalink raw reply
* [patch 5/6] pasemi_mac: Enable GSO by default
From: Olof Johansson @ 2008-02-21 2:57 UTC (permalink / raw)
To: jgarzik; +Cc: netdev, pasemi-linux, linuxppc-dev
In-Reply-To: <20080221025753.903665000@lixom.net>
Ethtool support will handle the runtime toggling, but we do quite a bit
better with it on by default so just leave it on for now.
Signed-off-by: Olof Johansson <olof@lixom.net>
Index: k.org/drivers/net/pasemi_mac.c
===================================================================
--- k.org.orig/drivers/net/pasemi_mac.c
+++ k.org/drivers/net/pasemi_mac.c
@@ -1750,7 +1750,7 @@ pasemi_mac_probe(struct pci_dev *pdev, c
netif_napi_add(dev, &mac->napi, pasemi_mac_poll, 64);
dev->features = NETIF_F_IP_CSUM | NETIF_F_LLTX | NETIF_F_SG |
- NETIF_F_HIGHDMA;
+ NETIF_F_HIGHDMA | NETIF_F_GSO;
mac->lro_mgr.max_aggr = LRO_MAX_AGGR;
mac->lro_mgr.max_desc = MAX_LRO_DESCRIPTORS;
--
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox