ep93xx: Move SoC private bits to core
Subsystems (8)
cover ep93xx: Move SoC private bits to core
This patch series is an effort to move the ep93xx SoC specific code out of drivers and include/mach into arch/arm/mach-ep93xx. This work involves the following changes:
- Create a new private header called soc.h to replace most of mach/include/ep93xx-regs.h
- Move the Maverick crunch code from arch/arm/kernel to mach-ep93xx
- Move all system controller access to the ep93xx core code
There are a small handful of defines left in ep93xx-regs.h which are used by both the ep93xx core and include/mach files (uncompress.h, debug-macro.S, etc).
Ryan Mallon (11):
ep93xx: Move PHYS_BASE defines to local SoC header file
ep93xx: Move GPIO defines to gpio-ep93xx.h
ep93xx: Move peripheral defines to local SoC header
ep93xx: Configure GPIO ports in core code
ep93xx: Move arch_reset to core.c
ep93xx: Don't use system controller defines in audio drivers
ep93xx: Make syscon access functions private to SoC
ep93xx: Move EP93XX_WATCHDOG_BASE define to driver
ep93xx: Move crunch code to mach-ep93xx directory
ep93xx: Move EP93XX_SYSCON defines to SoC private header
ep93xx: Remove unnecessary includes of ep93xx-regs.h
arch/arm/kernel/Makefile | 3 -
arch/arm/mach-ep93xx/Makefile | 3 +
arch/arm/mach-ep93xx/adssphere.c | 1 +
arch/arm/mach-ep93xx/clock.c | 1 +
arch/arm/mach-ep93xx/core.c | 47 ++++--
arch/arm/{kernel => mach-ep93xx}/crunch-bits.S | 0
arch/arm/{kernel => mach-ep93xx}/crunch.c | 4 +-
arch/arm/mach-ep93xx/dma.c | 2 +
arch/arm/mach-ep93xx/edb93xx.c | 2 +
arch/arm/mach-ep93xx/gesbc9312.c | 1 +
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 191 +--------------------
arch/arm/mach-ep93xx/include/mach/gpio-ep93xx.h | 10 +
arch/arm/mach-ep93xx/include/mach/hardware.h | 1 -
arch/arm/mach-ep93xx/include/mach/platform.h | 16 +--
arch/arm/mach-ep93xx/include/mach/system.h | 14 +--
arch/arm/mach-ep93xx/micro9.c | 1 +
arch/arm/mach-ep93xx/simone.c | 2 +
arch/arm/mach-ep93xx/snappercl15.c | 2 +
arch/arm/mach-ep93xx/soc.h | 210 +++++++++++++++++++++++
arch/arm/mach-ep93xx/ts72xx.c | 2 +
arch/arm/mach-ep93xx/vision_ep9307.c | 2 +
drivers/gpio/gpio-ep93xx.c | 7 -
drivers/watchdog/ep93xx_wdt.c | 2 +
sound/soc/ep93xx/edb93xx.c | 4 +-
sound/soc/ep93xx/snappercl15.c | 4 +-
25 files changed, 279 insertions(+), 253 deletions(-)
rename arch/arm/{kernel => mach-ep93xx}/crunch-bits.S (100%)
rename arch/arm/{kernel => mach-ep93xx}/crunch.c (98%)
create mode 100644 arch/arm/mach-ep93xx/soc.hPATCH 1/11 ep93xx: Move PHYS_BASE defines to local SoC header file
The PHYS_BASE defines in arch/arm/mach-ep93xx/include/mach-ep93xx-regs.h are only used in the SoC code. Move the defines to a local header file.
--- arch/arm/mach-ep93xx/adssphere.c | 1 + arch/arm/mach-ep93xx/edb93xx.c | 2 + arch/arm/mach-ep93xx/gesbc9312.c | 1 + arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 34 --------------- arch/arm/mach-ep93xx/micro9.c | 1 + arch/arm/mach-ep93xx/simone.c | 2 + arch/arm/mach-ep93xx/snappercl15.c | 2 + arch/arm/mach-ep93xx/soc.h | 50 +++++++++++++++++++++++ arch/arm/mach-ep93xx/ts72xx.c | 2 + arch/arm/mach-ep93xx/vision_ep9307.c | 2 + 10 files changed, 63 insertions(+), 34 deletions(-) create mode 100644 arch/arm/mach-ep93xx/soc.h
arch/arm/mach-ep93xx/adssphere.c +1 -0
@@ -19,6 +19,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "soc.h" static struct ep93xx_eth_data __initdata adssphere_eth_data = { .phy_id =1 ,
arch/arm/mach-ep93xx/edb93xx.c +2 -0
@@ -42,6 +42,8 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "soc.h" +static void __init edb93xx_register_flash (void ) {
arch/arm/mach-ep93xx/gesbc9312.c +1 -0
@@ -19,6 +19,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "soc.h" static struct ep93xx_eth_data __initdata gesbc9312_eth_data = { .phy_id =1 ,
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +0 -34
@@ -6,40 +6,6 @@#define __ASM_ARCH_EP93XX_REGS_H/* -* EP93xx Physical Memory Map: -* -* The ASDO pin is sampled at system reset to select a synchronous or -* asynchronous boot configuration. When ASDO is "1" (i.e. pulled-up) -* the synchronous boot mode is selected. When ASDO is "0" (i.e -* pulled-down) the asynchronous boot mode is selected. -* -* In synchronous boot mode nSDCE3 is decoded starting at physical address -* 0x00000000 and nCS0 is decoded starting at 0xf0000000. For asynchronous -* boot mode they are swapped with nCS0 decoded at 0x00000000 ann nSDCE3 -* decoded at 0xf0000000. -* -* There is known errata for the EP93xx dealing with External Memory -* Configurations. Please refer to "AN273: EP93xx Silicon Rev E Design -* Guidelines" for more information. This document can be found at: -* -* http://www.cirrus.com/en/pubs/appNote/AN273REV4.pdf -*/ - -#define EP93XX_CS0_PHYS_BASE_ASYNC 0x00000000/* ASDO Pin = 0 */ -#define EP93XX_SDCE3_PHYS_BASE_SYNC 0x00000000/* ASDO Pin = 1 */ -#define EP93XX_CS1_PHYS_BASE 0x10000000 -#define EP93XX_CS2_PHYS_BASE 0x20000000 -#define EP93XX_CS3_PHYS_BASE 0x30000000 -#define EP93XX_PCMCIA_PHYS_BASE 0x40000000 -#define EP93XX_CS6_PHYS_BASE 0x60000000 -#define EP93XX_CS7_PHYS_BASE 0x70000000 -#define EP93XX_SDCE0_PHYS_BASE 0xc0000000 -#define EP93XX_SDCE1_PHYS_BASE 0xd0000000 -#define EP93XX_SDCE2_PHYS_BASE 0xe0000000 -#define EP93XX_SDCE3_PHYS_BASE_ASYNC 0xf0000000/* ASDO Pin = 0 */ -#define EP93XX_CS0_PHYS_BASE_SYNC 0xf0000000/* ASDO Pin = 1 */ - -/* * EP93xx linux memory map: * * virt phys size
arch/arm/mach-ep93xx/micro9.c +1 -0
@@ -21,6 +21,7 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "soc.h" /************************************************************************* * Micro9 NOR Flash
arch/arm/mach-ep93xx/simone.c +2 -0
@@ -28,6 +28,8 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "soc.h" +static struct ep93xx_eth_data __initdata simone_eth_data = { .phy_id =1 , };
arch/arm/mach-ep93xx/snappercl15.c +2 -0
@@ -34,6 +34,8 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "soc.h" +#define SNAPPERCL15_NAND_BASE (EP93XX_CS7_PHYS_BASE + SZ_16M)#define SNAPPERCL15_NAND_WPN (1 << 8)/* Write protect (active low) */
arch/arm/mach-ep93xx/soc.h new file +50 -0
50 lines not on this page · raw message
arch/arm/mach-ep93xx/ts72xx.c +2 -0
@@ -27,6 +27,8 @@#include <asm/mach/map.h> #include <asm/mach/arch.h> +#include "soc.h" +static struct map_desc ts72xx_io_desc[]__initdata = { {
arch/arm/mach-ep93xx/vision_ep9307.c +2 -0
@@ -37,6 +37,8 @@#include <asm/mach/map.h> #include <asm/mach/arch.h> +#include "soc.h" +/************************************************************************* * Static I/O mappings for the FPGA *************************************************************************/
Signature · 1 line
1.7.0.4
PATCH 1/11 ep93xx: Move PHYS_BASE defines to local SoC header file
Quoted 19 lines · Ryan Mallon
The
PHYS_BASEdefines inarch/arm/mach-ep93xx/include/mach-ep93xx-regs.hare only used in the SoC code. Move the defines to a local header file.Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/adssphere.c | 1 + arch/arm/mach-ep93xx/edb93xx.c | 2 + arch/arm/mach-ep93xx/gesbc9312.c | 1 + arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 34 --------------- arch/arm/mach-ep93xx/micro9.c | 1 + arch/arm/mach-ep93xx/simone.c | 2 + arch/arm/mach-ep93xx/snappercl15.c | 2 + arch/arm/mach-ep93xx/soc.h | 50 +++++++++++++++++++++++ arch/arm/mach-ep93xx/ts72xx.c | 2 + arch/arm/mach-ep93xx/vision_ep9307.c | 2 + 10 files changed, 63 insertions(+), 34 deletions(-) create mode 100644 arch/arm/mach-ep93xx/soc.h
<snip>
arch/arm/mach-ep93xx/edb93xx.c line 46
Quoted 9 lines
arch/arm/mach-ep93xx/edb93xx.c +2
-0@@ -42,6 +42,8 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "soc.h" +
Nitpick... Unnecessary whitespace...
<snip>
arch/arm/mach-ep93xx/ts72xx.c line 31
Quoted 9 lines
arch/arm/mach-ep93xx/ts72xx.c +2
-0@@ -27,6 +27,8 @@#include <asm/mach/map.h> #include <asm/mach/arch.h> +#include "soc.h" +
Nitpick... Unnecessary whitespace...
Other than that... Looks ok.
PATCH 1/11 ep93xx: Move PHYS_BASE defines to local SoC header file
Quoted 42 lines · H Hartley Sweeten
Quoted 18 lines · Ryan Mallon
The
PHYS_BASEdefines inarch/arm/mach-ep93xx/include/mach-ep93xx-regs.hare only used in the SoC code. Move the defines to a local header file.Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/adssphere.c | 1 + arch/arm/mach-ep93xx/edb93xx.c | 2 + arch/arm/mach-ep93xx/gesbc9312.c | 1 + arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 34 --------------- arch/arm/mach-ep93xx/micro9.c | 1 + arch/arm/mach-ep93xx/simone.c | 2 + arch/arm/mach-ep93xx/snappercl15.c | 2 + arch/arm/mach-ep93xx/soc.h | 50 +++++++++++++++++++++++ arch/arm/mach-ep93xx/ts72xx.c | 2 + arch/arm/mach-ep93xx/vision_ep9307.c | 2 + 10 files changed, 63 insertions(+), 34 deletions(-) create mode 100644 arch/arm/mach-ep93xx/soc.h<snip>
arch/arm/mach-ep93xx/edb93xx.c line 46
Quoted 9 lines
arch/arm/mach-ep93xx/edb93xx.c +2
-0@@ -42,6 +42,8 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> +#include "soc.h" +Nitpick... Unnecessary whitespace...
<snip>
Quoted 7 lines
arch/arm/mach-ep93xx/ts72xx.c +0
-0@@ -27,6 +27,8 @@#include <asm/mach/map.h> #include <asm/mach/arch.h>
Quoted 3 lines
arch/arm/mach-ep93xx/ts72xx.c line 31
Quoted 2 lines
arch/arm/mach-ep93xx/ts72xx.c +2
-0+#include "soc.h" +Nitpick... Unnecessary whitespace...
Oops, will fix.
Quoted 5 lines
Other than that... Looks ok.
Thanks,
~Ryan
PATCH 2/11 ep93xx: Move GPIO defines to gpio-ep93xx.h
In reply to Ryan Mallon--- arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 8 -------- arch/arm/mach-ep93xx/include/mach/gpio-ep93xx.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 8 deletions(-)
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +0 -8
@@ -64,14 +64,6 @@#define EP93XX_SECURITY_BASE EP93XX_APB_IOMEM(0x00030000) -#define EP93XX_GPIO_PHYS_BASE EP93XX_APB_PHYS(0x00040000) -#define EP93XX_GPIO_BASE EP93XX_APB_IOMEM(0x00040000) -#define EP93XX_GPIO_REG (x) (EP93XX_GPIO_BASE + (x)) -#define EP93XX_GPIO_F_INT_STATUS EP93XX_GPIO_REG(0x5c) -#define EP93XX_GPIO_A_INT_STATUS EP93XX_GPIO_REG(0xa0) -#define EP93XX_GPIO_B_INT_STATUS EP93XX_GPIO_REG(0xbc) -#define EP93XX_GPIO_EEDRIVE EP93XX_GPIO_REG(0xc8) -#define EP93XX_AAC_PHYS_BASE EP93XX_APB_PHYS(0x00080000)#define EP93XX_AAC_BASE EP93XX_APB_IOMEM(0x00080000)
arch/arm/mach-ep93xx/include/mach/gpio-ep93xx.h +10 -0
@@ -3,6 +3,16 @@#ifndef __GPIO_EP93XX_H#define __GPIO_EP93XX_H +#include <mach/ep93xx-regs.h> + +#define EP93XX_GPIO_PHYS_BASE EP93XX_APB_PHYS(0x00040000) +#define EP93XX_GPIO_BASE EP93XX_APB_IOMEM(0x00040000) +#define EP93XX_GPIO_REG (x) (EP93XX_GPIO_BASE + (x)) +#define EP93XX_GPIO_F_INT_STATUS EP93XX_GPIO_REG(0x5c) +#define EP93XX_GPIO_A_INT_STATUS EP93XX_GPIO_REG(0xa0) +#define EP93XX_GPIO_B_INT_STATUS EP93XX_GPIO_REG(0xbc) +#define EP93XX_GPIO_EEDRIVE EP93XX_GPIO_REG(0xc8) +/* GPIO port A. */ #define EP93XX_GPIO_LINE_A (x) ((x) + 0)#define EP93XX_GPIO_LINE_EGPIO0 EP93XX_GPIO_LINE_A(0)
Signature · 1 line
1.7.0.4
PATCH 2/11 ep93xx: Move GPIO defines to gpio-ep93xx.h
Quoted 8 lines · Ryan Mallon
Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 8 -------- arch/arm/mach-ep93xx/include/mach/gpio-ep93xx.h | 10 ++++++++++ 2 files changed, 10 insertions(+), 8 deletions(-)
Nitpick... You should add a commit comment.
Other than that, looks good.
PATCH 3/11 ep93xx: Move peripheral defines to local SoC header
In reply to Ryan MallonMove the AHB/APB peripheral defines to local SoC header since they are only needed by the core SoC code. The UART defines are not moved because they are used by the mach/uncompress.h header.
--- arch/arm/mach-ep93xx/core.c | 1 + arch/arm/mach-ep93xx/dma.c | 2 + arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 57 +---------------------- arch/arm/mach-ep93xx/soc.h | 54 +++++++++++++++++++++ 4 files changed, 58 insertions(+), 56 deletions(-)
arch/arm/mach-ep93xx/core.c +1 -0
@@ -46,6 +46,7 @@#include <asm/hardware/vic.h> +#include "soc.h" /************************************************************************* * Static I/O mappings that are needed for all EP93xx platforms
arch/arm/mach-ep93xx/dma.c +2 -0
@@ -28,6 +28,8 @@#include <mach/dma.h> #include <mach/hardware.h> +#include "soc.h" +#define DMA_CHANNEL (_name, _base, _irq) \ { .name = (_name), .base = (_base), .irq = (_irq) }
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +1 -56
69 lines not on this page · raw message
arch/arm/mach-ep93xx/soc.h +54 -0
58 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 3/11 ep93xx: Move peripheral defines to local SoC header
Quoted 8 lines · Ryan Mallon
Move the AHB/APB peripheral defines to local SoC header since they are only needed by the core SoC code. The UART defines are not
moved because they are used by themach/uncompress.hheader.Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Signed-off-by Ryan Mallon <[email protected]>
Quoted 6 lines
--- arch/arm/mach-ep93xx/core.c | 1 + arch/arm/mach-ep93xx/dma.c | 2 + arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 57 +---------------------- arch/arm/mach-ep93xx/soc.h | 54 +++++++++++++++++++++ 4 files changed, 58 insertions(+), 56 deletions(-)
Looks good.
PATCH 4/11 ep93xx: Configure GPIO ports in core code
In reply to Ryan MallonMove the pinmux setting of the EP93xx GPIOs to the core code. This removes the need for the GPIO driver to have access to the system controller registers.
--- arch/arm/mach-ep93xx/core.c | 7 +++++++ drivers/gpio/gpio-ep93xx.c | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/mach-ep93xx/core.c +7 -0
@@ -896,6 +896,13 @@ void __init ep93xx_init_devices(void)/* Disallow access to MaverickCrunch initially */ ep93xx_devcfg_clear_bits (EP93XX_SYSCON_DEVCFG_CPENA ); +/* Default all ports to GPIO */ +ep93xx_devcfg_set_bits (EP93XX_SYSCON_DEVCFG_KEYS | +EP93XX_SYSCON_DEVCFG_GONK | +EP93XX_SYSCON_DEVCFG_EONIDE | +EP93XX_SYSCON_DEVCFG_GONIDE | +EP93XX_SYSCON_DEVCFG_HONIDE ); +/* Get the GPIO working early, other devices need it */ platform_device_register (&ep93xx_gpio_device);
drivers/gpio/gpio-ep93xx.c +0 -7
@@ -378,13 +378,6 @@ static int __devinit ep93xx_gpio_probe(struct platform_device *pdev) } ep93xx_gpio->mmio_base = mmio; -/* Default all ports to GPIO */ -ep93xx_devcfg_set_bits (EP93XX_SYSCON_DEVCFG_KEYS | -EP93XX_SYSCON_DEVCFG_GONK | -EP93XX_SYSCON_DEVCFG_EONIDE | -EP93XX_SYSCON_DEVCFG_GONIDE | -EP93XX_SYSCON_DEVCFG_HONIDE ); -for (i =0 ; i <ARRAY_SIZE (ep93xx_gpio_banks); i++) {struct bgpio_chip *bgc = &ep93xx_gpio->bgc[i];struct ep93xx_gpio_bank *bank = &ep93xx_gpio_banks[i];
Signature · 1 line
1.7.0.4
PATCH 4/11 ep93xx: Configure GPIO ports in core code
Quoted 18 lines · Ryan Mallon
Move the pinmux setting of the EP93xx GPIOs to the core code. This removes the need for the GPIO driver to have access to the system controller registers.
Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Cc Grant Likely <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/core.c | 7 +++++++ drivers/gpio/gpio-ep93xx.c | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-)arch/arm/mach-ep93xx/core.c +0
-0
arch/arm/mach-ep93xx/core.c void __init ep93xx_init_devices(void) · line 905
Quoted 10 lines
arch/arm/mach-ep93xx/core.c +7
-0@@ -896,6 +896,13 @@ void __init ep93xx_init_devices(void)/* Disallow access to MaverickCrunch initially */ ep93xx_devcfg_clear_bits (EP93XX_SYSCON_DEVCFG_CPENA ); +/* Default all ports to GPIO */ +ep93xx_devcfg_set_bits (EP93XX_SYSCON_DEVCFG_KEYS | +EP93XX_SYSCON_DEVCFG_GONK | +EP93XX_SYSCON_DEVCFG_EONIDE | +EP93XX_SYSCON_DEVCFG_GONIDE | +EP93XX_SYSCON_DEVCFG_HONIDE ); +
Doesn't this now change the behaviour? Now you unconditionally mux the pins whereas before they were only muxed if we had GPIO driver enabled.
Quoted 23 lines
arch/arm/mach-ep93xx/core.c +0
-0/* Get the GPIO working early, other devices need it */ platform_device_register (&ep93xx_gpio_device);drivers/gpio/gpio-ep93xx.c +0
-7@@ -378,13 +378,6 @@ static int __devinit ep93xx_gpio_probe(struct platform_device *pdev) } ep93xx_gpio->mmio_base = mmio; -/* Default all ports to GPIO */ -ep93xx_devcfg_set_bits (EP93XX_SYSCON_DEVCFG_KEYS | -EP93XX_SYSCON_DEVCFG_GONK | -EP93XX_SYSCON_DEVCFG_EONIDE | -EP93XX_SYSCON_DEVCFG_GONIDE | -EP93XX_SYSCON_DEVCFG_HONIDE ); -for (i =0 ; i <ARRAY_SIZE (ep93xx_gpio_banks); i++) {struct bgpio_chip *bgc = &ep93xx_gpio->bgc[i];struct ep93xx_gpio_bank *bank = &ep93xx_gpio_banks[i];Signature · 1 line
1.7.0.4
PATCH 4/11 ep93xx: Configure GPIO ports in core code
Quoted 22 lines · Mika Westerberg
Quoted 21 lines · Ryan Mallon
Move the pinmux setting of the EP93xx GPIOs to the core code. This removes the need for the GPIO driver to have access to the system controller registers.
Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Cc Grant Likely <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/core.c | 7 +++++++ drivers/gpio/gpio-ep93xx.c | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-)arch/arm/mach-ep93xx/core.c +0
-0@@ -896,6 +896,13 @@ void __init ep93xx_init_devices(void)/* Disallow access to MaverickCrunch initially */ ep93xx_devcfg_clear_bits (EP93XX_SYSCON_DEVCFG_CPENA );
Quoted 9 lines
arch/arm/mach-ep93xx/core.c void __init ep93xx_init_devices(void) · line 905
Quoted 7 lines
arch/arm/mach-ep93xx/core.c +7
-0+/* Default all ports to GPIO */ +ep93xx_devcfg_set_bits (EP93XX_SYSCON_DEVCFG_KEYS | +EP93XX_SYSCON_DEVCFG_GONK | +EP93XX_SYSCON_DEVCFG_EONIDE | +EP93XX_SYSCON_DEVCFG_GONIDE | +EP93XX_SYSCON_DEVCFG_HONIDE ); +Doesn't this now change the behaviour? Now you unconditionally mux the pins whereas before they were only muxed if we had GPIO driver enabled.
True, but I think the previous behaviour was broken anyway. If the gpio driver was installed after any driver which has muxed gpio pins for other purposes then it will override those settings. All of the ep93xx drivers will mux the pins they need at probe time. IIRC, before the gpio driver was moved out of arch/arm/mach-ep93xx we muxed all the pins unconditionally anyway.
I can update the changelog to reflect the changed behaviour, but I don't think it will cause problems for anyone. Will see if Hartley has any comments.
~Ryan
Quoted 23 lines
Quoted 23 lines
arch/arm/mach-ep93xx/core.c +0
-0/* Get the GPIO working early, other devices need it */ platform_device_register (&ep93xx_gpio_device);drivers/gpio/gpio-ep93xx.c +0
-7@@ -378,13 +378,6 @@ static int __devinit ep93xx_gpio_probe(struct platform_device *pdev) } ep93xx_gpio->mmio_base = mmio; -/* Default all ports to GPIO */ -ep93xx_devcfg_set_bits (EP93XX_SYSCON_DEVCFG_KEYS | -EP93XX_SYSCON_DEVCFG_GONK | -EP93XX_SYSCON_DEVCFG_EONIDE | -EP93XX_SYSCON_DEVCFG_GONIDE | -EP93XX_SYSCON_DEVCFG_HONIDE ); -for (i =0 ; i <ARRAY_SIZE (ep93xx_gpio_banks); i++) {struct bgpio_chip *bgc = &ep93xx_gpio->bgc[i];struct ep93xx_gpio_bank *bank = &ep93xx_gpio_banks[i];Signature · 1 line
1.7.0.4
PATCH 4/11 ep93xx: Configure GPIO ports in core code
Quoted 33 lines · Ryan Mallon
Quoted 22 lines · Mika Westerberg
Quoted 21 lines · Ryan Mallon
Move the pinmux setting of the EP93xx GPIOs to the core code. This removes the need for the GPIO driver to have access to the system controller registers.
Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Cc Grant Likely <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/core.c | 7 +++++++ drivers/gpio/gpio-ep93xx.c | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-)arch/arm/mach-ep93xx/core.c +0
-0@@ -896,6 +896,13 @@ void __init ep93xx_init_devices(void)/* Disallow access to MaverickCrunch initially */ ep93xx_devcfg_clear_bits (EP93XX_SYSCON_DEVCFG_CPENA );Quoted 9 lines
arch/arm/mach-ep93xx/core.c void __init ep93xx_init_devices(void) · line 905
Quoted 7 lines
arch/arm/mach-ep93xx/core.c +7
-0+/* Default all ports to GPIO */ +ep93xx_devcfg_set_bits (EP93XX_SYSCON_DEVCFG_KEYS | +EP93XX_SYSCON_DEVCFG_GONK | +EP93XX_SYSCON_DEVCFG_EONIDE | +EP93XX_SYSCON_DEVCFG_GONIDE | +EP93XX_SYSCON_DEVCFG_HONIDE ); +Doesn't this now change the behaviour? Now you unconditionally mux the pins whereas before they were only muxed if we had GPIO driver enabled.
Quoted 6 lines
True, but I think the previous behaviour was broken anyway. If the gpio driver was installed after any driver which has muxed gpio pins for other purposes then it will override those settings. All of the ep93xx drivers will mux the pins they need at probe time. IIRC, before the gpio driver was moved out of
arch/arm/mach-ep93xxwe muxed all the pins unconditionally anyway.
Ah, right. So now it actually behaves better since it's not dependent on which phase the GPIO driver is probed.
Thus,
PATCH 4/11 ep93xx: Configure GPIO ports in core code
In reply to Ryan MallonQuoted 33 lines · Ryan Mallon
Quoted 22 lines · Mika Westerberg
Quoted 21 lines · Ryan Mallon
Move the pinmux setting of the EP93xx GPIOs to the core code. This removes the need for the GPIO driver to have access to the system controller registers.
Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Cc Grant Likely <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/core.c | 7 +++++++ drivers/gpio/gpio-ep93xx.c | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-)(quoted diff) +0
-0
b/arch/arm/mach-ep93xx/core.cindex dcb10c2..978c5a6 100644arch/arm/mach-ep93xx/core.c +0
-0@@ -896,6 +896,13 @@ void __init ep93xx_init_devices(void)/* Disallow access to MaverickCrunch initially */ ep93xx_devcfg_clear_bits (EP93XX_SYSCON_DEVCFG_CPENA );Quoted 9 lines
arch/arm/mach-ep93xx/core.c void __init ep93xx_init_devices(void) · line 905
Quoted 7 lines
arch/arm/mach-ep93xx/core.c +7
-0+/* Default all ports to GPIO */ +ep93xx_devcfg_set_bits (EP93XX_SYSCON_DEVCFG_KEYS | +EP93XX_SYSCON_DEVCFG_GONK | +EP93XX_SYSCON_DEVCFG_EONIDE | +EP93XX_SYSCON_DEVCFG_GONIDE | +EP93XX_SYSCON_DEVCFG_HONIDE ); +Doesn't this now change the behaviour? Now you unconditionally mux the pins whereas before they were only muxed if we had GPIO driver enabled.
Quoted 8 lines
True, but I think the previous behaviour was broken anyway. If the gpio driver was installed after any driver which has muxed gpio pins for other purposes then it will override those settings. All of the ep93xx drivers will mux the pins they need at probe time. IIRC, before the gpio driver was moved out of
arch/arm/mach-ep93xxwe muxed all the pins unconditionally anyway.I can update the changelog to reflect the changed behaviour, but I don't think it will cause problems for anyone. Will see if Hartley has any comments.
Actually, there shouldn't be any change in behavior.
The gpio-ep93xx driver is always enabled in drivers/gpio/Kconfig when ARCH_EP93XX Is enabled:
config GPIO_EP93XX
def_bool y
depends on ARCH_EP93XX
select GPIO_GENERIC
Because it's a hidden Kconfig option it cannot be disabled.
Since the gpio-ep93xx driver is the first driver registered it also ends up being the first one probed. So the gpiomux ends up getting set before any other driver is loaded anyway.
The other drivers then setup the gpiomux as required as they load.
Regards,
Hartley
PATCH 5/11 ep93xx: Move arch_reset to core.c
In reply to Ryan MallonMove the arch_reset function from include/mach/system.h to core.c. This removes the need for the EP93XX_SYSCON_DEVCFG defines to be exported in the include/mach headers.
--- arch/arm/mach-ep93xx/core.c | 18 ++++++++++++++++++ arch/arm/mach-ep93xx/include/mach/system.h | 14 +------------- 2 files changed, 19 insertions(+), 13 deletions(-)
arch/arm/mach-ep93xx/core.c +18 -0
@@ -240,6 +240,24 @@ unsigned int ep93xx_chip_revision(void) }/************************************************************************* +* Reset handling for EP93xx +*************************************************************************/ + +void arch_reset (char mode,const char *cmd) +{ +local_irq_disable (); + +/* +* Set then clear the SWRST bit to initiate a software reset +*/ +ep93xx_devcfg_set_bits (EP93XX_SYSCON_DEVCFG_SWRST ); +ep93xx_devcfg_clear_bits (EP93XX_SYSCON_DEVCFG_SWRST ); + +while (1 ) + ; +} + +/************************************************************************* * EP93xx GPIO *************************************************************************/ static struct resource ep93xx_gpio_resource[] = {
arch/arm/mach-ep93xx/include/mach/system.h +1 -13
@@ -9,16 +9,4 @@ static inline void arch_idle(void)cpu_do_idle (); } -static inline void arch_reset (char mode,const char *cmd) -{ -local_irq_disable (); - -/* -* Set then clear the SWRST bit to initiate a software reset -*/ -ep93xx_devcfg_set_bits (EP93XX_SYSCON_DEVCFG_SWRST ); -ep93xx_devcfg_clear_bits (EP93XX_SYSCON_DEVCFG_SWRST ); - -while (1 ) - ; -} +extern void arch_reset (char mode,const char *cmd);
Signature · 1 line
1.7.0.4
PATCH 5/11 ep93xx: Move arch_reset to core.c
Quoted 5 lines · Ryan Mallon
Move the
arch_resetfunction frominclude/mach/system.htocore.c. This removes the need for theEP93XX_SYSCON_DEVCFGdefines to
be exported in theinclude/machheaders.
Quoted 7 lines
Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/core.c | 18 ++++++++++++++++++ arch/arm/mach-ep93xx/include/mach/system.h | 14 +------------- 2 files changed, 19 insertions(+), 13 deletions(-)
As you already found, the ARM reset rework already handled this.
Regards,
Hartley
PATCH 6/11 ep93xx: Don't use system controller defines in audio drivers
In reply to Ryan MallonBoth the Snapper CL15 and EDB93xx audio drivers set the same audio configuration in ep93xx_i2s_acquire. Remove the arguments to ep93xx_i2s_acquire so that the audio drivers no longer need the EP93XX_SYSCON defines exported.
--- arch/arm/mach-ep93xx/core.c | 19 ++++--------------- arch/arm/mach-ep93xx/include/mach/platform.h | 2 +- sound/soc/ep93xx/edb93xx.c | 4 +--- sound/soc/ep93xx/snappercl15.c | 4 +--- 4 files changed, 7 insertions(+), 22 deletions(-)
arch/arm/mach-ep93xx/core.c +4 -15
@@ -836,23 +836,12 @@ void __init ep93xx_register_i2s(void)#define EP93XX_I2SCLKDIV_MASK (EP93XX_SYSCON_I2SCLKDIV_ORIDE | \ EP93XX_SYSCON_I2SCLKDIV_SPOL) -int ep93xx_i2s_acquire (unsigned i2s_pins,unsigned i2s_config) +int ep93xx_i2s_acquire (void ) {unsigned val; -/* Sanity check */ -if (i2s_pins & ~EP93XX_SYSCON_DEVCFG_I2S_MASK ) -return -EINVAL ; -if (i2s_config & ~EP93XX_I2SCLKDIV_MASK ) -return -EINVAL ; - -/* Must have only one of I2SONSSP/I2SONAC97 set */ -if ((i2s_pins &EP93XX_SYSCON_DEVCFG_I2SONSSP ) == - (i2s_pins &EP93XX_SYSCON_DEVCFG_I2SONAC97 )) -return -EINVAL ; - -ep93xx_devcfg_clear_bits (EP93XX_SYSCON_DEVCFG_I2S_MASK ); -ep93xx_devcfg_set_bits (i2s_pins); +ep93xx_devcfg_set_clear (EP93XX_SYSCON_DEVCFG_I2SONAC97 , +EP93XX_SYSCON_DEVCFG_I2S_MASK );/* * This is potentially racy with the clock api for i2s_mclk, sclk and
@@ -862,7 +851,7 @@ int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config)*/ val =__raw_readl (EP93XX_SYSCON_I2SCLKDIV ); val &= ~EP93XX_I2SCLKDIV_MASK ; - val |= i2s_config; + val |=EP93XX_SYSCON_I2SCLKDIV_ORIDE |EP93XX_SYSCON_I2SCLKDIV_SPOL ;ep93xx_syscon_swlocked_write (val,EP93XX_SYSCON_I2SCLKDIV );return 0 ;
arch/arm/mach-ep93xx/include/mach/platform.h +1 -1
@@ -59,7 +59,7 @@ void ep93xx_register_keypad(struct ep93xx_keypad_platform_data *data);int ep93xx_keypad_acquire_gpio (struct platform_device *pdev);void ep93xx_keypad_release_gpio (struct platform_device *pdev);void ep93xx_register_i2s (void ); -int ep93xx_i2s_acquire (unsigned i2s_pins,unsigned i2s_config); +int ep93xx_i2s_acquire (void );void ep93xx_i2s_release (void );void ep93xx_register_ac97 (void );
sound/soc/ep93xx/edb93xx.c +1 -3
@@ -94,9 +94,7 @@ static int __devinit edb93xx_probe(struct platform_device *pdev)struct snd_soc_card *card = &snd_soc_edb93xx;int ret; - ret =ep93xx_i2s_acquire (EP93XX_SYSCON_DEVCFG_I2SONAC97 , -EP93XX_SYSCON_I2SCLKDIV_ORIDE | -EP93XX_SYSCON_I2SCLKDIV_SPOL ); + ret =ep93xx_i2s_acquire ();if (ret)return ret;
sound/soc/ep93xx/snappercl15.c +1 -3
@@ -110,9 +110,7 @@ static int __devinit snappercl15_probe(struct platform_device *pdev)struct snd_soc_card *card = &snd_soc_snappercl15;int ret; - ret =ep93xx_i2s_acquire (EP93XX_SYSCON_DEVCFG_I2SONAC97 , -EP93XX_SYSCON_I2SCLKDIV_ORIDE | -EP93XX_SYSCON_I2SCLKDIV_SPOL ); + ret =ep93xx_i2s_acquire ();if (ret)return ret;
Signature · 1 line
1.7.0.4
PATCH 6/11 ep93xx: Don't use system controller defines in audio drivers
Quoted 4 lines · Ryan Mallon
Both the Snapper CL15 and EDB93xx audio drivers set the same audio configuration in
ep93xx_i2s_acquire. Remove the arguments toep93xx_i2s_acquireso that the audio drivers no longer need theEP93XX_SYSCONdefines exported.
What if there are other boards out there which use a different configuration?
PATCH 6/11 ep93xx: Don't use system controller defines in audio drivers
Quoted 7 lines · Mark Brown
Quoted 4 lines · Ryan Mallon
Both the Snapper CL15 and EDB93xx audio drivers set the same audio configuration in
ep93xx_i2s_acquire. Remove the arguments toep93xx_i2s_acquireso that the audio drivers no longer need theEP93XX_SYSCONdefines exported.What if there are other boards out there which use a different configuration?
We can either add a second function, like ep93xx_i2s_acquire_on_ssp, or we can create a set of defines for the various options needed. I just want to avoid exposing the system controller registers/flags directly. The ep93xx chip is now obsolete, so I don't expect new boards to appear, and these two boards have been the only ones with audio support for a couple of years now, so this seemed to be the best solution.
~Ryan
PATCH 6/11 ep93xx: Don't use system controller defines in audio drivers
Quoted 6 lines · Ryan Mallon
We can either add a second function, like
ep93xx_i2s_acquire_on_ssp, or we can create a set of defines for the various options needed. I just want to avoid exposing the system controller registers/flags directly. The ep93xx chip is now obsolete, so I don't expect new boards to appear, and these two boards have been the only ones with audio support for a couple of years now, so this seemed to be the best solution.
OK, that seems reasonable - I've applied the change, thanks.
PATCH 6/11 ep93xx: Don't use system controller defines in audio drivers
In reply to Ryan MallonQuoted 53 lines · Ryan Mallon
Both the Snapper CL15 and EDB93xx audio drivers set the same audio configuration in
ep93xx_i2s_acquire. Remove the arguments
toep93xx_i2s_acquireso that the audio drivers no longer need
theEP93XX_SYSCONdefines exported.Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Cc Liam Girdwood <[email protected]>Cc Mark Brown <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/core.c | 19 ++++--------------- arch/arm/mach-ep93xx/include/mach/platform.h | 2 +- sound/soc/ep93xx/edb93xx.c | 4 +--- sound/soc/ep93xx/snappercl15.c | 4 +--- 4 files changed, 7 insertions(+), 22 deletions(-)arch/arm/mach-ep93xx/core.c +3
-14@@ -836,23 +836,12 @@ void __init ep93xx_register_i2s(void)#define EP93XX_I2SCLKDIV_MASK (EP93XX_SYSCON_I2SCLKDIV_ORIDE | \ EP93XX_SYSCON_I2SCLKDIV_SPOL) -int ep93xx_i2s_acquire (unsigned i2s_pins,unsigned i2s_config) +int ep93xx_i2s_acquire (void ) {unsigned val; -/* Sanity check */ -if (i2s_pins & ~EP93XX_SYSCON_DEVCFG_I2S_MASK ) -return -EINVAL ; -if (i2s_config & ~EP93XX_I2SCLKDIV_MASK ) -return -EINVAL ; - -/* Must have only one of I2SONSSP/I2SONAC97 set */ -if ((i2s_pins &EP93XX_SYSCON_DEVCFG_I2SONSSP ) == - (i2s_pins &EP93XX_SYSCON_DEVCFG_I2SONAC97 )) -return -EINVAL ; - -ep93xx_devcfg_clear_bits (EP93XX_SYSCON_DEVCFG_I2S_MASK ); -ep93xx_devcfg_set_bits (i2s_pins); +ep93xx_devcfg_set_clear (EP93XX_SYSCON_DEVCFG_I2SONAC97 , +EP93XX_SYSCON_DEVCFG_I2S_MASK );/* * This is potentially racy with the clock api for i2s_mclk, sclk and @@ -862,7 +851,7 @@ int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config) arch/arm/mach-ep93xx/core.c +1
-1*/ val =__raw_readl (EP93XX_SYSCON_I2SCLKDIV ); val &= ~EP93XX_I2SCLKDIV_MASK ; - val |= i2s_config; + val |=EP93XX_SYSCON_I2SCLKDIV_ORIDE |EP93XX_SYSCON_I2SCLKDIV_SPOL ;
Quoted 1 line
ep93xx_syscon_swlocked_write(val, EP93XX_SYSCON_I2SCLKDIV);
Nitpick... You clear then set the same bits here.
Quoted 18 lines
sound/soc/ep93xx/edb93xx.c +1
-3@@ -94,9 +94,7 @@ static int __devinit edb93xx_probe(struct platform_device *pdev)struct snd_soc_card *card = &snd_soc_edb93xx;int ret; - ret =ep93xx_i2s_acquire (EP93XX_SYSCON_DEVCFG_I2SONAC97 , -EP93XX_SYSCON_I2SCLKDIV_ORIDE | -EP93XX_SYSCON_I2SCLKDIV_SPOL ); + ret =ep93xx_i2s_acquire ();if (ret)return ret;
sound/soc/ep93xx/snappercl15.c static int __devinit snappercl15_probe(struct platform_device *pdev) · line 116
Quoted 10 lines
sound/soc/ep93xx/snappercl15.c +1
-3@@ -110,9 +110,7 @@ static int __devinit snappercl15_probe(struct platform_device *pdev)struct snd_soc_card *card = &snd_soc_snappercl15;int ret; - ret =ep93xx_i2s_acquire (EP93XX_SYSCON_DEVCFG_I2SONAC97 , -EP93XX_SYSCON_I2SCLKDIV_ORIDE | -EP93XX_SYSCON_I2SCLKDIV_SPOL ); + ret =ep93xx_i2s_acquire ();if (ret)return ret;
Maybe the ep93xx_i2s_acquire() function should be renamed to something like ep93xx_i2s_ac97_acquire() so that the i2s configuration is understood. This should address Mark Brown's issue.
Regardless, looks good.
PATCH 6/11 ep93xx: Don't use system controller defines in audio drivers
Quoted 46 lines · H Hartley Sweeten
Quoted 45 lines · Ryan Mallon
Both the Snapper CL15 and EDB93xx audio drivers set the same audio configuration in
ep93xx_i2s_acquire. Remove the arguments
toep93xx_i2s_acquireso that the audio drivers no longer need
theEP93XX_SYSCONdefines exported.Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Cc Liam Girdwood <[email protected]>Cc Mark Brown <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/core.c | 19 ++++--------------- arch/arm/mach-ep93xx/include/mach/platform.h | 2 +- sound/soc/ep93xx/edb93xx.c | 4 +--- sound/soc/ep93xx/snappercl15.c | 4 +--- 4 files changed, 7 insertions(+), 22 deletions(-)arch/arm/mach-ep93xx/core.c +3
-14@@ -836,23 +836,12 @@ void __init ep93xx_register_i2s(void)#define EP93XX_I2SCLKDIV_MASK (EP93XX_SYSCON_I2SCLKDIV_ORIDE | \ EP93XX_SYSCON_I2SCLKDIV_SPOL) -int ep93xx_i2s_acquire (unsigned i2s_pins,unsigned i2s_config) +int ep93xx_i2s_acquire (void ) {unsigned val; -/* Sanity check */ -if (i2s_pins & ~EP93XX_SYSCON_DEVCFG_I2S_MASK ) -return -EINVAL ; -if (i2s_config & ~EP93XX_I2SCLKDIV_MASK ) -return -EINVAL ; - -/* Must have only one of I2SONSSP/I2SONAC97 set */ -if ((i2s_pins &EP93XX_SYSCON_DEVCFG_I2SONSSP ) == - (i2s_pins &EP93XX_SYSCON_DEVCFG_I2SONAC97 )) -return -EINVAL ; - -ep93xx_devcfg_clear_bits (EP93XX_SYSCON_DEVCFG_I2S_MASK ); -ep93xx_devcfg_set_bits (i2s_pins); +ep93xx_devcfg_set_clear (EP93XX_SYSCON_DEVCFG_I2SONAC97 , +EP93XX_SYSCON_DEVCFG_I2S_MASK );
Quoted 9 lines
Quoted 8 lines
arch/arm/mach-ep93xx/core.c +0
-0/* * This is potentially racy with the clock api for i2s_mclk, sclk and @@ -862,7 +851,7 @@ int ep93xx_i2s_acquire(unsigned i2s_pins, unsigned i2s_config) arch/arm/mach-ep93xx/core.c +1
-1*/ val =__raw_readl (EP93XX_SYSCON_I2SCLKDIV ); val &= ~EP93XX_I2SCLKDIV_MASK ; - val |= i2s_config; + val |=EP93XX_SYSCON_I2SCLKDIV_ORIDE |EP93XX_SYSCON_I2SCLKDIV_SPOL ;ep93xx_syscon_swlocked_write(val, EP93XX_SYSCON_I2SCLKDIV);Nitpick... You clear then set the same bits here.
I think that is probably a good idea anyway, since if someone copy and pastes this function to make one for other types of audio devices then they are more likely to get it right :-).
Quoted 21 lines
Quoted 21 lines
sound/soc/ep93xx/edb93xx.c +1
-3@@ -94,9 +94,7 @@ static int __devinit edb93xx_probe(struct platform_device *pdev)struct snd_soc_card *card = &snd_soc_edb93xx;int ret; - ret =ep93xx_i2s_acquire (EP93XX_SYSCON_DEVCFG_I2SONAC97 , -EP93XX_SYSCON_I2SCLKDIV_ORIDE | -EP93XX_SYSCON_I2SCLKDIV_SPOL ); + ret =ep93xx_i2s_acquire ();if (ret)return ret;sound/soc/ep93xx/snappercl15.c +0
-0@@ -110,9 +110,7 @@ static int __devinit snappercl15_probe(struct platform_device *pdev)struct snd_soc_card *card = &snd_soc_snappercl15;int ret;
Quoted 10 lines
sound/soc/ep93xx/snappercl15.c static int __devinit snappercl15_probe(struct platform_device *pdev) · line 116
Quoted 7 lines
sound/soc/ep93xx/snappercl15.c +1
-3- ret =ep93xx_i2s_acquire (EP93XX_SYSCON_DEVCFG_I2SONAC97 , -EP93XX_SYSCON_I2SCLKDIV_ORIDE | -EP93XX_SYSCON_I2SCLKDIV_SPOL ); + ret =ep93xx_i2s_acquire ();if (ret)return ret;Maybe the
ep93xx_i2s_acquire()function should be renamed to something likeep93xx_i2s_ac97_acquire()so that the i2s configuration is understood. This should address Mark Brown's issue.
Mark has already picked this patch up. I can probably modify it and get him to grab the new one, but the reason I didn't change the name is because there have been only two users of this function for a couple of years now, and the ep93xx is obsolete, so its unlikely that we are going to need a new function anyway.
Quoted 4 lines
Regardless, looks good.
Thanks,
~Ryan
PATCH 6/11 ep93xx: Don't use system controller defines in audio drivers
Quoted 11 lines · Ryan Mallon
Quoted 3 lines · H Hartley Sweeten
Maybe the
ep93xx_i2s_acquire()function should be renamed to something likeep93xx_i2s_ac97_acquire()so that the i2s configuration is understood. This should address Mark Brown's issue.Mark has already picked this patch up. I can probably modify it and get him to grab the new one, but the reason I didn't change the name is because there have been only two users of this function for a couple of years now, and the ep93xx is obsolete, so its unlikely that we are going to need a new function anyway.
If you do change it then please send an incremental patch rather than a new version. I'm OK whatever you guys decide here.
PATCH 7/11 ep93xx: Make syscon access functions private to SoC
In reply to Ryan MallonThe syscon access functions are no longer used outside of the core EP93xx code. Move their definitions into the SoC code.
--- arch/arm/mach-ep93xx/clock.c | 1 + arch/arm/mach-ep93xx/core.c | 2 -- arch/arm/mach-ep93xx/include/mach/platform.h | 14 -------------- arch/arm/mach-ep93xx/soc.h | 14 ++++++++++++++ 4 files changed, 15 insertions(+), 16 deletions(-)
arch/arm/mach-ep93xx/clock.c +1 -0
@@ -25,6 +25,7 @@#include <asm/div64.h> +#include "soc.h" struct clk {struct clk *parent;
arch/arm/mach-ep93xx/core.c +0 -2
@@ -205,7 +205,6 @@ void ep93xx_syscon_swlocked_write(unsigned int val, void __iomem *reg)spin_unlock_irqrestore (&syscon_swlock, flags); } -EXPORT_SYMBOL (ep93xx_syscon_swlocked_write);void ep93xx_devcfg_set_clear (unsigned int set_bits,unsigned int clear_bits) {
@@ -222,7 +221,6 @@ void ep93xx_devcfg_set_clear(unsigned int set_bits, unsigned int clear_bits)spin_unlock_irqrestore (&syscon_swlock, flags); } -EXPORT_SYMBOL (ep93xx_devcfg_set_clear);/** * ep93xx_chip_revision() - returns the EP93xx chip revision
arch/arm/mach-ep93xx/include/mach/platform.h +0 -14
@@ -21,20 +21,6 @@ struct ep93xx_eth_datavoid ep93xx_map_io (void );void ep93xx_init_irq (void ); -/* EP93xx System Controller software locked register write */ -void ep93xx_syscon_swlocked_write (unsigned int val,void __iomem *reg); -void ep93xx_devcfg_set_clear (unsigned int set_bits,unsigned int clear_bits); - -static inline void ep93xx_devcfg_set_bits (unsigned int bits) -{ -ep93xx_devcfg_set_clear (bits,0x00 ); -} - -static inline void ep93xx_devcfg_clear_bits (unsigned int bits) -{ -ep93xx_devcfg_set_clear (0x00 , bits); -} -#define EP93XX_CHIP_REV_D0 3#define EP93XX_CHIP_REV_D1 4#define EP93XX_CHIP_REV_E0 5
arch/arm/mach-ep93xx/soc.h +14 -0
@@ -13,6 +13,20 @@#ifndef _EP93XX_SOC_H#define _EP93XX_SOC_H +/* EP93xx System Controller software locked register write */ +void ep93xx_syscon_swlocked_write (unsigned int val,void __iomem *reg); +void ep93xx_devcfg_set_clear (unsigned int set_bits,unsigned int clear_bits); + +static inline void ep93xx_devcfg_set_bits (unsigned int bits) +{ +ep93xx_devcfg_set_clear (bits,0x00 ); +} + +static inline void ep93xx_devcfg_clear_bits (unsigned int bits) +{ +ep93xx_devcfg_set_clear (0x00 , bits); +} +/* * EP93xx Physical Memory Map: *
Signature · 1 line
1.7.0.4
PATCH 7/11 ep93xx: Make syscon access functions private to SoC
Quoted 7 lines · Ryan Mallon
The syscon access functions are no longer used outside of the core EP93xx code. Move their definitions into the SoC code.
Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Signed-off-by Ryan Mallon <[email protected]>
Quoted 6 lines
--- arch/arm/mach-ep93xx/clock.c | 1 + arch/arm/mach-ep93xx/core.c | 2 -- arch/arm/mach-ep93xx/include/mach/platform.h | 14 -------------- arch/arm/mach-ep93xx/soc.h | 14 ++++++++++++++ 4 files changed, 15 insertions(+), 16 deletions(-)
It looks like part of this patch is word wrapped, or it could just be me...
<snip>
Quoted 13 lines
arch/arm/mach-ep93xx/soc.h +6
-0@@ -13,6 +13,20 @@#ifndef _EP93XX_SOC_H#define _EP93XX_SOC_H +/* EP93xx System Controller software locked register write */ void +ep93xx_syscon_swlocked_write (unsigned int val,void __iomem *reg);void +ep93xx_devcfg_set_clear (unsigned int set_bits,unsigned int +clear_bits); + +static inline void ep93xx_devcfg_set_bits (unsigned int bits) {
arch/arm/mach-ep93xx/soc.h line 31
Quoted 10 lines
arch/arm/mach-ep93xx/soc.h +7
-0+ep93xx_devcfg_set_clear (bits,0x00 ); +} + +static inline void ep93xx_devcfg_clear_bits (unsigned int bits) { +ep93xx_devcfg_set_clear (0x00 , bits); +} +/* * EP93xx Physical Memory Map: *
I would prefer these functions to be after all the #define's. But, your call...
PATCH 7/11 ep93xx: Make syscon access functions private to SoC
Quoted 13 lines · H Hartley Sweeten
Quoted 6 lines · Ryan Mallon
The syscon access functions are no longer used outside of the core EP93xx code. Move their definitions into the SoC code.
Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Signed-off-by Ryan Mallon <[email protected]>Quoted 6 lines
--- arch/arm/mach-ep93xx/clock.c | 1 + arch/arm/mach-ep93xx/core.c | 2 -- arch/arm/mach-ep93xx/include/mach/platform.h | 14 -------------- arch/arm/mach-ep93xx/soc.h | 14 ++++++++++++++ 4 files changed, 15 insertions(+), 16 deletions(-)
Quoted 1 line
It looks like part of this patch is word wrapped, or it could just be me...
Odd, not sure what happened there. The code I have looks correct, and it was sent using git format-patch/send-email.
Quoted 27 lines
<snip>
Quoted 13 lines
arch/arm/mach-ep93xx/soc.h +6
-0@@ -13,6 +13,20 @@#ifndef _EP93XX_SOC_H#define _EP93XX_SOC_H +/* EP93xx System Controller software locked register write */ void +ep93xx_syscon_swlocked_write (unsigned int val,void __iomem *reg);void +ep93xx_devcfg_set_clear (unsigned int set_bits,unsigned int +clear_bits); + +static inline void ep93xx_devcfg_set_bits (unsigned int bits) {arch/arm/mach-ep93xx/soc.h line 31
Quoted 10 lines
arch/arm/mach-ep93xx/soc.h +7
-0+ep93xx_devcfg_set_clear (bits,0x00 ); +} + +static inline void ep93xx_devcfg_clear_bits (unsigned int bits) { +ep93xx_devcfg_set_clear (0x00 , bits); +} +/* * EP93xx Physical Memory Map: * I would prefer these functions to be after all the #define's. But, your call...
Quoted 2 lines
I'll move them.
Thanks,
~Ryan
PATCH 8/11 ep93xx: Move EP93XX_WATCHDOG_BASE define to driver
In reply to Ryan MallonThe EP93xx watchdog driver is the only user of this define, move it there.
--- arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 2 -- drivers/watchdog/ep93xx_wdt.c | 1 + 2 files changed, 1 insertions(+), 2 deletions(-)
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +0 -2
@@ -127,7 +127,5 @@#define EP93XX_SYSCON_SYSCFG_LCSN1 (1<<0)#define EP93XX_SYSCON_SWLOCK EP93XX_SYSCON_REG(0xc0) -#define EP93XX_WATCHDOG_BASE EP93XX_APB_IOMEM(0x00140000) -#endif
drivers/watchdog/ep93xx_wdt.c +1 -0
@@ -49,6 +49,7 @@ static unsigned long boot_status;#define WDT_IN_USE 0#define WDT_OK_TO_CLOSE 1 +#define EP93XX_WATCHDOG_BASE EP93XX_APB_IOMEM(0x00140000)#define EP93XX_WDT_REG (x) (EP93XX_WATCHDOG_BASE + (x))#define EP93XX_WDT_WATCHDOG EP93XX_WDT_REG(0x00)#define EP93XX_WDT_WDSTATUS EP93XX_WDT_REG(0x04)
Signature · 1 line
1.7.0.4
PATCH 8/11 ep93xx: Move EP93XX_WATCHDOG_BASE define to driver
Quoted 28 lines · Ryan Mallon
The EP93xx watchdog driver is the only user of this define, move it there.
Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Cc Wim Van Sebroeck <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 2 -- drivers/watchdog/ep93xx_wdt.c | 1 + 2 files changed, 1 insertions(+), 2 deletions(-)arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +0
-2@@ -127,7 +127,5 @@#define EP93XX_SYSCON_SYSCFG_LCSN1 (1<<0)#define EP93XX_SYSCON_SWLOCK EP93XX_SYSCON_REG(0xc0) -#define EP93XX_WATCHDOG_BASE EP93XX_APB_IOMEM(0x00140000) -#endif
drivers/watchdog/ep93xx_wdt.c static unsigned long boot_status; · line 55
Quoted 7 lines
drivers/watchdog/ep93xx_wdt.c +1
-0@@ -49,6 +49,7 @@ static unsigned long boot_status;#define WDT_IN_USE 0#define WDT_OK_TO_CLOSE 1 +#define EP93XX_WATCHDOG_BASE EP93XX_APB_IOMEM(0x00140000)#define EP93XX_WDT_REG (x) (EP93XX_WATCHDOG_BASE + (x))#define EP93XX_WDT_WATCHDOG EP93XX_WDT_REG(0x00)#define EP93XX_WDT_WDSTATUS EP93XX_WDT_REG(0x04)
Ryan,
I have a patch to convert the watchdog driver to a platform device and use the WatchDog Timer Driver Core. This patch will end up moving the base define to soc.h instead. But, for now, this looks good.
PATCH 8/11 ep93xx: Move EP93XX_WATCHDOG_BASE define to driver
Quoted 37 lines · H Hartley Sweeten
Quoted 27 lines · Ryan Mallon
The EP93xx watchdog driver is the only user of this define, move it there.
Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Cc Wim Van Sebroeck <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 2 -- drivers/watchdog/ep93xx_wdt.c | 1 + 2 files changed, 1 insertions(+), 2 deletions(-)arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +0
-2@@ -127,7 +127,5 @@#define EP93XX_SYSCON_SYSCFG_LCSN1 (1<<0)#define EP93XX_SYSCON_SWLOCK EP93XX_SYSCON_REG(0xc0) -#define EP93XX_WATCHDOG_BASE EP93XX_APB_IOMEM(0x00140000) -#endif drivers/watchdog/ep93xx_wdt.c static unsigned long boot_status; · line 55
Quoted 7 lines
drivers/watchdog/ep93xx_wdt.c +1
-0@@ -49,6 +49,7 @@ static unsigned long boot_status;#define WDT_IN_USE 0#define WDT_OK_TO_CLOSE 1 +#define EP93XX_WATCHDOG_BASE EP93XX_APB_IOMEM(0x00140000)#define EP93XX_WDT_REG (x) (EP93XX_WATCHDOG_BASE + (x))#define EP93XX_WDT_WATCHDOG EP93XX_WDT_REG(0x00)#define EP93XX_WDT_WDSTATUS EP93XX_WDT_REG(0x04)Ryan,
Quoted 3 lines
I have a patch to convert the watchdog driver to a platform device and use the WatchDog Timer Driver Core. This patch will end up moving the base define to
soc.hinstead. But, for now, this looks good.
Is your patch ready to go? I'm in no rush to get these patches in, and I can add it to this series if you like, which would get rid of the need for this patch and would also mean that we don't need the include of <mach/ep93xx-regs.h> in the watchdog driver in the final patch.
Thanks,
~Ryan
PATCH 8/11 ep93xx: Move EP93XX_WATCHDOG_BASE define to driver
Quoted 9 lines · Ryan Mallon
Quoted 3 lines · H Hartley Sweeten
I have a patch to convert the watchdog driver to a platform device and use the WatchDog Timer Driver Core. This patch will end up moving the base define to
soc.hinstead. But, for now, this looks good.Is your patch ready to go? I'm in no rush to get these patches in, and I can add it to this series if you like, which would get rid of the need for this patch and would also mean that we don't need the include of <
mach/ep93xx-regs.h> in the watchdog driver in the final patch.
Right now I just have the WatchDog Timer Driver Core conversion done. But, it needs to be retested against the current mainline.
Converting the driver into a platform device is trivial after that.
Let's go with what you have for right now. If/when It hits linux-next I'll rebase my patch against that.
Regards,
Hartley
PATCH 9/11 ep93xx: Move crunch code to mach-ep93xx directory
In reply to Ryan MallonThe crunch code in arch/arm/kernel is specific to the EP93xx. Move it to the mach-ep93xx directory. This removes the need for the EP93XX_SYSCON defines to be exported to arch/arm/kernel.
---
arch/arm/kernel/Makefile | 3 ---
arch/arm/mach-ep93xx/Makefile | 3 +++
arch/arm/{kernel => mach-ep93xx}/crunch-bits.S | 0
arch/arm/{kernel => mach-ep93xx}/crunch.c | 2 ++
4 files changed, 5 insertions(+), 3 deletions(-)
rename arch/arm/{kernel => mach-ep93xx}/crunch-bits.S (100%)
rename arch/arm/{kernel => mach-ep93xx}/crunch.c (99%)arch/arm/kernel/Makefile +0 -3
@@ -62,9 +62,6 @@ obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o CFLAGS_swp_emulate.o := -Wa,-march=armv7-a obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o -obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o -AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 - obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
arch/arm/mach-ep93xx/Makefile +3 -0
@@ -8,6 +8,9 @@ obj- := obj-$(CONFIG_EP93XX_DMA) += dma.o +obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o +AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 + obj-$(CONFIG_MACH_ADSSPHERE) += adssphere.o obj-$(CONFIG_MACH_EDB93XX) += edb93xx.o obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o
arch/arm/mach-ep93xx/crunch-bits.S renamed from arch/arm/kernel/crunch-bits.S +0 -0
arch/arm/mach-ep93xx/crunch.c renamed from arch/arm/kernel/crunch.c +2 -0
@@ -19,6 +19,8 @@#include <mach/ep93xx-regs.h> #include <asm/thread_notify.h> +#include "soc.h" +struct crunch_state *crunch_owner;void crunch_task_release (struct thread_info *thread)
Signature · 1 line
1.7.0.4
PATCH 9/11 ep93xx: Move crunch code to mach-ep93xx directory
Quoted 33 lines · Ryan Mallon
The crunch code in
arch/arm/kernelis specific to the EP93xx. Move it to the mach-ep93xx directory. This removes the need for theEP93XX_SYSCONdefines to be exported toarch/arm/kernel.Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Cc Russell King <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/kernel/Makefile | 3 --- arch/arm/mach-ep93xx/Makefile | 3 +++ arch/arm/{kernel => mach-ep93xx}/crunch-bits.S | 0 arch/arm/{kernel => mach-ep93xx}/crunch.c | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) rename arch/arm/{kernel => mach-ep93xx}/crunch-bits.S (100%) rename arch/arm/{kernel => mach-ep93xx}/crunch.c (99%)arch/arm/kernel/Makefile +0
-3@@ -62,9 +62,6 @@ obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o CFLAGS_swp_emulate.o := -Wa,-march=armv7-a obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o -obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o -AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 - obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o
arch/arm/mach-ep93xx/Makefile obj- := · line 13
Quoted 6 lines
arch/arm/mach-ep93xx/Makefile +3
-0@@ -8,6 +8,9 @@ obj- := obj-$(CONFIG_EP93XX_DMA) += dma.o +obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o +AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 +
Nitpick... Care to align the core stuff above this while you are touching this file?
Also, does the compile order matter here? Should the crunch stuff come before the dma driver?
Quoted 10 lines
arch/arm/mach-ep93xx/Makefile +0
-0obj-$(CONFIG_MACH_ADSSPHERE) += adssphere.o obj-$(CONFIG_MACH_EDB93XX) += edb93xx.o obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.oarch/arm/mach-ep93xx/crunch-bits.S renamed from arch/arm/kernel/crunch-bits.S rename to arch/arm/mach-ep93xx/crunch-bits.S +0
-0
arch/arm/mach-ep93xx/crunch.c line 26
Quoted 8 lines
arch/arm/mach-ep93xx/crunch.c renamed from arch/arm/kernel/crunch.c +2
-0@@ -19,6 +19,8 @@#include <mach/ep93xx-regs.h> #include <asm/thread_notify.h> +#include "soc.h" +struct crunch_state *crunch_owner;void crunch_task_release (struct thread_info *thread)
While you are moving this, is there anything you can do about the sparse warning regarding the crunch_owner variable?
Regardless, looks good.
PATCH 9/11 ep93xx: Move crunch code to mach-ep93xx directory
Quoted 36 lines · H Hartley Sweeten
Quoted 35 lines · Ryan Mallon
The crunch code in
arch/arm/kernelis specific to the EP93xx. Move it to the mach-ep93xx directory. This removes the need for theEP93XX_SYSCONdefines to be exported toarch/arm/kernel.Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Cc Russell King <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/kernel/Makefile | 3 --- arch/arm/mach-ep93xx/Makefile | 3 +++ arch/arm/{kernel => mach-ep93xx}/crunch-bits.S | 0 arch/arm/{kernel => mach-ep93xx}/crunch.c | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) rename arch/arm/{kernel => mach-ep93xx}/crunch-bits.S (100%) rename arch/arm/{kernel => mach-ep93xx}/crunch.c (99%)arch/arm/kernel/Makefile +0
-3@@ -62,9 +62,6 @@ obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o CFLAGS_swp_emulate.o := -Wa,-march=armv7-a obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o -obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o -AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 - obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.oarch/arm/mach-ep93xx/Makefile +0
-0@@ -8,6 +8,9 @@ obj- := obj-$(CONFIG_EP93XX_DMA) += dma.o
Quoted 7 lines
arch/arm/mach-ep93xx/Makefile obj- := · line 13
Quoted 3 lines
arch/arm/mach-ep93xx/Makefile +3
-0+obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o +AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 +Nitpick... Care to align the core stuff above this while you are touching this file?
Also, does the compile order matter here? Should the crunch stuff come before the dma driver?
I was hoping that Russell would make some comment here about whether moving this file out of arch/arm/kernel is okay to do. I assume it had some reason to be there in the first place. I have only done build testing so far since I don't have any ep93xx hardware to test on, and have never actually used crunch anyway.
I don't want to make unnecessary changes in this patch. I think the include of "soc.h" should actually get moved to the next patch also, so that this patch becomes a straight out move.
Quoted 13 lines
Quoted 13 lines
arch/arm/mach-ep93xx/Makefile +0
-0obj-$(CONFIG_MACH_ADSSPHERE) += adssphere.o obj-$(CONFIG_MACH_EDB93XX) += edb93xx.o obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.oarch/arm/mach-ep93xx/crunch-bits.S renamed from arch/arm/kernel/crunch-bits.S rename to arch/arm/mach-ep93xx/crunch-bits.S +0
-0arch/arm/mach-ep93xx/crunch.c renamed from arch/arm/kernel/crunch.c +0
-0@@ -19,6 +19,8 @@#include <mach/ep93xx-regs.h> #include <asm/thread_notify.h>
Quoted 8 lines
arch/arm/mach-ep93xx/crunch.c line 26
Quoted 5 lines
arch/arm/mach-ep93xx/crunch.c renamed from arch/arm/kernel/crunch.c +2
-0+#include "soc.h" +struct crunch_state *crunch_owner;void crunch_task_release (struct thread_info *thread)While you are moving this, is there anything you can do about the sparse warning regarding the
crunch_ownervariable?
What is the warning?
Quoted 4 lines
Regardless, looks good.
Thanks,
~Ryan
PATCH 9/11 ep93xx: Move crunch code to mach-ep93xx directory
Quoted 2 lines · Ryan Mallon
I was hoping that Russell would make some comment here about whether moving this file out of
arch/arm/kernelis okay to do.
I have no objection to SoC specific code moving out of arch-generic areas into SoC specific areas - provided it doesn't cause any abonimations!
Quoted 4 lines
I assume it had
some reason to be there in the first place. I have only done build testing so far since I don't have any ep93xx hardware to test on, and have never actually used crunch anyway.
I suspect it was there because the iwmmxt stuff was also in that directory, and at the time we didn't have the notifier in place to be able to properly broadcast events that ISA extensions needed to react to context switching etc.
Now that we do have all that in place, I don't think there's much reason it lives in arch/arm/kernel.
PATCH 10/11 ep93xx: Move EP93XX_SYSCON defines to SoC private header
In reply to Ryan MallonThe EP93XX_SYSCON defines are now no longer needed outside of the EP93xx SoC core code, so they can be moved to a private header.
--- arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 90 ----------------------- arch/arm/mach-ep93xx/soc.h | 90 +++++++++++++++++++++++ 2 files changed, 90 insertions(+), 90 deletions(-)
arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h +0 -90
@@ -38,94 +38,4 @@#define EP93XX_UART3_PHYS_BASE EP93XX_APB_PHYS(0x000e0000)#define EP93XX_UART3_BASE EP93XX_APB_IOMEM(0x000e0000) -#define EP93XX_SYSCON_BASE EP93XX_APB_IOMEM(0x00130000) -#define EP93XX_SYSCON_REG (x) (EP93XX_SYSCON_BASE + (x)) -#define EP93XX_SYSCON_POWER_STATE EP93XX_SYSCON_REG(0x00) -#define EP93XX_SYSCON_PWRCNT EP93XX_SYSCON_REG(0x04) -#define EP93XX_SYSCON_PWRCNT_FIR_EN (1<<31) -#define EP93XX_SYSCON_PWRCNT_UARTBAUD (1<<29) -#define EP93XX_SYSCON_PWRCNT_USH_EN (1<<28) -#define EP93XX_SYSCON_PWRCNT_DMA_M2M1 (1<<27) -#define EP93XX_SYSCON_PWRCNT_DMA_M2M0 (1<<26) -#define EP93XX_SYSCON_PWRCNT_DMA_M2P8 (1<<25) -#define EP93XX_SYSCON_PWRCNT_DMA_M2P9 (1<<24) -#define EP93XX_SYSCON_PWRCNT_DMA_M2P6 (1<<23) -#define EP93XX_SYSCON_PWRCNT_DMA_M2P7 (1<<22) -#define EP93XX_SYSCON_PWRCNT_DMA_M2P4 (1<<21) -#define EP93XX_SYSCON_PWRCNT_DMA_M2P5 (1<<20) -#define EP93XX_SYSCON_PWRCNT_DMA_M2P2 (1<<19) -#define EP93XX_SYSCON_PWRCNT_DMA_M2P3 (1<<18) -#define EP93XX_SYSCON_PWRCNT_DMA_M2P0 (1<<17) -#define EP93XX_SYSCON_PWRCNT_DMA_M2P1 (1<<16) -#define EP93XX_SYSCON_HALT EP93XX_SYSCON_REG(0x08) -#define EP93XX_SYSCON_STANDBY EP93XX_SYSCON_REG(0x0c) -#define EP93XX_SYSCON_CLKSET1 EP93XX_SYSCON_REG(0x20) -#define EP93XX_SYSCON_CLKSET1_NBYP1 (1<<23) -#define EP93XX_SYSCON_CLKSET2 EP93XX_SYSCON_REG(0x24) -#define EP93XX_SYSCON_CLKSET2_NBYP2 (1<<19) -#define EP93XX_SYSCON_CLKSET2_PLL2_EN (1<<18) -#define EP93XX_SYSCON_DEVCFG EP93XX_SYSCON_REG(0x80) -#define EP93XX_SYSCON_DEVCFG_SWRST (1<<31) -#define EP93XX_SYSCON_DEVCFG_D1ONG (1<<30) -#define EP93XX_SYSCON_DEVCFG_D0ONG (1<<29) -#define EP93XX_SYSCON_DEVCFG_IONU2 (1<<28) -#define EP93XX_SYSCON_DEVCFG_GONK (1<<27) -#define EP93XX_SYSCON_DEVCFG_TONG (1<<26) -#define EP93XX_SYSCON_DEVCFG_MONG (1<<25) -#define EP93XX_SYSCON_DEVCFG_U3EN (1<<24) -#define EP93XX_SYSCON_DEVCFG_CPENA (1<<23) -#define EP93XX_SYSCON_DEVCFG_A2ONG (1<<22) -#define EP93XX_SYSCON_DEVCFG_A1ONG (1<<21) -#define EP93XX_SYSCON_DEVCFG_U2EN (1<<20) -#define EP93XX_SYSCON_DEVCFG_EXVC (1<<19) -#define EP93XX_SYSCON_DEVCFG_U1EN (1<<18) -#define EP93XX_SYSCON_DEVCFG_TIN (1<<17) -#define EP93XX_SYSCON_DEVCFG_HC3IN (1<<15) -#define EP93XX_SYSCON_DEVCFG_HC3EN (1<<14) -#define EP93XX_SYSCON_DEVCFG_HC1IN (1<<13) -#define EP93XX_SYSCON_DEVCFG_HC1EN (1<<12) -#define EP93XX_SYSCON_DEVCFG_HONIDE (1<<11) -#define EP93XX_SYSCON_DEVCFG_GONIDE (1<<10) -#define EP93XX_SYSCON_DEVCFG_PONG (1<<9) -#define EP93XX_SYSCON_DEVCFG_EONIDE (1<<8) -#define EP93XX_SYSCON_DEVCFG_I2SONSSP (1<<7) -#define EP93XX_SYSCON_DEVCFG_I2SONAC97 (1<<6) -#define EP93XX_SYSCON_DEVCFG_RASONP3 (1<<4) -#define EP93XX_SYSCON_DEVCFG_RAS (1<<3) -#define EP93XX_SYSCON_DEVCFG_ADCPD (1<<2) -#define EP93XX_SYSCON_DEVCFG_KEYS (1<<1) -#define EP93XX_SYSCON_DEVCFG_SHENA (1<<0) -#define EP93XX_SYSCON_VIDCLKDIV EP93XX_SYSCON_REG(0x84) -#define EP93XX_SYSCON_CLKDIV_ENABLE (1<<15) -#define EP93XX_SYSCON_CLKDIV_ESEL (1<<14) -#define EP93XX_SYSCON_CLKDIV_PSEL (1<<13) -#define EP93XX_SYSCON_CLKDIV_PDIV_SHIFT 8 -#define EP93XX_SYSCON_I2SCLKDIV EP93XX_SYSCON_REG(0x8c) -#define EP93XX_SYSCON_I2SCLKDIV_SENA (1<<31) -#define EP93XX_SYSCON_I2SCLKDIV_ORIDE (1<<29) -#define EP93XX_SYSCON_I2SCLKDIV_SPOL (1<<19) -#define EP93XX_I2SCLKDIV_SDIV (1 << 16) -#define EP93XX_I2SCLKDIV_LRDIV32 (0 << 17) -#define EP93XX_I2SCLKDIV_LRDIV64 (1 << 17) -#define EP93XX_I2SCLKDIV_LRDIV128 (2 << 17) -#define EP93XX_I2SCLKDIV_LRDIV_MASK (3 << 17) -#define EP93XX_SYSCON_KEYTCHCLKDIV EP93XX_SYSCON_REG(0x90) -#define EP93XX_SYSCON_KEYTCHCLKDIV_TSEN (1<<31) -#define EP93XX_SYSCON_KEYTCHCLKDIV_ADIV (1<<16) -#define EP93XX_SYSCON_KEYTCHCLKDIV_KEN (1<<15) -#define EP93XX_SYSCON_KEYTCHCLKDIV_KDIV (1<<0) -#define EP93XX_SYSCON_SYSCFG EP93XX_SYSCON_REG(0x9c) -#define EP93XX_SYSCON_SYSCFG_REV_MASK (0xf0000000) -#define EP93XX_SYSCON_SYSCFG_REV_SHIFT (28) -#define EP93XX_SYSCON_SYSCFG_SBOOT (1<<8) -#define EP93XX_SYSCON_SYSCFG_LCSN7 (1<<7) -#define EP93XX_SYSCON_SYSCFG_LCSN6 (1<<6) -#define EP93XX_SYSCON_SYSCFG_LASDO (1<<5) -#define EP93XX_SYSCON_SYSCFG_LEEDA (1<<4) -#define EP93XX_SYSCON_SYSCFG_LEECLK (1<<3) -#define EP93XX_SYSCON_SYSCFG_LCSN2 (1<<1) -#define EP93XX_SYSCON_SYSCFG_LCSN1 (1<<0) -#define EP93XX_SYSCON_SWLOCK EP93XX_SYSCON_REG(0xc0) - -#endif
arch/arm/mach-ep93xx/soc.h +90 -0
94 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 10/11 ep93xx: Move EP93XX_SYSCON defines to SoC private header
Quoted 11 lines · Ryan Mallon
The
EP93XX_SYSCONdefines are now no longer needed outside of the EP93xx SoC core code, so they can be moved to a private header.Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Signed-off-by Ryan Mallon <[email protected]>--- arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 90 ----------------------- arch/arm/mach-ep93xx/soc.h | 90 +++++++++++++++++++++++ 2 files changed, 90 insertions(+), 90 deletions(-)
Looks good.
PATCH 11/11 ep93xx: Remove unnecessary includes of ep93xx-regs.h
In reply to Ryan MallonRemove the include of ep93xx-regs.h from files which no longer need it, notably include/mach/hardware.h. An explict include of ep93xx-regs.h is needed in the EP93xx watchdog driver for the EP93XX_APB_IOMEM macro.
--- arch/arm/mach-ep93xx/crunch.c | 2 +- arch/arm/mach-ep93xx/include/mach/hardware.h | 1 - arch/arm/mach-ep93xx/soc.h | 2 ++ drivers/watchdog/ep93xx_wdt.c | 1 + 4 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-ep93xx/crunch.c +1 -1
@@ -16,7 +16,7 @@#include <linux/sched.h> #include <linux/init.h> #include <linux/io.h> -#include <mach/ep93xx-regs.h> +#include <asm/thread_notify.h> #include "soc.h"
arch/arm/mach-ep93xx/include/mach/hardware.h +0 -1
@@ -5,7 +5,6 @@#ifndef __ASM_ARCH_HARDWARE_H#define __ASM_ARCH_HARDWARE_H -#include <mach/ep93xx-regs.h> #include <mach/platform.h> /*
arch/arm/mach-ep93xx/soc.h +2 -0
@@ -13,6 +13,8 @@#ifndef _EP93XX_SOC_H#define _EP93XX_SOC_H +#include <mach/ep93xx-regs.h> +/* EP93xx System Controller software locked register write */ void ep93xx_syscon_swlocked_write (unsigned int val,void __iomem *reg);void ep93xx_devcfg_set_clear (unsigned int set_bits,unsigned int clear_bits);
drivers/watchdog/ep93xx_wdt.c +1 -0
@@ -31,6 +31,7 @@#include <linux/uaccess.h> #include <linux/io.h> #include <mach/hardware.h> +#include <mach/ep93xx-regs.h> #define WDT_VERSION "0.3"#define PFX "ep93xx_wdt: "
Signature · 1 line
1.7.0.4
PATCH 11/11 ep93xx: Remove unnecessary includes of ep93xx-regs.h
Quoted 8 lines · Ryan Mallon
Remove the include of
ep93xx-regs.hfrom files which no longer need it, notablyinclude/mach/hardware.h. An explict include ofep93xx-regs.h
is needed in the EP93xx watchdog driver for theEP93XX_APB_IOMEMmacro.Cc Hartley Sweeten <[email protected]>Cc Mika Westerberg <[email protected]>Signed-off-by Ryan Mallon <[email protected]>
Quoted 6 lines
--- arch/arm/mach-ep93xx/crunch.c | 2 +- arch/arm/mach-ep93xx/include/mach/hardware.h | 1 - arch/arm/mach-ep93xx/soc.h | 2 ++ drivers/watchdog/ep93xx_wdt.c | 1 + 4 files changed, 4 insertions(+), 2 deletions(-)
My patch to convert the watchdog driver to a platform device using the WatchDog Timer Core will also remove the need to include ep93xx-regs.h.
But for now this looks good.
cover ep93xx: Move SoC private bits to core
In reply to Ryan MallonQuoted 3 lines · Ryan Mallon
This patch series is an effort to move the ep93xx SoC specific code out of drivers and
include/machintoarch/arm/mach-ep93xx. This work involves the following changes:
So, I stupidly managed to make this patch series against some old, irrelevant kernel version. I have rebased the patches on top of -next (avaiable on the ep93xx-private-soc branch
git at github.com:RyanMallon/linux-2.6.git, hopefully I got that right, it's my first attempt at doing a public git tree).
The rebase went cleanly, except for patch 5 being dropped since the ARM reset rework already made that change. Since the patches should be largely unchanged, I'll wait for an initial round of comments before posting the new versions.
Apologies for the mistake,
~Ryan
Quoted 53 lines
- Create a new private header called
soc.hto replace most ofmach/include/ep93xx-regs.h
- Move the Maverick crunch code fromarch/arm/kernelto mach-ep93xx
- Move all system controller access to the ep93xx core codeThere are a small handful of defines left in
ep93xx-regs.hwhich are used by both the ep93xx core andinclude/machfiles (uncompress.h,debug-macro.S, etc).Ryan Mallon (11):
ep93xx: MovePHYS_BASEdefines to local SoC header file
ep93xx: Move GPIO defines togpio-ep93xx.h
ep93xx: Move peripheral defines to local SoC header
ep93xx: Configure GPIO ports in core code
ep93xx: Movearch_resettocore.c
ep93xx: Don't use system controller defines in audio drivers
ep93xx: Make syscon access functions private to SoC
ep93xx: MoveEP93XX_WATCHDOG_BASEdefine to driver
ep93xx: Move crunch code to mach-ep93xx directory
ep93xx: MoveEP93XX_SYSCONdefines to SoC private header
ep93xx: Remove unnecessary includes ofep93xx-regs.harch/arm/kernel/Makefile | 3 - arch/arm/mach-ep93xx/Makefile | 3 + arch/arm/mach-ep93xx/adssphere.c | 1 + arch/arm/mach-ep93xx/clock.c | 1 + arch/arm/mach-ep93xx/core.c | 47 ++++-- arch/arm/{kernel => mach-ep93xx}/crunch-bits.S | 0 arch/arm/{kernel => mach-ep93xx}/crunch.c | 4 +- arch/arm/mach-ep93xx/dma.c | 2 + arch/arm/mach-ep93xx/edb93xx.c | 2 + arch/arm/mach-ep93xx/gesbc9312.c | 1 + arch/arm/mach-ep93xx/include/mach/ep93xx-regs.h | 191 +-------------------- arch/arm/mach-ep93xx/include/mach/gpio-ep93xx.h | 10 + arch/arm/mach-ep93xx/include/mach/hardware.h | 1 - arch/arm/mach-ep93xx/include/mach/platform.h | 16 +-- arch/arm/mach-ep93xx/include/mach/system.h | 14 +-- arch/arm/mach-ep93xx/micro9.c | 1 + arch/arm/mach-ep93xx/simone.c | 2 + arch/arm/mach-ep93xx/snappercl15.c | 2 + arch/arm/mach-ep93xx/soc.h | 210 +++++++++++++++++++++++ arch/arm/mach-ep93xx/ts72xx.c | 2 + arch/arm/mach-ep93xx/vision_ep9307.c | 2 + drivers/gpio/gpio-ep93xx.c | 7 - drivers/watchdog/ep93xx_wdt.c | 2 + sound/soc/ep93xx/edb93xx.c | 4 +- sound/soc/ep93xx/snappercl15.c | 4 +- 25 files changed, 279 insertions(+), 253 deletions(-) rename arch/arm/{kernel => mach-ep93xx}/crunch-bits.S (100%) rename arch/arm/{kernel => mach-ep93xx}/crunch.c (98%) create mode 100644 arch/arm/mach-ep93xx/soc.h
cover ep93xx: Move SoC private bits to core
In reply to Ryan MallonQuoted 4 lines · Ryan Mallon
This patch series is an effort to move the ep93xx SoC specific code out of drivers and
include/machintoarch/arm/mach-ep93xx. This work involves the following changes:
<snip>
Ryan,
I have reviewed all you patches and replied. They all look good except for a couple nitpicks that I pointed out.
Thanks for doing this.
Regards,
Hartley
cover ep93xx: Move SoC private bits to core
In reply to Ryan MallonQuoted 4 lines · Ryan Mallon
This patch series is an effort to move the ep93xx SoC specific code out of drivers and
include/machintoarch/arm/mach-ep93xx. This work involves the following changes:
Quoted 8 lines
- Create a new private header called
soc.hto replace most ofmach/include/ep93xx-regs.h
- Move the Maverick crunch code fromarch/arm/kernelto mach-ep93xx
- Move all system controller access to the ep93xx core codeThere are a small handful of defines left in
ep93xx-regs.hwhich are used by both the ep93xx core andinclude/machfiles (uncompress.h,debug-macro.S, etc).
Sorry for the delay. I went through the series and it looks good to me. You can add
for all the patches, if you like.
Thanks!
cover ep93xx: Move SoC private bits to core
Quoted 14 lines · Mika Westerberg
Quoted 4 lines · Ryan Mallon
This patch series is an effort to move the ep93xx SoC specific code out of drivers and
include/machintoarch/arm/mach-ep93xx. This work involves the following changes:Quoted 8 lines
- Create a new private header called
soc.hto replace most ofmach/include/ep93xx-regs.h
- Move the Maverick crunch code fromarch/arm/kernelto mach-ep93xx
- Move all system controller access to the ep93xx core codeThere are a small handful of defines left in
ep93xx-regs.hwhich are used by both the ep93xx core andinclude/machfiles (uncompress.h,debug-macro.S, etc).
Quoted 6 lines
Sorry for the delay. I went through the series and it looks good to me. You can add
Reviewed-by Mika Westerberg <[email protected]>for all the patches, if you like.
Thanks Mika. I'm going to do a repost later this week after address Hartley's review comments.
Thanks,
~Ryan