From e50b6befae9ea91c2d190fb78ff1e06a0b950add Mon Sep 17 00:00:00 2001 From: Rabeeh Khoury Date: Tue, 24 Mar 2009 16:10:15 +0200 Subject: [ARM] Kirkwood: CPU idle driver The patch adds support for Kirkwood cpu idle. Two idle states are defined: 1. Wait-for-interrupt (replacing default kirkwood wfi) 2. Wait-for-interrupt and DDR self refresh Signed-off-by: Rabeeh Khoury Signed-off-by: Nicolas Pitre --- arch/arm/mach-kirkwood/include/mach/kirkwood.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-kirkwood/include/mach') diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index b3e13958821..f20ff646048 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h @@ -48,6 +48,7 @@ */ #define DDR_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x00000) #define DDR_WINDOW_CPU_BASE (DDR_VIRT_BASE | 0x1500) +#define DDR_OPERATION_BASE (DDR_VIRT_BASE | 0x1418) #define DEV_BUS_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x10000) #define DEV_BUS_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x10000) -- cgit v1.2.3 From 797b2c80e8e111bc9673fc5e6c67ac03e8b7c7ef Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Tue, 26 May 2009 22:06:25 -0400 Subject: [ARM] Kirkwood: only map peripheral register space once Just like commit 1419468ab548, let's save some TLB entries by making ioremap() return pointers into the boot-time Kirkwood peripheral iotable mapping whenever someone tries to ioremap any part of the Kirkwood peripheral register space. Signed-off-by: Nicolas Pitre --- arch/arm/mach-kirkwood/include/mach/io.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'arch/arm/mach-kirkwood/include/mach') diff --git a/arch/arm/mach-kirkwood/include/mach/io.h b/arch/arm/mach-kirkwood/include/mach/io.h index be07be0ef52..a643a846d5f 100644 --- a/arch/arm/mach-kirkwood/include/mach/io.h +++ b/arch/arm/mach-kirkwood/include/mach/io.h @@ -19,6 +19,31 @@ static inline void __iomem *__io(unsigned long addr) + KIRKWOOD_PCIE_IO_VIRT_BASE); } +static inline void __iomem * +__arch_ioremap(unsigned long paddr, size_t size, unsigned int mtype) +{ + void __iomem *retval; + unsigned long offs = paddr - KIRKWOOD_REGS_PHYS_BASE; + if (mtype == MT_DEVICE && size && offs < KIRKWOOD_REGS_SIZE && + size <= KIRKWOOD_REGS_SIZE && offs + size <= KIRKWOOD_REGS_SIZE) { + retval = (void __iomem *)KIRKWOOD_REGS_VIRT_BASE + offs; + } else { + retval = __arm_ioremap(paddr, size, mtype); + } + + return retval; +} + +static inline void +__arch_iounmap(void __iomem *addr) +{ + if (addr < (void __iomem *)KIRKWOOD_REGS_VIRT_BASE || + addr >= (void __iomem *)(KIRKWOOD_REGS_VIRT_BASE + KIRKWOOD_REGS_SIZE)) + __iounmap(addr); +} + +#define __arch_ioremap(p, s, m) __arch_ioremap(p, s, m) +#define __arch_iounmap(a) __arch_iounmap(a) #define __io(a) __io(a) #define __mem_pci(a) (a) -- cgit v1.2.3 From e8b2b7ba1200de8e50788e358e2d945a0c0fcfad Mon Sep 17 00:00:00 2001 From: Rabeeh Khoury Date: Sun, 22 Mar 2009 17:30:32 +0200 Subject: [ARM] Kirkwood: clock gating for unused peripherals To save power: 1. Enabling clock gating of unused peripherals 2. PLL and PHY of the units are also disabled (when possible. Signed-off-by: Rabeeh Khoury Signed-off-by: Nicolas Pitre --- arch/arm/mach-kirkwood/include/mach/bridge-regs.h | 18 ++++++++++++++++++ arch/arm/mach-kirkwood/include/mach/kirkwood.h | 7 +++++++ 2 files changed, 25 insertions(+) (limited to 'arch/arm/mach-kirkwood/include/mach') diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h index 4f7029f521c..00d96abb718 100644 --- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h +++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h @@ -39,4 +39,22 @@ #define L2_CONFIG_REG (BRIDGE_VIRT_BASE | 0x0128) #define L2_WRITETHROUGH 0x00000010 +#define CLOCK_GATING_CTRL (BRIDGE_VIRT_BASE | 0x11c) +#define CGC_GE0 (1 << 0) +#define CGC_PEX0 (1 << 2) +#define CGC_USB0 (1 << 3) +#define CGC_SDIO (1 << 4) +#define CGC_TSU (1 << 5) +#define CGC_DUNIT (1 << 6) +#define CGC_RUNIT (1 << 7) +#define CGC_XOR0 (1 << 8) +#define CGC_AUDIO (1 << 9) +#define CGC_SATA0 (1 << 14) +#define CGC_SATA1 (1 << 15) +#define CGC_XOR1 (1 << 16) +#define CGC_CRYPTO (1 << 17) +#define CGC_GE1 (1 << 19) +#define CGC_TDM (1 << 20) +#define CGC_RESERVED ((1 << 18) | (0x6 << 21)) + #endif diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index f20ff646048..f49a29bf336 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h @@ -65,6 +65,8 @@ #define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x20000) #define PCIE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x40000) +#define PCIE_LINK_CTRL (PCIE_VIRT_BASE | 0x70) +#define PCIE_STATUS (PCIE_VIRT_BASE | 0x1a04) #define USB_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x50000) @@ -81,6 +83,11 @@ #define GE01_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x74000) #define SATA_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x80000) +#define SATA_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x80000) +#define SATA0_IF_CTRL (SATA_VIRT_BASE | 0x2050) +#define SATA0_PHY_MODE_2 (SATA_VIRT_BASE | 0x2330) +#define SATA1_IF_CTRL (SATA_VIRT_BASE | 0x4050) +#define SATA1_PHY_MODE_2 (SATA_VIRT_BASE | 0x4330) #define SDIO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x90000) -- cgit v1.2.3 From 054bd3f053de54c81b20df11f354476389826e61 Mon Sep 17 00:00:00 2001 From: Thomas Reitmayr Date: Mon, 1 Jun 2009 13:38:34 +0200 Subject: [ARM] Kirkwood: Add the watchdog timer as a platform device. The Kirkwood architecture uses the same watchdog device as the Orion architecture. This patch adds orion5x_wdt as a platform device for Kirkwood. Signed-off-by: Thomas Reitmayr Tested-by: Martin Michlmayr Signed-off-by: Nicolas Pitre --- arch/arm/mach-kirkwood/include/mach/bridge-regs.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/arm/mach-kirkwood/include/mach') diff --git a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h index 00d96abb718..9e80d9232c8 100644 --- a/arch/arm/mach-kirkwood/include/mach/bridge-regs.h +++ b/arch/arm/mach-kirkwood/include/mach/bridge-regs.h @@ -17,12 +17,15 @@ #define CPU_RESET 0x00000002 #define RSTOUTn_MASK (BRIDGE_VIRT_BASE | 0x0108) +#define WDT_RESET_OUT_EN 0x00000002 #define SOFT_RESET_OUT_EN 0x00000004 #define SYSTEM_SOFT_RESET (BRIDGE_VIRT_BASE | 0x010c) #define SOFT_RESET 0x00000001 #define BRIDGE_CAUSE (BRIDGE_VIRT_BASE | 0x0110) +#define WDT_INT_REQ 0x0008 + #define BRIDGE_MASK (BRIDGE_VIRT_BASE | 0x0114) #define BRIDGE_INT_TIMER0 0x0002 #define BRIDGE_INT_TIMER1 0x0004 -- cgit v1.2.3 From fc63b7239a9c939f38450620f773d057b037976b Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Tue, 2 Jun 2009 21:51:14 -0400 Subject: [ARM] Kirkwood: let's use real size for resources We don't have to define resources to the minimal physical window size as setup_cpu_win() will cope with smaller sizes already. Signed-off-by: Nicolas Pitre --- arch/arm/mach-kirkwood/include/mach/kirkwood.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'arch/arm/mach-kirkwood/include/mach') diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index f49a29bf336..00be8c524f0 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h @@ -27,9 +27,7 @@ */ #define KIRKWOOD_NAND_MEM_PHYS_BASE 0xf3000000 -#define KIRKWOOD_NAND_MEM_SIZE SZ_64K /* 1K is sufficient, but 64K - * is the minimal window size - */ +#define KIRKWOOD_NAND_MEM_SIZE SZ_1K #define KIRKWOOD_PCIE_IO_PHYS_BASE 0xf2000000 #define KIRKWOOD_PCIE_IO_VIRT_BASE 0xfef00000 -- cgit v1.2.3 From c1191b0e3b5fc080e0b09859024f39c4a8c5d4d5 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Tue, 2 Jun 2009 21:43:45 -0400 Subject: [ARM] Kirkwood: create a mapping for the Security Accelerator SRAM Always creating the physical mapping should do no harm, so let's remove the interface that was provided for its optional creation and make the mapping static. Signed-off-by: Nicolas Pitre --- arch/arm/mach-kirkwood/include/mach/kirkwood.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/arm/mach-kirkwood/include/mach') diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index 00be8c524f0..2172224d7e2 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h @@ -20,12 +20,16 @@ * f1000000 on-chip peripheral registers * f2000000 PCIe I/O space * f3000000 NAND controller address window + * f4000000 Security Accelerator SRAM * * virt phys size * fee00000 f1000000 1M on-chip peripheral registers * fef00000 f2000000 1M PCIe I/O space */ +#define KIRKWOOD_SRAM_PHYS_BASE 0xf4000000 +#define KIRKWOOD_SRAM_SIZE SZ_2K + #define KIRKWOOD_NAND_MEM_PHYS_BASE 0xf3000000 #define KIRKWOOD_NAND_MEM_SIZE SZ_1K -- cgit v1.2.3 From ae5c8c83735f5fcb09b380944e4854a383006998 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Wed, 3 Jun 2009 15:24:36 -0400 Subject: [ARM] Kirkwood: platform device registration for the crypto engine Signed-off-by: Nicolas Pitre --- arch/arm/mach-kirkwood/include/mach/kirkwood.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm/mach-kirkwood/include/mach') diff --git a/arch/arm/mach-kirkwood/include/mach/kirkwood.h b/arch/arm/mach-kirkwood/include/mach/kirkwood.h index 2172224d7e2..07af858814a 100644 --- a/arch/arm/mach-kirkwood/include/mach/kirkwood.h +++ b/arch/arm/mach-kirkwood/include/mach/kirkwood.h @@ -66,6 +66,8 @@ #define BRIDGE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x20000) +#define CRYPTO_PHYS_BASE (KIRKWOOD_REGS_PHYS_BASE | 0x30000) + #define PCIE_VIRT_BASE (KIRKWOOD_REGS_VIRT_BASE | 0x40000) #define PCIE_LINK_CTRL (PCIE_VIRT_BASE | 0x70) #define PCIE_STATUS (PCIE_VIRT_BASE | 0x1a04) -- cgit v1.2.3