Add Samsung S5PC110 SoC support
Subsystems (3)
PATCH 1/1 Add Samsung S5PC110 SoC support
Hello,
This preliminary patch series adds support for Samsung S5PC110 SoC. S5PC110 belongs to S5PC1XX family (CortexA8 ARM core), but differs in many places from the S5PC100 SoC: new memory map, different clock hierarchy, new gpio banks and much more powerful integrated peripherals. Such differences cannot be easily handled in the current Samsung machine&platform framework. To avoid duplication of code and adding yet another plat-* directory, we decided to introduce sub-platforms in the current s5pc1xx platform.
First 8 patches prepare s5pc1xx platform code for introduction of the new sub-platform approach. Then in the next 11 patches all core functions and drivers are subsequently added, so S5PC110 sub-platform gets similar level of support as S5PC100.
This patch series has been prepared against latest ARM Kernel tree from
http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm.git/
I know that Ben is working hard on new Samsung SoC platform framework, but stabilizing it and porting all the existing Samsung platforms would take time. This sub-platform solution is already prepared and until the new framework will be available and merged, we would like to use our approach.
This patch series includes:
[PATCH 01/19] ARM: S5PC100: use 0x30008000 as memory base
[PATCH 02/19] ARM: S5PC1XX: create sub-platform for S5PC100 SoCs
[PATCH 03/19] ARM: S5PC1XX: prepare common cpu&clocks code for S5PC110 sub-platform [PATCH 04/19] ARM: S5PC1XX: prepare common gpiolib code for S5PC110 sub-platform [PATCH 05/19] ARM: S5PC1XX: move common s5pc1xx mach/* includes to plat-s5pc1xx/include/mach [PATCH 06/19] ARM: S5PC1XX: cleanup of s5pc1xx common code
[PATCH 07/19] ARM: S5PC1XX: move s5pc100 specific device helpers to mach-s5pc100 dir [PATCH 08/19] ARM: S5PC1XX: move common s5pc1xx s3c-fb regs to platform directory [PATCH 09/19] drivers: serial: add support for Samsung S5PC110 SoC uart [PATCH 10/19] ARM: S5PC1XX: add S5PC110 memory map
[PATCH 11/19] ARM: S5PC1XX: add S5PC110 cpu initialization code
[PATCH 12/19] ARM: S5PC1XX: add support for s5pc110 plls and clocks
[PATCH 13/19] ARM: S5PC1XX: add support for s5pc110 irqs
[PATCH 14/19] ARM: S5PC1XX: add support for s5pc110 gpio
[PATCH 15/19] ARM: S5PC1XX: add i2c platform helpers on s5pc110 sub-platform [PATCH 16/19] ARM: S5PC1XX: enable S5PC110 sub-platform
[PATCH 17/19] ARM: S5PC1XX: add sdhci platform helpers for s5pc110 sub-platform [PATCH 18/19] ARM: S5PC1XX: add framebuffer platform helpers for s5pc110 sub-platform [PATCH 19/19] ARM: S5PC1XX: add support for SMDKC110 board
PATCH 1/19 ARM: S5PC100: use 0x30008000 as memory base
From: Kyungmin Park <[email protected]>
We decided to use 0x3000'0000 as base memory address on S5PC1XX SoCs (s5pc100 and s5pc110).
A patch to u-boot that configures SMDKC100 board and sets base memory as 0x3000'0000 has been already posted.
--- arch/arm/mach-s5pc100/Makefile.boot | 4 ++-- arch/arm/mach-s5pc100/include/mach/map.h | 2 +- arch/arm/mach-s5pc100/include/mach/memory.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-s5pc100/Makefile.boot +2 -2
@@ -1,2 +1,2 @@ - zreladdr-y := 0x20008000 -params_phys-y := 0x20000100 + zreladdr-y := 0x30008000 +params_phys-y := 0x30000100
arch/arm/mach-s5pc100/include/mach/map.h +1 -1
@@ -113,7 +113,7 @@#define S5PC100_PA_TSADC (0xF3000000)/* ETC */ -#define S5PC100_PA_SDRAM (0x20000000) +#define S5PC100_PA_SDRAM (0x30000000)#define S5PC1XX_PA_SDRAM S5PC100_PA_SDRAM/* compatibility defines. */
arch/arm/mach-s5pc100/include/mach/memory.h +1 -1
@@ -13,6 +13,6 @@#ifndef __ASM_ARCH_MEMORY_H#define __ASM_ARCH_MEMORY_H -#define PHYS_OFFSET UL(0x20000000) +#define PHYS_OFFSET UL(0x30000000)#endif
Signature · 1 line
1.6.4
PATCH 2/19 ARM: S5PC1XX: create sub-platform for S5PC100 SoCs
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC100 and S5PC110 SoCs differs a lot in register map and other core platform definitions, so it is not possible to have both SoCs in the current platform framework without runtime hacks. To address this issue a sub-platform has been introduced, so each SoC in sub-platform can have its own set of include files (register map, irq&gpio definitions, etc)
--- arch/arm/Makefile | 2 +- arch/arm/mach-s5pc100/Kconfig | 4 ++++ arch/arm/plat-s5pc1xx/Kconfig | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletions(-)
arch/arm/Makefile +1 -1
@@ -160,7 +160,7 @@ machine-$(CONFIG_ARCH_RPC) := rpc machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c2443 machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0 machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410 -machine-$(CONFIG_ARCH_S5PC1XX) := s5pc100 +machine-$(CONFIG_ARCH_S5PC100) := s5pc100 machine-$(CONFIG_ARCH_SA1100) := sa1100 machine-$(CONFIG_ARCH_SHARK) := shark machine-$(CONFIG_ARCH_STMP378X) := stmp378x
arch/arm/mach-s5pc100/Kconfig +4 -0
@@ -5,6 +5,8 @@ # # Licensed under GPLv2 +if ARCH_S5PC100 + # Configuration options for the S5PC100 CPU config CPU_S5PC100
@@ -34,3 +36,5 @@ config MACH_SMDKC100 select S5PC100_SETUP_SDHCI help Machine support for the Samsung SMDKC100 + +endif
arch/arm/plat-s5pc1xx/Kconfig +10 -0
@@ -23,6 +23,16 @@ config PLAT_S5PC1XX if PLAT_S5PC1XX +choice + prompt "S5PC1xx SoC Type" + default ARCH_S5PC100 + +config ARCH_S5PC100 + bool "S5PC100" + +endchoice + + # Configuration options shared by all S3C64XX implementations config CPU_S5PC100_INIT
Signature · 1 line
1.6.4
PATCH 3/19 ARM: S5PC1XX: prepare common cpu&clocks code for S5PC110 sub-platform
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
CLK_OTHER register block is specific for S5PC100 SoC, so move the definition to mach-s5pc100/cpu.c. Size of CLK and PWR register block is different on S5PC100 and S5PC110, thus new defines are introduced.
Clock and pll hierarchy is completely different between S5PC100 and S5PC110 SoCs, so move related includes to new sub-platform and rename plat-s5pc1xx/clocks.c and plat-s5pc1xx/s5pc100-clock.c to s5pc100-clocks.c (periperal clocks definition) and s5pc100-plls.c (core pll hierarchy definition).
---
arch/arm/mach-s5pc100/cpu.c | 6 ++++++
arch/arm/mach-s5pc100/include/mach/map.h | 2 ++
.../include/plat/regs-clock.h | 2 +-
.../include/plat/regs-power.h | 2 +-
arch/arm/plat-s5pc1xx/Makefile | 3 +--
arch/arm/plat-s5pc1xx/cpu.c | 18 ++++++------------
.../arm/plat-s5pc1xx/{clock.c => s5pc100-clocks.c} | 4 ++--
.../{s5pc100-clock.c => s5pc100-plls.c} | 2 +-
8 files changed, 20 insertions(+), 19 deletions(-)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/include/plat/regs-clock.h (99%)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/include/plat/regs-power.h (98%)
rename arch/arm/plat-s5pc1xx/{clock.c => s5pc100-clocks.c} (99%)
rename arch/arm/plat-s5pc1xx/{s5pc100-clock.c => s5pc100-plls.c} (99%)arch/arm/mach-s5pc100/cpu.c +6 -0
@@ -46,6 +46,12 @@/* Initial IO mappings */ static struct map_desc s5pc100_iodesc[]__initdata = { + { + .virtual = (unsigned long )S5PC1XX_VA_CLK_OTHER , + .pfn =__phys_to_pfn (S5PC1XX_PA_CLK_OTHER ), + .length =SZ_4K , + .type =MT_DEVICE , + } };static void s5pc100_idle (void )
arch/arm/mach-s5pc100/include/mach/map.h +2 -0
@@ -46,6 +46,8 @@#define S5PC1XX_VA_CLK (S3C_VA_SYS + 0x10000)#define S5PC1XX_VA_PWR (S3C_VA_SYS + 0x20000)#define S5PC1XX_VA_CLK_OTHER (S3C_VA_SYS + 0x30000) +#define S5PC1XX_SZ_CLK SZ_4K +#define S5PC1XX_SZ_PWR SZ_4K/* GPIO */ #define S5PC100_PA_GPIO (0xE0300000)
arch/arm/mach-s5pc100/include/plat/regs-clock.h renamed from arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +1 -1
@@ -3,7 +3,7 @@* Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]> * -* S5PC1XX clock register definitions +* S5PC100 clock register definitions * * 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
arch/arm/mach-s5pc100/include/plat/regs-power.h renamed from arch/arm/plat-s5pc1xx/include/plat/regs-power.h +1 -1
@@ -3,7 +3,7 @@* Copyright 2009 Samsung Electronics Co. * Jongse Won <[email protected]> * -* S5PC1XX clock register definitions +* S5PC100 power controll register definitions * * 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
arch/arm/plat-s5pc1xx/Makefile +1 -2
@@ -14,13 +14,12 @@ obj- := obj-y += dev-uart.o obj-y += cpu.o obj-y += irq.o irq-gpio.o irq-eint.o -obj-y += clock.o obj-y += gpiolib.o # CPU support obj-$(CONFIG_CPU_S5PC100_INIT) += s5pc100-init.o -obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-clock.o +obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-plls.o s5pc100-clocks.o # Device setup
arch/arm/plat-s5pc1xx/cpu.c +6 -12
@@ -50,18 +50,11 @@ static struct cpu_table cpu_ids[] __initdata = { };/* minimal IO mapping */ -/* see notes on uart map in arch/arm/mach-s5pc100/include/mach/debug-macro.S */ -#define UART_OFFS (S3C_PA_UART & 0xffff)static struct map_desc s5pc1xx_iodesc[]__initdata = { { - .virtual = (unsigned long )S5PC1XX_VA_CLK_OTHER , - .pfn =__phys_to_pfn (S5PC1XX_PA_CLK_OTHER ), - .length =SZ_4K , - .type =MT_DEVICE , - }, { .virtual = (unsigned long )S5PC1XX_VA_GPIO , - .pfn =__phys_to_pfn (S5PC100_PA_GPIO ), + .pfn =__phys_to_pfn (S5PC1XX_PA_GPIO ), .length =SZ_4K , .type =MT_DEVICE , }, {
@@ -72,15 +65,15 @@ static struct map_desc s5pc1xx_iodesc[] __initdata = { }, { .virtual = (unsigned long)S5PC1XX_VA_CLK, .pfn = __phys_to_pfn(S5PC1XX_PA_CLK), - .length = SZ_4K, + .length = S5PC1XX_SZ_CLK, .type = MT_DEVICE, }, { .virtual = (unsigned long)S5PC1XX_VA_PWR, .pfn = __phys_to_pfn(S5PC1XX_PA_PWR), - .length = SZ_4K, + .length = S5PC1XX_SZ_PWR, .type = MT_DEVICE, }, { - .virtual = (unsigned long)(S5PC1XX_VA_UART), + .virtual = (unsigned long)S5PC1XX_VA_UART, .pfn = __phys_to_pfn(S5PC1XX_PA_UART), .length = SZ_4K, .type = MT_DEVICE,
@@ -115,8 +108,9 @@ void __init s5pc1xx_init_io(struct map_desc *mach_desc, int size)/* initialise the io descriptors we need for initialisation */ iotable_init (s5pc1xx_iodesc,ARRAY_SIZE (s5pc1xx_iodesc)); -iotable_init (mach_desc, size); idcode =__raw_readl (S5PC1XX_VA_CHIPID );s3c_init_cpu (idcode, cpu_ids,ARRAY_SIZE (cpu_ids)); + +iotable_init (mach_desc, size); }
arch/arm/plat-s5pc1xx/s5pc100-clocks.c renamed from arch/arm/plat-s5pc1xx/clock.c +2 -2
@@ -1,8 +1,8 @@ -/* linux/arch/arm/plat-s5pc1xx/clock.c +/* linux/arch/arm/plat-s5pc100/s5pc100-clocks.c * * Copyright 2009 Samsung Electronics Co. * -* S5PC1XX Base clock support +* S5PC100 - Clocks support * * Based on plat-s3c64xx/clock.c *
arch/arm/plat-s5pc1xx/s5pc100-plls.c renamed from arch/arm/plat-s5pc1xx/s5pc100-clock.c +1 -1
@@ -1,4 +1,4 @@ -/* linux/arch/arm/plat-s5pc1xx/s5pc100-clock.c +/* linux/arch/arm/plat-s5pc100/s5pc100-plls.c * * Copyright 2009 Samsung Electronics, Co. * Byungho Min <[email protected]>
Signature · 1 line
1.6.4
PATCH 4/19 ARM: S5PC1XX: prepare common gpiolib code for S5PC110 sub-platform
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
S5PC100 GPIO chip definitions has been hidden under sub-platform #ifdef CONFIG_CPU_S5PC100. Also a new S5PC1XX_GPHx() macros has been introduced to cover common external interrupt gpio lines (for common code).
---
arch/arm/mach-s5pc100/include/mach/gpio.h | 7 ++++++
.../include/plat/irqs.h | 2 +-
.../include/plat/regs-gpio.h | 2 +-
arch/arm/plat-s5pc1xx/gpiolib.c | 17 ++++++++++-----
arch/arm/plat-s5pc1xx/irq-eint.c | 13 +++++------
arch/arm/plat-s5pc1xx/irq-gpio.c | 22 ++++++++++++-------
6 files changed, 40 insertions(+), 23 deletions(-)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/include/plat/irqs.h (99%)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/include/plat/regs-gpio.h (98%)arch/arm/mach-s5pc100/include/mach/gpio.h +7 -0
@@ -159,4 +159,11 @@ enum s3c_gpio_number {/* define the number of gpios we need to the one after the MP04() range */ #define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1) +/* Common compatibility defines */ +#define S5PC1XX_GPIO_EINT_SFN S3C_GPIO_SFN(0x2) +#define S5PC1XX_GPH0 (n) S5PC100_GPH0(n) +#define S5PC1XX_GPH1 (n) S5PC100_GPH1(n) +#define S5PC1XX_GPH2 (n) S5PC100_GPH2(n) +#define S5PC1XX_GPH3 (n) S5PC100_GPH3(n) +#include <asm-generic/gpio.h>
arch/arm/mach-s5pc100/include/plat/irqs.h renamed from arch/arm/plat-s5pc1xx/include/plat/irqs.h +1 -1
@@ -3,7 +3,7 @@* Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]> * -* S5PC1XX - Common IRQ support +* S5PC100 - Common IRQ support * * Based on plat-s3c64xx/include/plat/irqs.h */
arch/arm/mach-s5pc100/include/plat/regs-gpio.h renamed from arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h +1 -1
@@ -3,7 +3,7 @@* Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]> * -* S5PC1XX - GPIO register definitions +* S5PC100 - GPIO register definitions */ #ifndef __ASM_PLAT_S5PC1XX_REGS_GPIO_H
arch/arm/plat-s5pc1xx/gpiolib.c +11 -6
@@ -138,18 +138,19 @@ static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset) {int base; - base = chip->base -S5PC100_GPH0 (0 ); + base = chip->base -S5PC1XX_GPH0 (0 );if (base ==0 )return IRQ_EINT (offset); - base = chip->base -S5PC100_GPH1 (0 ); + base = chip->base -S5PC1XX_GPH1 (0 );if (base ==0 )return IRQ_EINT (8 + offset); - base = chip->base -S5PC100_GPH2 (0 ); + base = chip->base -S5PC1XX_GPH2 (0 );if (base ==0 )return IRQ_EINT (16 + offset); - base = chip->base -S5PC100_GPH3 (0 ); + base = chip->base -S5PC1XX_GPH3 (0 );if (base ==0 )return IRQ_EINT (24 + offset); +return -EINVAL ; }
@@ -172,6 +173,7 @@ static struct s3c_gpio_cfg gpio_cfg_noint = { .get_pull = s3c_gpio_getpull_updown, }; +#ifdef CONFIG_CPU_S5PC100 static struct s3c_gpio_chip s5pc100_gpio_chips[] = { { .base = S5PC100_GPA0_BASE,
@@ -448,6 +450,9 @@ static struct s3c_gpio_chip s5pc100_gpio_chips[] = { }, }; +#define s5pc1xx_gpio_chips s5pc100_gpio_chips + +#endif /* FIXME move from irq-gpio.c */ extern struct irq_chip s5pc1xx_gpioint;extern void s5pc1xx_irq_gpioint_handler (unsigned int irq,struct irq_desc *desc);
@@ -491,8 +496,8 @@ static __init int s5pc1xx_gpiolib_init(void)struct s3c_gpio_chip *chips;int nr_chips; - chips = s5pc100_gpio_chips; - nr_chips =ARRAY_SIZE (s5pc100_gpio_chips); + chips = s5pc1xx_gpio_chips; + nr_chips =ARRAY_SIZE (s5pc1xx_gpio_chips);s5pc1xx_gpiolib_add (chips, nr_chips, s5pc1xx_gpiolib_link);/* Interrupt */
arch/arm/plat-s5pc1xx/irq-eint.c +6 -7
@@ -105,7 +105,7 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) {u32 bank =s3c_get_bank (irq);int real =s3c_get_eint (irq); -int gpio, shift, sfn; +int gpio, shift;u32 ctrl, con =0 ;switch (type) {
@@ -148,23 +148,22 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)switch (real) { case 0 ... 7: - gpio =S5PC100_GPH0 (gpio); + gpio =S5PC1XX_GPH0 (gpio);break ; case 8 ... 15: - gpio =S5PC100_GPH1 (gpio); + gpio =S5PC1XX_GPH1 (gpio);break ; case 16 ... 23: - gpio =S5PC100_GPH2 (gpio); + gpio =S5PC1XX_GPH2 (gpio);break ; case 24 ... 31: - gpio =S5PC100_GPH3 (gpio); + gpio =S5PC1XX_GPH3 (gpio);break ;default :return -EINVAL ; } - sfn =S3C_GPIO_SFN (0x2 ); -s3c_gpio_cfgpin (gpio, sfn); +s3c_gpio_cfgpin (gpio,S5PC1XX_GPIO_EINT_SFN );return 0 ; }
arch/arm/plat-s5pc1xx/irq-gpio.c +14 -8
@@ -49,7 +49,9 @@ static int group_to_pend_offset(int group)return group <<2 ; } -static int s5pc1xx_get_start (unsigned int group) +#ifdef CONFIG_CPU_S5PC100 + +static int s5pc100_get_start (unsigned int group) {switch (group) {case 0 :return S5PC100_GPIO_A0_START ;
@@ -76,11 +78,10 @@ static int s5pc1xx_get_start(unsigned int group)default :BUG (); } -return -EINVAL ; } -static int s5pc1xx_get_group (unsigned int irq) +static int s5pc100_get_group (unsigned int irq) { irq -=S3C_IRQ_GPIO (0 );
@@ -130,10 +131,17 @@ static int s5pc1xx_get_group(unsigned int irq)default : BUG(); } -return -EINVAL ; } +static int s5pc100_group_end =21 ; + +#define s5pc1xx_get_group s5pc100_get_group +#define s5pc1xx_get_start s5pc100_get_start +#define s5pc1xx_group_end s5pc100_group_end + +#endif +static int s5pc1xx_get_offset (unsigned int irq) {struct gpio_chip *chip =get_irq_data (irq);
@@ -241,12 +249,10 @@ struct irq_chip s5pc1xx_gpioint = {void s5pc1xx_irq_gpioint_handler (unsigned int irq,struct irq_desc *desc) {int group, offset, pend_offset, mask_offset; -int real_irq, group_end; +int real_irq;unsigned int pend, mask; - group_end =21 ; - -for (group =0 ; group < group_end; group++) { +for (group =0 ; group < s5pc1xx_group_end; group++) { pend_offset =group_to_pend_offset (group); pend =__raw_readl (S5PC1XX_GPIOREG (PEND_OFFSET ) + pend_offset);if (!pend)
Signature · 1 line
1.6.4
PATCH 5/19 ARM: S5PC1XX: move common s5pc1xx mach/* includes to plat-s5pc1xx/include/mach
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
All includes that are common for S5PC100 and S5PC110 are moved to plat-s5pc1xx/include/mach, so they can be used by both sub-platforms.
---
.../include/mach/gpio-core.h | 2 +-
.../include/mach/hardware.h | 2 +-
.../include/mach/irqs.h | 2 +-
.../include/mach/memory.h | 2 +-
.../include/mach/pwm-clock.h | 2 +-
.../include/mach/tick.h | 2 +-
.../include/mach/uncompress.h | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/gpio-core.h (91%)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/hardware.h (83%)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/irqs.h (87%)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/memory.h (89%)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/pwm-clock.h (96%)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/tick.h (93%)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/uncompress.h (92%)arch/arm/plat-s5pc1xx/include/mach/gpio-core.h renamed from arch/arm/mach-s5pc100/include/mach/gpio-core.h +1 -1
@@ -1,4 +1,4 @@ -/* arch/arm/mach-s5pc100/include/mach/gpio-core.h +/* arch/arm/plat-s5pc1xx/include/mach/gpio-core.h * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/include/mach/hardware.h renamed from arch/arm/mach-s5pc100/include/mach/hardware.h +1 -1
@@ -1,4 +1,4 @@ -/* linux/arch/arm/mach-s5pc100/include/mach/hardware.h +/* linux/arch/arm/plat-s5pc1xx/include/mach/hardware.h * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/include/mach/irqs.h renamed from arch/arm/mach-s5pc100/include/mach/irqs.h +1 -1
@@ -1,4 +1,4 @@ -/* linux/arch/arm/mach-s5pc100/include/mach/irqs.h +/* linux/arch/arm/plat-s5pc1xx/include/mach/irqs.h * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/include/mach/memory.h renamed from arch/arm/mach-s5pc100/include/mach/memory.h +1 -1
@@ -1,4 +1,4 @@ -/* arch/arm/mach-s5pc100/include/mach/memory.h +/* linux/arch/arm/plat-s5pc1xx/include/mach/memory.h * * Copyright 2008 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/include/mach/pwm-clock.h renamed from arch/arm/mach-s5pc100/include/mach/pwm-clock.h +1 -1
@@ -1,4 +1,4 @@ -/* linux/arch/arm/mach-s5pc100/include/mach/pwm-clock.h +/* linux/arch/arm/plat-s5pc1xx/include/mach/pwm-clock.h * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/include/mach/tick.h renamed from arch/arm/mach-s5pc100/include/mach/tick.h +1 -1
@@ -1,4 +1,4 @@ -/* linux/arch/arm/mach-s5pc100/include/mach/tick.h +/* linux/arch/arm/plat-s5pc1xx/include/mach/tick.h * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/include/mach/uncompress.h renamed from arch/arm/mach-s5pc100/include/mach/uncompress.h +1 -1
@@ -1,4 +1,4 @@ -/* arch/arm/mach-s5pc100/include/mach/uncompress.h +/* linux/arch/arm/plat-s5pc1xx/include/mach/uncompress.h * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
Signature · 1 line
1.6.4
PATCH 6/19 ARM: S5PC1XX: cleanup of s5pc1xx common code
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
This patch removes all useless definitions from plat/s5pc100.h and introduces new common plat/s5pc1xx.h include.
--- arch/arm/mach-s5pc100/cpu.c | 2 +- arch/arm/mach-s5pc100/include/plat/regs-clock.h | 8 ++-- arch/arm/mach-s5pc100/mach-smdkc100.c | 2 +- arch/arm/plat-s5pc1xx/cpu.c | 2 +- arch/arm/plat-s5pc1xx/include/plat/s5pc100.h | 51 ++++++----------------- arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h | 21 +++++++++ arch/arm/plat-s5pc1xx/s5pc100-init.c | 7 ++- arch/arm/plat-s5pc1xx/s5pc100-plls.c | 2 +- 8 files changed, 46 insertions(+), 49 deletions(-) create mode 100644 arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h
arch/arm/mach-s5pc100/cpu.c +1 -1
@@ -41,7 +41,7 @@#include <plat/clock.h> #include <plat/sdhci.h> #include <plat/iic-core.h> -#include <plat/s5pc100.h> +#include <plat/s5pc1xx.h> /* Initial IO mappings */
arch/arm/mach-s5pc100/include/plat/regs-clock.h +4 -4
@@ -341,10 +341,10 @@#define S5PC100_HDMI_PHY_CON0 S5PC100_CLKREG_OTHER(0x420)#define S5PC100_SWRESET_RESETVAL 0xc100 -#define S5PC100_OTHER_SYS_INT 24 -#define S5PC100_OTHER_STA_TYPE 23 -#define STA_TYPE_EXPON 0 -#define STA_TYPE_SFR 1 +#define S5PC100_OTHERS_PMU_INT_DISALBE (1 << 24) +#define S5PC100_OTHERS_STABLE_COUNTER_TYPE_MASK (1 << 23) +#define S5PC100_OTHERS_STABLE_COUNTER_TYPE_SFR (1 << 23) +#define S5PC100_OTHERS_STABLE_COUNTER_TYPE_EXP (0 << 23)#define S5PC100_SLEEP_CFG_OSC_EN 0
arch/arm/mach-s5pc100/mach-smdkc100.c +1 -1
@@ -40,7 +40,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> -#include <plat/s5pc100.h> +#include <plat/s5pc1xx.h> #include <plat/fb.h> #include <plat/iic.h>
arch/arm/plat-s5pc1xx/cpu.c +1 -1
@@ -31,7 +31,7 @@#include <plat/devs.h> #include <plat/clock.h> -#include <plat/s5pc100.h> +#include <plat/s5pc1xx.h> /* table of supported CPUs */
arch/arm/plat-s5pc1xx/include/plat/s5pc100.h +13 -38
65 lines not on this page · raw message
arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h new file +21 -0
@@ -0,0 +1,21 @@ +/* arch/arm/plat-s5pc1xx/include/plat/s5pc100.h +* +* Copyright 2009 Samsung Electronics Co. +* Marek Szyprowski <[email protected]> +* +* Header file for s5pc1xx cpu support +* +* 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. +*/ + +/* Common init code for S5PC1XX related SoCs */ + +extern void s5pc1xx_init_irq (u32 *vic_valid,int num); +extern void s5pc1xx_init_io (struct map_desc *mach_desc,int size); +extern void s5pc1xx_register_clocks (void ); + +extern struct s3c24xx_uart_resources s5pc1xx_uart_resources[]; + +#include <plat/s5pc100.h>
arch/arm/plat-s5pc1xx/s5pc100-init.c +4 -3
@@ -1,4 +1,4 @@ -/* linux/arch/arm/plat-s5pc1xx/s5pc100-init.c +/* linux/arch/arm/plat-s5pc100/s5pc100-init.c * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
@@ -13,14 +13,15 @@#include <linux/kernel.h> #include <linux/types.h> #include <linux/init.h> +#include <linux/clk.h> #include <plat/cpu.h> #include <plat/devs.h> -#include <plat/s5pc100.h> +#include <plat/s5pc1xx.h> /* uart registration process */ -void __init s5pc100_common_init_uarts (struct s3c2410_uartcfg *cfg,int no) +void __init s5pc100_init_uarts (struct s3c2410_uartcfg *cfg,int no) {/* The driver name is s3c6400-uart to reuse s3c6400_serial_drv */ s3c24xx_init_uartdevs ("s3c6400-uart" , s5pc1xx_uart_resources, cfg, no);
arch/arm/plat-s5pc1xx/s5pc100-plls.c +1 -1
@@ -32,7 +32,7 @@#include <plat/cpu.h> #include <plat/pll.h> #include <plat/devs.h> -#include <plat/s5pc100.h> +#include <plat/s5pc1xx.h> /* fin_apll, fin_mpll and fin_epll are all the same clock, which we call * ext_xtal_mux for want of an actual name from the manual.
Signature · 1 line
1.6.4
PATCH 7/19 ARM: S5PC1XX: move s5pc100 specific device helpers to mach-s5pc100 dir
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
All device helpers that are defined in plat-s5pc1xx are S5PC100 specific. This patch moves them to mach-s5pc100 directory to make use of newly created sub-platform support.
---
arch/arm/mach-s5pc100/Kconfig | 32 +++++++++++++++++--
arch/arm/mach-s5pc100/Makefile | 4 ++
.../setup-fb-24bpp.c | 0
.../{plat-s5pc1xx => mach-s5pc100}/setup-i2c0.c | 0
.../{plat-s5pc1xx => mach-s5pc100}/setup-i2c1.c | 0
.../setup-sdhci-gpio.c | 0
arch/arm/plat-s5pc1xx/Kconfig | 24 ---------------
arch/arm/plat-s5pc1xx/Makefile | 4 --
8 files changed, 32 insertions(+), 32 deletions(-)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-fb-24bpp.c (100%)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-i2c0.c (100%)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-i2c1.c (100%)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-sdhci-gpio.c (100%)arch/arm/mach-s5pc100/Kconfig +28 -4
@@ -16,12 +16,36 @@ config CPU_S5PC100 help Enable S5PC100 CPU support +config S5PC100_SETUP_FB_24BPP + bool + help + Common setup code for S5PC1XX with an 24bpp RGB display helper. + +config S5PC100_SETUP_I2C0 + bool + default y + help + Common setup code for i2c bus 0. + + Note, currently since i2c0 is always compiled, this setup helper + is always compiled with it. + +config S5PC100_SETUP_I2C1 + bool + help + Common setup code for i2c bus 1. + config S5PC100_SETUP_SDHCI bool - select S5PC1XX_SETUP_SDHCI_GPIO + select S5PC100_SETUP_SDHCI_GPIO help Internal helper functions for S5PC100 based SDHCI systems +config S5PC100_SETUP_SDHCI_GPIO + bool + help + Common setup code for SDHCI gpio. + config MACH_SMDKC100 bool "SMDKC100" select CPU_S5PC100
@@ -30,9 +54,9 @@ config MACH_SMDKC100 select S3C_DEV_HSMMC select S3C_DEV_HSMMC1 select S3C_DEV_HSMMC2 - select S5PC1XX_SETUP_I2C0 - select S5PC1XX_SETUP_I2C1 - select S5PC1XX_SETUP_FB_24BPP + select S5PC100_SETUP_I2C0 + select S5PC100_SETUP_I2C1 + select S5PC100_SETUP_FB_24BPP select S5PC100_SETUP_SDHCI help Machine support for the Samsung SMDKC100
arch/arm/mach-s5pc100/Makefile +4 -0
@@ -15,7 +15,11 @@ obj-$(CONFIG_CPU_S5PC100) += cpu.o # Helper and device support +obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o +obj-$(CONFIG_S5PC100_SETUP_I2C0) += setup-i2c0.o +obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o +obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o # machine support obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.o
arch/arm/mach-s5pc100/setup-fb-24bpp.c renamed from arch/arm/plat-s5pc1xx/setup-fb-24bpp.c +0 -0
arch/arm/mach-s5pc100/setup-i2c0.c renamed from arch/arm/plat-s5pc1xx/setup-i2c0.c +0 -0
arch/arm/mach-s5pc100/setup-i2c1.c renamed from arch/arm/plat-s5pc1xx/setup-i2c1.c +0 -0
arch/arm/mach-s5pc100/setup-sdhci-gpio.c renamed from arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c +0 -0
arch/arm/plat-s5pc1xx/Kconfig +0 -24
@@ -47,28 +47,4 @@ config CPU_S5PC100_CLOCK # platform specific device setup -config S5PC1XX_SETUP_FB_24BPP - bool - help - Common setup code for S5PC1XX with an 24bpp RGB display helper. - -config S5PC1XX_SETUP_I2C0 - bool - default y - help - Common setup code for i2c bus 0. - - Note, currently since i2c0 is always compiled, this setup helper - is always compiled with it. - -config S5PC1XX_SETUP_I2C1 - bool - help - Common setup code for i2c bus 1. - -config S5PC1XX_SETUP_SDHCI_GPIO - bool - help - Common setup code for SDHCI gpio. - endif
arch/arm/plat-s5pc1xx/Makefile +0 -4
@@ -24,7 +24,3 @@ obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-plls.o s5pc100-clocks.o # Device setup obj-$(CONFIG_S5P_GPIO_CFG_S5PC1XX) += gpio-config.o -obj-$(CONFIG_S5PC1XX_SETUP_FB_24BPP) += setup-fb-24bpp.o -obj-$(CONFIG_S5PC1XX_SETUP_I2C0) += setup-i2c0.o -obj-$(CONFIG_S5PC1XX_SETUP_I2C1) += setup-i2c1.o -obj-$(CONFIG_S5PC1XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
Signature · 1 line
1.6.4
PATCH 8/19 ARM: S5PC1XX: move common s5pc1xx s3c-fb regs to platform directory
In reply to Marek SzyprowskiFrom: Pawel Osciak <[email protected]>
From: Pawel Osciak <[email protected]>
Frame buffer register block on S5PC100 and S5PC110 differs slightly. This patch moves all register definitions that are common for S5PC100 and S5PC110 to plat-s3c/plat/regs-fb-v5.h.
--- arch/arm/mach-s5pc100/include/mach/regs-fb.h | 133 ++----------------------- arch/arm/plat-s3c/include/plat/regs-fb-v5.h | 138 ++++++++++++++++++++++++++ 2 files changed, 146 insertions(+), 125 deletions(-) create mode 100644 arch/arm/plat-s3c/include/plat/regs-fb-v5.h
arch/arm/mach-s5pc100/include/mach/regs-fb.h +8 -125
@@ -1,139 +1,22 @@ -/* arch/arm/mach-s5pc100/include/mach/regs-fb.h -* +/* * Copyright 2009 Samsung Electronics Co. * Pawel Osciak <[email protected]> * -* Framebuffer register definitions for Samsung S5PC100. +* Machine-specific framebuffer definitions for Samsung S5PC100. * * 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. -*/ - -#ifndef __ASM_ARCH_REGS_FB_H -#define __ASM_ARCH_REGS_FB_H __FILE__ - -#include <plat/regs-fb-v4.h> - -/* VP1 interface timing control */ -#define VP1CON0 (0x118) -#define VP1_RATECON_EN (1 << 31) -#define VP1_CLKRATE_MASK (0xff) - -#define VP1CON1 (0x11c) -#define VP1_VTREGCON_EN (1 << 31) -#define VP1_VBPD_MASK (0xfff) -#define VP1_VBPD_SHIFT (16) - - -#define WPALCON_H (0x19c) -#define WPALCON_L (0x1a0) - -/* Pallete contro for WPAL0 and WPAL1 is the same as in S3C64xx, but -* different for WPAL2-4 -*/ -/* In WPALCON_L (aka WPALCON) */ -#define WPALCON_W1PAL_32BPP_A888 (0x7 << 3) -#define WPALCON_W0PAL_32BPP_A888 (0x7 << 0) - -/* To set W2PAL-W4PAL consist of one bit from WPALCON_L and two from WPALCON_H, -* e.g. W2PAL[2..0] is made of (WPALCON_H[10..9], WPALCON_L[6]). -*/ -#define WPALCON_L_WxPAL_L_MASK (0x1) -#define WPALCON_L_W2PAL_L_SHIFT (6) -#define WPALCON_L_W3PAL_L_SHIFT (7) -#define WPALCON_L_W4PAL_L_SHIFT (8) - -#define WPALCON_L_WxPAL_H_MASK (0x3) -#define WPALCON_H_W2PAL_H_SHIFT (9) -#define WPALCON_H_W3PAL_H_SHIFT (13) -#define WPALCON_H_W4PAL_H_SHIFT (17) - -/* Per-window alpha value registers */ -/* For window 0 8-bit alpha values are in VIDW0ALPHAx, -* for windows 1-4 alpha values consist of two parts, the 4 low bits are -* taken from VIDWxALPHAx and 4 high bits are from VIDOSDxC, -* e.g. WIN1_ALPHA0_B[7..0] = (VIDOSD1C[3..0], VIDW1ALPHA0[3..0]) -*/ -#define VIDWxALPHA0 (_win) (0x200 + (_win * 8)) -#define VIDWxALPHA1 (_win) (0x204 + (_win * 8)) - -/* Only for window 0 in VIDW0ALPHAx. */ -#define VIDW0ALPHAx_R (_x) ((_x) << 16) -#define VIDW0ALPHAx_R_MASK (0xff << 16) -#define VIDW0ALPHAx_R_SHIFT (16) -#define VIDW0ALPHAx_G (_x) ((_x) << 8) -#define VIDW0ALPHAx_G_MASK (0xff << 8) -#define VIDW0ALPHAx_G_SHIFT (8) -#define VIDW0ALPHAx_B (_x) ((_x) << 0) -#define VIDW0ALPHAx_B_MASK (0xff << 0) -#define VIDW0ALPHAx_B_SHIFT (0) - -/* Low 4 bits of alpha0-1 for windows 1-4 */ -#define VIDW14ALPHAx_R_L (_x) ((_x) << 16) -#define VIDW14ALPHAx_R_L_MASK (0xf << 16) -#define VIDW14ALPHAx_R_L_SHIFT (16) -#define VIDW14ALPHAx_G_L (_x) ((_x) << 8) -#define VIDW14ALPHAx_G_L_MASK (0xf << 8) -#define VIDW14ALPHAx_G_L_SHIFT (8) -#define VIDW14ALPHAx_B_L (_x) ((_x) << 0) -#define VIDW14ALPHAx_B_L_MASK (0xf << 0) -#define VIDW14ALPHAx_B_L_SHIFT (0) - - -/* Per-window blending equation control registers */ -#define BLENDEQx (_win) (0x244 + ((_win) * 4)) -#define BLENDEQ1 (0x244) -#define BLENDEQ2 (0x248) -#define BLENDEQ3 (0x24c) -#define BLENDEQ4 (0x250) - -#define BLENDEQx_Q_FUNC (_x) ((_x) << 18) -#define BLENDEQx_Q_FUNC_MASK (0xf << 18) -#define BLENDEQx_P_FUNC (_x) ((_x) << 12) -#define BLENDEQx_P_FUNC_MASK (0xf << 12) -#define BLENDEQx_B_FUNC (_x) ((_x) << 6) -#define BLENDEQx_B_FUNC_MASK (0xf << 6) -#define BLENDEQx_A_FUNC (_x) ((_x) << 0) -#define BLENDEQx_A_FUNC_MASK (0xf << 0) - -#define BLENDCON (0x260) -#define BLENDCON_8BIT_ALPHA (1 << 0) - -/* Per-window palette base addresses (start of palette memory). -* Each window palette area consists of 256 32-bit entries. -* START is the first address (entry 0th), END is the address of 255th entry. */ -#define WIN0_PAL_BASE (0x2400) -#define WIN0_PAL_END (0x27fc) -#define WIN1_PAL_BASE (0x2800) -#define WIN1_PAL_END (0x2bfc) -#define WIN2_PAL_BASE (0x2c00) -#define WIN2_PAL_END (0x2ffc) -#define WIN3_PAL_BASE (0x3000) -#define WIN3_PAL_END (0x33fc) -#define WIN4_PAL_BASE (0x3400) -#define WIN4_PAL_END (0x37fc) -#define WIN0_PAL (_entry) (WIN0_PAL_BASE + ((_entry) * 4)) -#define WIN1_PAL (_entry) (WIN1_PAL_BASE + ((_entry) * 4)) -#define WIN2_PAL (_entry) (WIN2_PAL_BASE + ((_entry) * 4)) -#define WIN3_PAL (_entry) (WIN3_PAL_BASE + ((_entry) * 4)) -#define WIN4_PAL (_entry) (WIN4_PAL_BASE + ((_entry) * 4)) +#ifndef __ASM_ARCH_MACH_REGS_FB_H +#define __ASM_ARCH_MACH_REGS_FB_H __FILE__ -static inline unsigned int s3c_fb_pal_reg (unsigned int window,int reg) -{ -switch (window) { -case 0 :return WIN0_PAL (reg); -case 1 :return WIN1_PAL (reg); -case 2 :return WIN2_PAL (reg); -case 3 :return WIN3_PAL (reg); -case 4 :return WIN4_PAL (reg); - } +#include <plat/regs-fb-v5.h> -BUG (); -} +#define PRTCON (0xc) +#define PRTCON_PROTECT (1 << 11) -#endif /* __ASM_ARCH_REGS_FB_H */ +#endif /* __ASM_ARCH_MACH_REGS_FB_H */
arch/arm/plat-s3c/include/plat/regs-fb-v5.h new file +138 -0
138 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 8/19 ARM: S5PC1XX: move common s5pc1xx s3c-fb regs to platform directory
Quoted 7 lines · Marek Szyprowski
From: Pawel Osciak <[email protected]>
From: Pawel Osciak <[email protected]>
Frame buffer register block on S5PC100 and S5PC110 differs slightly. This patch moves all register definitions that are common for S5PC100 and S5PC110 to
plat-s3c/plat/regs-fb-v5.h.
From: Pawel Osciak <[email protected]> but no signoff from him.
Quoted 308 lines
Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/mach-s5pc100/include/mach/regs-fb.h | 133 ++----------------------- arch/arm/plat-s3c/include/plat/regs-fb-v5.h | 138 ++++++++++++++++++++++++++ 2 files changed, 146 insertions(+), 125 deletions(-) create mode 100644 arch/arm/plat-s3c/include/plat/regs-fb-v5.harch/arm/mach-s5pc100/include/mach/regs-fb.h +8
-125@@ -1,139 +1,22 @@ -/* arch/arm/mach-s5pc100/include/mach/regs-fb.h -* +/* * Copyright 2009 Samsung Electronics Co. * Pawel Osciak <[email protected]> * -* Framebuffer register definitions for Samsung S5PC100. +* Machine-specific framebuffer definitions for Samsung S5PC100. * * 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. -*/ - -#ifndef __ASM_ARCH_REGS_FB_H -#define __ASM_ARCH_REGS_FB_H __FILE__ - -#include <plat/regs-fb-v4.h> - -/* VP1 interface timing control */ -#define VP1CON0 (0x118) -#define VP1_RATECON_EN (1 << 31) -#define VP1_CLKRATE_MASK (0xff) - -#define VP1CON1 (0x11c) -#define VP1_VTREGCON_EN (1 << 31) -#define VP1_VBPD_MASK (0xfff) -#define VP1_VBPD_SHIFT (16) - - -#define WPALCON_H (0x19c) -#define WPALCON_L (0x1a0) - -/* Pallete contro for WPAL0 and WPAL1 is the same as in S3C64xx, but -* different for WPAL2-4 -*/ -/* In WPALCON_L (aka WPALCON) */ -#define WPALCON_W1PAL_32BPP_A888 (0x7 << 3) -#define WPALCON_W0PAL_32BPP_A888 (0x7 << 0) - -/* To set W2PAL-W4PAL consist of one bit from WPALCON_L and two from WPALCON_H, -* e.g. W2PAL[2..0] is made of (WPALCON_H[10..9], WPALCON_L[6]). -*/ -#define WPALCON_L_WxPAL_L_MASK (0x1) -#define WPALCON_L_W2PAL_L_SHIFT (6) -#define WPALCON_L_W3PAL_L_SHIFT (7) -#define WPALCON_L_W4PAL_L_SHIFT (8) - -#define WPALCON_L_WxPAL_H_MASK (0x3) -#define WPALCON_H_W2PAL_H_SHIFT (9) -#define WPALCON_H_W3PAL_H_SHIFT (13) -#define WPALCON_H_W4PAL_H_SHIFT (17) - -/* Per-window alpha value registers */ -/* For window 0 8-bit alpha values are in VIDW0ALPHAx, -* for windows 1-4 alpha values consist of two parts, the 4 low bits are -* taken from VIDWxALPHAx and 4 high bits are from VIDOSDxC, -* e.g. WIN1_ALPHA0_B[7..0] = (VIDOSD1C[3..0], VIDW1ALPHA0[3..0]) -*/ -#define VIDWxALPHA0 (_win) (0x200 + (_win * 8)) -#define VIDWxALPHA1 (_win) (0x204 + (_win * 8)) - -/* Only for window 0 in VIDW0ALPHAx. */ -#define VIDW0ALPHAx_R (_x) ((_x) << 16) -#define VIDW0ALPHAx_R_MASK (0xff << 16) -#define VIDW0ALPHAx_R_SHIFT (16) -#define VIDW0ALPHAx_G (_x) ((_x) << 8) -#define VIDW0ALPHAx_G_MASK (0xff << 8) -#define VIDW0ALPHAx_G_SHIFT (8) -#define VIDW0ALPHAx_B (_x) ((_x) << 0) -#define VIDW0ALPHAx_B_MASK (0xff << 0) -#define VIDW0ALPHAx_B_SHIFT (0) - -/* Low 4 bits of alpha0-1 for windows 1-4 */ -#define VIDW14ALPHAx_R_L (_x) ((_x) << 16) -#define VIDW14ALPHAx_R_L_MASK (0xf << 16) -#define VIDW14ALPHAx_R_L_SHIFT (16) -#define VIDW14ALPHAx_G_L (_x) ((_x) << 8) -#define VIDW14ALPHAx_G_L_MASK (0xf << 8) -#define VIDW14ALPHAx_G_L_SHIFT (8) -#define VIDW14ALPHAx_B_L (_x) ((_x) << 0) -#define VIDW14ALPHAx_B_L_MASK (0xf << 0) -#define VIDW14ALPHAx_B_L_SHIFT (0) - - -/* Per-window blending equation control registers */ -#define BLENDEQx (_win) (0x244 + ((_win) * 4)) -#define BLENDEQ1 (0x244) -#define BLENDEQ2 (0x248) -#define BLENDEQ3 (0x24c) -#define BLENDEQ4 (0x250) - -#define BLENDEQx_Q_FUNC (_x) ((_x) << 18) -#define BLENDEQx_Q_FUNC_MASK (0xf << 18) -#define BLENDEQx_P_FUNC (_x) ((_x) << 12) -#define BLENDEQx_P_FUNC_MASK (0xf << 12) -#define BLENDEQx_B_FUNC (_x) ((_x) << 6) -#define BLENDEQx_B_FUNC_MASK (0xf << 6) -#define BLENDEQx_A_FUNC (_x) ((_x) << 0) -#define BLENDEQx_A_FUNC_MASK (0xf << 0) - -#define BLENDCON (0x260) -#define BLENDCON_8BIT_ALPHA (1 << 0) - -/* Per-window palette base addresses (start of palette memory). -* Each window palette area consists of 256 32-bit entries. -* START is the first address (entry 0th), END is the address of 255th entry. */ -#define WIN0_PAL_BASE (0x2400) -#define WIN0_PAL_END (0x27fc) -#define WIN1_PAL_BASE (0x2800) -#define WIN1_PAL_END (0x2bfc) -#define WIN2_PAL_BASE (0x2c00) -#define WIN2_PAL_END (0x2ffc) -#define WIN3_PAL_BASE (0x3000) -#define WIN3_PAL_END (0x33fc) -#define WIN4_PAL_BASE (0x3400) -#define WIN4_PAL_END (0x37fc) -#define WIN0_PAL (_entry) (WIN0_PAL_BASE + ((_entry) * 4)) -#define WIN1_PAL (_entry) (WIN1_PAL_BASE + ((_entry) * 4)) -#define WIN2_PAL (_entry) (WIN2_PAL_BASE + ((_entry) * 4)) -#define WIN3_PAL (_entry) (WIN3_PAL_BASE + ((_entry) * 4)) -#define WIN4_PAL (_entry) (WIN4_PAL_BASE + ((_entry) * 4)) +#ifndef __ASM_ARCH_MACH_REGS_FB_H +#define __ASM_ARCH_MACH_REGS_FB_H __FILE__ -static inline unsigned int s3c_fb_pal_reg (unsigned int window,int reg) -{ -switch (window) { -case 0 :return WIN0_PAL (reg); -case 1 :return WIN1_PAL (reg); -case 2 :return WIN2_PAL (reg); -case 3 :return WIN3_PAL (reg); -case 4 :return WIN4_PAL (reg); - } +#include <plat/regs-fb-v5.h> -BUG (); -} +#define PRTCON (0xc) +#define PRTCON_PROTECT (1 << 11) -#endif /* __ASM_ARCH_REGS_FB_H */ +#endif /* __ASM_ARCH_MACH_REGS_FB_H */ arch/arm/plat-s3c/include/plat/regs-fb-v5.h new file +138
-0@@ -0,0 +1,138 @@ +/* +* Copyright 2009 Samsung Electronics Co. +* Pawel Osciak <[email protected]> +* +* Framebuffer register definitions for Samsung S5PC1xx. +* +* 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. +*/ + +#ifndef __ASM_ARCH_REGS_FB_V5_H +#define __ASM_ARCH_REGS_FB_V5_H __FILE__ + +#include <plat/regs-fb-v4.h> + +/* VP1 interface timing control */ +#define VP1CON0 (0x118) +#define VP1_RATECON_EN (1 << 31) +#define VP1_CLKRATE_MASK (0xff) + +#define VP1CON1 (0x11c) +#define VP1_VTREGCON_EN (1 << 31) +#define VP1_VBPD_MASK (0xfff) +#define VP1_VBPD_SHIFT (16) + + +#define WPALCON_H (0x19c) +#define WPALCON_L (0x1a0) + +/* Pallete contro for WPAL0 and WPAL1 is the same as in S3C64xx, but +* different for WPAL2-4 +*/ +/* In WPALCON_L (aka WPALCON) */ +#define WPALCON_W1PAL_32BPP_A888 (0x7 << 3) +#define WPALCON_W0PAL_32BPP_A888 (0x7 << 0) + +/* W2PAL-W4PAL consist of one bit from WPALCON_L and two from WPALCON_H, +* e.g. W2PAL[2..0] is made of (WPALCON_H[10..9], WPALCON_L[6]). +*/ +#define WPALCON_L_WxPAL_L_MASK (0x1) +#define WPALCON_L_W2PAL_L_SHIFT (6) +#define WPALCON_L_W3PAL_L_SHIFT (7) +#define WPALCON_L_W4PAL_L_SHIFT (8) + +#define WPALCON_L_WxPAL_H_MASK (0x3) +#define WPALCON_H_W2PAL_H_SHIFT (9) +#define WPALCON_H_W3PAL_H_SHIFT (13) +#define WPALCON_H_W4PAL_H_SHIFT (17) + +/* Per-window alpha value registers */ +/* For window 0 8-bit alpha values are in VIDW0ALPHAx, +* for windows 1-4 alpha values consist of two parts, the 4 low bits are +* taken from VIDWxALPHAx and 4 high bits are from VIDOSDxC, +* e.g. WIN1_ALPHA0_B[7..0] = (VIDOSD1C[3..0], VIDW1ALPHA0[3..0]) +*/ +#define VIDWxALPHA0 (_win) (0x200 + (_win * 8)) +#define VIDWxALPHA1 (_win) (0x204 + (_win * 8)) + +/* Only for window 0 in VIDW0ALPHAx. */ +#define VIDW0ALPHAx_R (_x) ((_x) << 16) +#define VIDW0ALPHAx_R_MASK (0xff << 16) +#define VIDW0ALPHAx_R_SHIFT (16) +#define VIDW0ALPHAx_G (_x) ((_x) << 8) +#define VIDW0ALPHAx_G_MASK (0xff << 8) +#define VIDW0ALPHAx_G_SHIFT (8) +#define VIDW0ALPHAx_B (_x) ((_x) << 0) +#define VIDW0ALPHAx_B_MASK (0xff << 0) +#define VIDW0ALPHAx_B_SHIFT (0) + +/* Low 4 bits of alpha0-1 for windows 1-4 */ +#define VIDW14ALPHAx_R_L (_x) ((_x) << 16) +#define VIDW14ALPHAx_R_L_MASK (0xf << 16) +#define VIDW14ALPHAx_R_L_SHIFT (16) +#define VIDW14ALPHAx_G_L (_x) ((_x) << 8) +#define VIDW14ALPHAx_G_L_MASK (0xf << 8) +#define VIDW14ALPHAx_G_L_SHIFT (8) +#define VIDW14ALPHAx_B_L (_x) ((_x) << 0) +#define VIDW14ALPHAx_B_L_MASK (0xf << 0) +#define VIDW14ALPHAx_B_L_SHIFT (0) + + +/* Per-window blending equation control registers */ +#define BLENDEQx (_win) (0x244 + ((_win) * 4)) +#define BLENDEQ1 (0x244) +#define BLENDEQ2 (0x248) +#define BLENDEQ3 (0x24c) +#define BLENDEQ4 (0x250) + +#define BLENDEQx_Q_FUNC (_x) ((_x) << 18) +#define BLENDEQx_Q_FUNC_MASK (0xf << 18) +#define BLENDEQx_P_FUNC (_x) ((_x) << 12) +#define BLENDEQx_P_FUNC_MASK (0xf << 12) +#define BLENDEQx_B_FUNC (_x) ((_x) << 6) +#define BLENDEQx_B_FUNC_MASK (0xf << 6) +#define BLENDEQx_A_FUNC (_x) ((_x) << 0) +#define BLENDEQx_A_FUNC_MASK (0xf << 0) + +#define BLENDCON (0x260) +#define BLENDCON_8BIT_ALPHA (1 << 0) + +/* Per-window palette base addresses (start of palette memory). +* Each window palette area consists of 256 32-bit entries. +* START is the first address (entry 0th), END is the address of 255th entry. +*/ +#define WIN0_PAL_BASE (0x2400) +#define WIN0_PAL_END (0x27fc) +#define WIN1_PAL_BASE (0x2800) +#define WIN1_PAL_END (0x2bfc) +#define WIN2_PAL_BASE (0x2c00) +#define WIN2_PAL_END (0x2ffc) +#define WIN3_PAL_BASE (0x3000) +#define WIN3_PAL_END (0x33fc) +#define WIN4_PAL_BASE (0x3400) +#define WIN4_PAL_END (0x37fc) + +#define WIN0_PAL (_entry) (WIN0_PAL_BASE + ((_entry) * 4)) +#define WIN1_PAL (_entry) (WIN1_PAL_BASE + ((_entry) * 4)) +#define WIN2_PAL (_entry) (WIN2_PAL_BASE + ((_entry) * 4)) +#define WIN3_PAL (_entry) (WIN3_PAL_BASE + ((_entry) * 4)) +#define WIN4_PAL (_entry) (WIN4_PAL_BASE + ((_entry) * 4)) + +static inline unsigned int s3c_fb_pal_reg (unsigned int window,int reg) +{ +switch (window) { +case 0 :return WIN0_PAL (reg); +case 1 :return WIN1_PAL (reg); +case 2 :return WIN2_PAL (reg); +case 3 :return WIN3_PAL (reg); +case 4 :return WIN4_PAL (reg); + } + +BUG (); +} + + +#endif /* __ASM_ARCH_REGS_FB_V5_H */ +Signature · 1 line
1.6.4
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoCs have UART that differs a bit from the one known from the previous Samsung SoCs. This patch adds support for this new driver.
--- arch/arm/plat-s3c/include/plat/regs-serial.h | 31 ++++++ drivers/serial/Kconfig | 7 ++ drivers/serial/Makefile | 1 + drivers/serial/s5pc110.c | 143 ++++++++++++++++++++++++++ 4 files changed, 182 insertions(+), 0 deletions(-) create mode 100644 drivers/serial/s5pc110.c
arch/arm/plat-s3c/include/plat/regs-serial.h +31 -0
@@ -194,6 +194,37 @@#define S3C64XX_UINTSP 0x34#define S3C64XX_UINTM 0x38 +/* S5PC110 UCON */ +#define S5PC110_UCON_CLKMASK (1<<10) +#define S5PC110_UCON_PCLK (0<<10) +#define S5PC110_UCON_SCLK_UART (1<<10) + +/* S5PC110 FIFO trigger levels */ +#define S5PC110_UFCON_RXTRIG1 (0<<4) +#define S5PC110_UFCON_RXTRIG4 (1<<4) +#define S5PC110_UFCON_RXTRIG8 (2<<4) +#define S5PC110_UFCON_RXTRIG16 (3<<4) +#define S5PC110_UFCON_RXTRIG32 (4<<4) +#define S5PC110_UFCON_RXTRIG64 (5<<4) +#define S5PC110_UFCON_RXTRIG128 (6<<4) +#define S5PC110_UFCON_RXTRIG256 (7<<4) + +#define S5PC110_UFCON_TXTRIG1 (0<<8) +#define S5PC110_UFCON_TXTRIG4 (1<<8) +#define S5PC110_UFCON_TXTRIG8 (2<<8) +#define S5PC110_UFCON_TXTRIG16 (3<<8) +#define S5PC110_UFCON_TXTRIG32 (4<<8) +#define S5PC110_UFCON_TXTRIG64 (5<<8) +#define S5PC110_UFCON_TXTRIG128 (6<<8) +#define S5PC110_UFCON_TXTRIG256 (7<<8) + +#define S5PC110_UFSTAT_TXFULL (1<<24) +#define S5PC110_UFSTAT_RXFULL (1<<8) +#define S5PC110_UFSTAT_TXSHIFT (16) +#define S5PC110_UFSTAT_RXSHIFT (0) +#define S5PC110_UFSTAT_TXMASK (255<<16) +#define S5PC110_UFSTAT_RXMASK (255) +#ifndef __ASSEMBLY__/* struct s3c24xx_uart_clksrc
drivers/serial/Kconfig +7 -0
@@ -540,6 +540,13 @@ config SERIAL_S5PC100 help Serial port support for the Samsung S5PC100 SoCs +config SERIAL_S5PC110 + tristate "Samsung S5PC110 Serial port support" + depends on SERIAL_SAMSUNG && CPU_S5PC110 + default y + help + Serial port support for the Samsung S5PC110 SoCs + config SERIAL_MAX3100 tristate "MAX3100 support" depends on SPI
drivers/serial/Makefile +1 -0
@@ -45,6 +45,7 @@ obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o obj-$(CONFIG_SERIAL_S5PC100) += s3c6400.o +obj-$(CONFIG_SERIAL_S5PC110) += s5pc110.o obj-$(CONFIG_SERIAL_MAX3100) += max3100.o obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o obj-$(CONFIG_SERIAL_MUX) += mux.o
drivers/serial/s5pc110.c new file +143 -0
143 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
Quoted 132 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
Samsung S5PC110 SoCs have UART that differs a bit from the one known from the previous Samsung SoCs. This patch adds support for this new driver.
Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>---
arch/arm/plat-s3c/include/plat/regs-serial.h | 31 ++++++drivers/serial/Kconfig| 7 ++drivers/serial/Makefile| 1 +drivers/serial/s5pc110.c| 143 ++++++++++++++++++++++++++4 files changed, 182 insertions(+), 0 deletions(-)create mode 100644
drivers/serial/s5pc110.carch/arm/plat-s3c/include/plat/regs-serial.h +31
-0@@ -194,6 +194,37 @@ #define S3C64XX_UINTSP 0x34 #define S3C64XX_UINTM 0x38 +/* S5PC110 UCON */ +#define S5PC110_UCON_CLKMASK (1<<10) +#define S5PC110_UCON_PCLK (0<<10) +#define S5PC110_UCON_SCLK_UART (1<<10) + +/* S5PC110 FIFO trigger levels */ +#define S5PC110_UFCON_RXTRIG1 (0<<4) +#define S5PC110_UFCON_RXTRIG4 (1<<4) +#define S5PC110_UFCON_RXTRIG8 (2<<4) +#define S5PC110_UFCON_RXTRIG16 (3<<4) +#define S5PC110_UFCON_RXTRIG32 (4<<4) +#define S5PC110_UFCON_RXTRIG64 (5<<4) +#define S5PC110_UFCON_RXTRIG128 (6<<4) +#define S5PC110_UFCON_RXTRIG256 (7<<4) + +#define S5PC110_UFCON_TXTRIG1 (0<<8) +#define S5PC110_UFCON_TXTRIG4 (1<<8) +#define S5PC110_UFCON_TXTRIG8 (2<<8) +#define S5PC110_UFCON_TXTRIG16 (3<<8) +#define S5PC110_UFCON_TXTRIG32 (4<<8) +#define S5PC110_UFCON_TXTRIG64 (5<<8) +#define S5PC110_UFCON_TXTRIG128 (6<<8) +#define S5PC110_UFCON_TXTRIG256 (7<<8) + +#define S5PC110_UFSTAT_TXFULL (1<<24) +#define S5PC110_UFSTAT_RXFULL (1<<8) +#define S5PC110_UFSTAT_TXSHIFT (16) +#define S5PC110_UFSTAT_RXSHIFT (0) +#define S5PC110_UFSTAT_TXMASK (255<<16) +#define S5PC110_UFSTAT_RXMASK (255) + #ifndef __ASSEMBLY__ /* struct s3c24xx_uart_clksrcdrivers/serial/Kconfig +0
-0@@ -540,6 +540,13 @@ config SERIAL_S5PC100help
Serial port support for the Samsung S5PC100 SoCsdrivers/serial/Kconfig +7
-0+config SERIAL_S5PC110 + tristate "Samsung S5PC110 Serial port support" + depends on SERIAL_SAMSUNG && CPU_S5PC110 + default y + help + Serial port support for the Samsung S5PC110 SoCs +config
SERIAL_MAX3100
tristate "MAX3100 support"
depends on SPIdrivers/serial/Makefile +0
-0@@ -45,6 +45,7 @@ obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.oobj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o
obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o
obj-$(CONFIG_SERIAL_S5PC100) += s3c6400.o
+obj-$(CONFIG_SERIAL_S5PC110) += s5pc110.o
obj-$(CONFIG_SERIAL_MAX3100) += max3100.o
obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o
obj-$(CONFIG_SERIAL_MUX) += mux.odrivers/serial/s5pc110.c new file +36
-0@@ -0,0 +1,143 @@ +/* +* linux/drivers/serial/s5pc110.c +* +* Driver for Samsung S5PC110 SoC onboard UARTs. +* +* Copyright 2009 Samsung Electronics +* Kyungin Park <[email protected]> +* +* 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. +*/ + +#include <linux/module.h> +#include <linux/ioport.h> +#include <linux/io.h> +#include <linux/platform_device.h> +#include <linux/init.h> +#include <linux/serial_core.h> +#include <linux/serial.h> + +#include <asm/irq.h> +#include <mach/hardware.h> + +#include <plat/regs-serial.h> + +#include "samsung.h" + +static int s5pc110_serial_setsource (struct uart_port *port, + struct s3c24xx_uart_clksrc *clk) +{ + unsigned long ucon = rd_regl(port, S3C2410_UCON); + + if (strcmp(clk->name, "uclk0") == 0) + ucon |= S5PC110_UCON_SCLK_UART; + else if (strcmp(clk->name, "pclk") == 0)
drivers/serial/s5pc110.c line 46
Quoted 10 lines
drivers/serial/s5pc110.c new file +10
-0+ /* See notes about transitioning from UCLK to PCLK */ + ucon &= ~S5PC110_UCON_SCLK_UART; + else { + printk(KERN_ERR "unknown clock source %s\n", clk->name); + return -EINVAL; + } + + wr_regl(port, S3C2410_UCON, ucon); + return 0; +}
Not just about this c110 patch: I think this string comparison thing isn't very neat.
I think we'd better be doing it by indexing into an array of clock names(which can be
defined in some platform specific code).
Quoted 104 lines
drivers/serial/s5pc110.c new file +96
-1+static int s5pc110_serial_getsource (struct uart_port *port, + struct s3c24xx_uart_clksrc *clk) +{ + u32 ucon = rd_regl(port, S3C2410_UCON); + + clk->divisor = 1; + + switch (ucon & S5PC110_UCON_CLKMASK) { + case S5PC110_UCON_SCLK_UART: + clk->name = "uclk0"; + break; + + case S5PC110_UCON_PCLK: + clk->name = "pclk"; + break; + } + + return 0; +} + +static int s5pc110_serial_resetport (struct uart_port *port, + struct s3c2410_uartcfg *cfg) +{ + unsigned long ucon = rd_regl(port, S3C2410_UCON); + + dbg("s5pc110_serial_resetport: port=%p (%08lx), cfg=%p\n", + port, port->mapbase, cfg); + + /* ensure we don't change the clock settings... */ + + ucon &= S5PC110_UCON_CLKMASK; + + wr_regl(port, S3C2410_UCON, ucon | cfg->ucon); + wr_regl(port, S3C2410_ULCON, cfg->ulcon); + + /* reset both fifos */ + + wr_regl(port, S3C2410_UFCON, cfg->ufcon | S3C2410_UFCON_RESETBOTH); + wr_regl(port, S3C2410_UFCON, cfg->ufcon); + + return 0; +} + +static struct s3c24xx_uart_info s5pc110_uart_inf = { + .name = "Samsung S5PC110 UART", + .type = PORT_S3C6400, + .fifosize = 16, + .has_divslot = 1, + .rx_fifomask = S5PC110_UFSTAT_RXMASK, + .rx_fifoshift = S5PC110_UFSTAT_RXSHIFT, + .rx_fifofull = S5PC110_UFSTAT_RXFULL, + .tx_fifofull = S5PC110_UFSTAT_TXFULL, + .tx_fifomask = S5PC110_UFSTAT_TXMASK, + .tx_fifoshift = S5PC110_UFSTAT_TXSHIFT, + .get_clksrc = s5pc110_serial_getsource, + .set_clksrc = s5pc110_serial_setsource, + .reset_port = s5pc110_serial_resetport, +}; + +/* device management */ + +static int s5pc110_serial_probe (struct platform_device *dev) +{ + dbg("s5pc110_serial_probe: dev=%p\n", dev); + + return s3c24xx_serial_probe(dev, &s5pc110_uart_inf); +} + +static struct platform_driver s5pc110_serial_driver = { + .probe = s5pc110_serial_probe, + .remove = __devexit_p(s3c24xx_serial_remove), + .driver = { + .name = "s5pc110-uart", + .owner = THIS_MODULE, + }, +}; + +s3c24xx_console_init (&s5pc110_serial_driver, &s5pc110_uart_inf); + +static int __init s5pc110_serial_init (void ) +{ + return s3c24xx_serial_init(&s5pc110_serial_driver, &s5pc110_uart_inf); +} + +static void __exit s5pc110_serial_exit(void) +{ + platform_driver_unregister(&s5pc110_serial_driver); +} + +module_init (s5pc110_serial_init); +module_exit (s5pc110_serial_exit); + +MODULE_DESCRIPTION ("Samsung S5PC110 SoC Serial port driver" ); +MODULE_AUTHOR ("Kyungmin Park <[email protected]>" ); +MODULE_LICENSE ("GPL v2" ); +MODULE_ALIAS ("platform:s5pc110-uart" ); --1.6.4
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
Quoted 8 lines · jassi brar
Quoted 6 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
Samsung S5PC110 SoCs have UART that differs a bit from the one known from the previous Samsung SoCs. This patch adds support for this new driver.
Quoted 8 lines
Quoted 2 lines
Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>Not just about this c110 patch: I think this string comparison thing isn't very neat.
I think we'd better be doing it by indexing into an array of clock names(which can be
defined in some platform specific code).
I don't mind changing to using a table, but the table is probably best off here, closest to the UART drivers in question.
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
Quoted 12 lines · Ben Dooks
Quoted 10 lines · jassi brar
Quoted 8 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
Samsung S5PC110 SoCs have UART that differs a bit from the one known from the previous Samsung SoCs. This patch adds support for this new driver.
Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>
Quoted 8 lines
Quoted 5 lines
Not just about this c110 patch: I think this string comparison thing isn't very neat.
I think we'd better be doing it by indexing into an array of clock names(which can be
defined in some platform specific code).I don't mind changing to using a table, but the table is probably best off here, closest to the UART drivers in question.
well as per current implementation of drivers/serial/samsung.c we can't do much about it.
Ideally, each SoC(if not yet, maybe in future) can have different number/names of possible source clocks for signal generation. Let us not depend upon even defaults(fclk, pclk etc)
Let each platform code(SoC specific) define names of all possible source clocks and let the board init code pass on the potential source clocks by some bit-mask(or some other mechanism) while setting the platform data.
The samsung.c could then simply go thru the array of source clock names and the bit-mask, in platform_data, while selecting the best possible
source for the baud rate under consideration.
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
Quoted 4 lines · jassi brar
Let each platform code(SoC specific) define names of all possible source clocks and let the board init code pass on the potential source clocks by some bit-mask(or some other mechanism) while setting the platform data.
This is going to set off warnings from a clock API point of view - passing clock names around in platform data is usually a sign that something is very wrong. Keeping the mapping inside the clock API (still controlled by the board driver but by telling the clock API that device X should use clock Y).
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
Quoted 7 lines · Mark Brown
Quoted 4 lines · jassi brar
Let each platform code(SoC specific) define names of all possible source clocks and let the board init code pass on the potential source clocks by some bit-mask(or some other mechanism) while setting the platform data.
Quoted 5 lines
This is going to set off warnings from a clock API point of view - passing clock names around in platform data is usually a sign that something is very wrong. Keeping the mapping inside the clock API (still controlled by the board driver but by telling the clock API that device X should use clock Y).
no clock pointer needs to be passed, just a pointer to an array of _strings_ There is no need to even include any clock header in platform code for the purpose.
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
Quoted 11 lines · jassi brar
On Thu, Nov 19, 2009 at 7:33 PM, Mark Brown
Quoted 5 lines
This is going to set off warnings from a clock API point of view - passing clock names around in platform data is usually a sign that something is very wrong. Keeping the mapping inside the clock API (still controlled by the board driver but by telling the clock API that device X should use clock Y).
no clock pointer needs to be passed, just a pointer to an array of _strings_ There is no need to even include any clock header in platform code for the purpose.
Yes, that's what I was commenting on - like I say, passing clock names tends to set off the same alarm bells as passing a struct clk. Like I say, the general model for this has been that the fixups will be done by having the machine code talk to the clock API ratehr than bouncing the data about the clock to use through the driver.
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
Quoted 13 lines · Mark Brown
Quoted 11 lines · jassi brar
On Thu, Nov 19, 2009 at 7:33 PM, Mark Brown
Quoted 5 lines
This is going to set off warnings from a clock API point of view - passing clock names around in platform data is usually a sign that something is very wrong. Keeping the mapping inside the clock API (still controlled by the board driver but by telling the clock API that device X should use clock Y).
no clock pointer needs to be passed, just a pointer to an array of _strings_ There is no need to even include any clock header in platform code for the purpose.
Quoted 5 lines
Yes, that's what I was commenting on - like I say, passing clock names tends to set off the same alarm bells as passing a struct clk. Like I say, the general model for this has been that the fixups will be done by having the machine code talk to the clock API ratehr than bouncing the data about the clock to use through the driver.
The case here is that UART controller can source from various platform clocks to generate the UART clocks. The drivers/serial/samsung.c chooses a source clock that can result in closest match to the requested rate.
How could we do that from machine code(except for writing callbacks for each machine using the SoC)?
Or maybe i cud understand better looking at some example. Cud u suggest some please?
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
Quoted 8 lines · jassi brar
The case here is that UART controller can source from various platform clocks to generate the UART clocks. The
drivers/serial/samsung.cchooses a source clock that can result in closest match to the requested rate.
How could we do that from machine code(except for writing callbacks for each machine using the SoC)?Or maybe i cud understand better looking at some example. Cud u suggest some please?
I can't think off the top of my head of anything which does this dynamically (rather than just choosing a clock at startup time). OMAP might have something since they seem to have the most advanced of the current implementations.
Off the top of my head it sounds like the muxing ought to be pushed into the clock API completely - the problem of picking the best match for the current use case isn't unique to the serial driver by any stretch of the imagination. The serial driver would then end up just seeing the output of the mux it uses, with the clock API dealing with working out which of the sources can deliver the best match.
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
In reply to Mark BrownQuoted 13 lines · Mark Brown
Quoted 11 lines · jassi brar
On Thu, Nov 19, 2009 at 7:33 PM, Mark Brown
Quoted 5 lines
This is going to set off warnings from a clock API point of view - passing clock names around in platform data is usually a sign that something is very wrong. ?Keeping the mapping inside the clock API (still controlled by the board driver but by telling the clock API that device X should use clock Y).
no clock pointer needs to be passed, just a pointer to an array of _strings_ There is no need to even include any clock header in platform code for the purpose.
Quoted 5 lines
Yes, that's what I was commenting on - like I say, passing clock names tends to set off the same alarm bells as passing a struct clk. Like I say, the general model for this has been that the fixups will be done by having the machine code talk to the clock API ratehr than bouncing the data about the clock to use through the driver.
I'm not sure what you're commenting on precisely, but the Samsung code as a whole doesn't use the clk API very well, and I suspect that is starting to cause people to have to pass clock names around.
I've tried to persuade Ben to tidy this up and convert over to clkdev before it becomes too big a problem, but I've had little success. I suspect it's now grown too big to be tackled sanely.
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
Quoted 3 lines · Russell King - ARM Linux
I'm not sure what you're commenting on precisely, but the Samsung code as a whole doesn't use the clk API very well, and I suspect that is starting to cause people to have to pass clock names around.
That's what I'd thought originally but it's not quite the problem here. The issue is that Samsung serial port clock is chosen from a mux and the logic to select which of the inputs to that mux should be used is in the serial driver. This means that if the set of parent clocks changes then the serial driver needs to be told what they are.
My suggestion was to push this logic down into the clock API so the serial driver just requests a rate and then clock API picks the best option from the mux. As well as being nicer from the clock API point of view this would also allow other drivers to use the same logic since these muxes are a standard idiom for Samsung SoCs.
Quoted 3 lines
I've tried to persuade Ben to tidy this up and convert over to clkdev before it becomes too big a problem, but I've had little success. I suspect it's now grown too big to be tackled sanely.
clkdev would be nice but I don't think it'd deal with the issue here.
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
Quoted 12 lines · Mark Brown
Quoted 3 lines · Russell King - ARM Linux
I'm not sure what you're commenting on precisely, but the Samsung code as a whole doesn't use the clk API very well, and I suspect that is starting to cause people to have to pass clock names around.
That's what I'd thought originally but it's not quite the problem here. The issue is that Samsung serial port clock is chosen from a mux and the logic to select which of the inputs to that mux should be used is in the serial driver. This means that if the set of parent clocks changes then the serial driver needs to be told what they are.
Quoted 5 lines
My suggestion was to push this logic down into the clock API so the serial driver just requests a rate and then clock API picks the best option from the mux. As well as being nicer from the clock API point of view this would also allow other drivers to use the same logic since these muxes are a standard idiom for Samsung SoCs.
Yes, I agree with that approach.
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
In reply to Mark BrownQuoted 11 lines · Mark Brown
Quoted 3 lines · Russell King - ARM Linux
I'm not sure what you're commenting on precisely, but the Samsung code as a whole doesn't use the clk API very well, and I suspect that is starting to cause people to have to pass clock names around.
That's what I'd thought originally but it's not quite the problem here. The issue is that Samsung serial port clock is chosen from a mux and the logic to select which of the inputs to that mux should be used is in the serial driver. This means that if the set of parent clocks changes then the serial driver needs to be told what they are.
just to add to the info: unlike system clocks and mux'es which are controlled by registers of a dedicated clock/system controller, this uart mux is managed by bits of some register of the UART controller.
Quoted 5 lines
My suggestion was to push this logic down into the clock API so the serial driver just requests a rate and then clock API picks the best option from the mux. As well as being nicer from the clock API point of view this would also allow other drivers to use the same logic since these muxes are a standard idiom for Samsung SoCs.
how transparently could we add this 'uart-mux' into the clock API, provided that the register space ioremap'ing is done in the uart driver, is to be seen.
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
In reply to Mark BrownHello,
Quoted 12 lines · Mark Brown
Quoted 3 lines · Russell King - ARM Linux
I'm not sure what you're commenting on precisely, but the Samsung code as a whole doesn't use the clk API very well, and I suspect that is starting to cause people to have to pass clock names around.
That's what I'd thought originally but it's not quite the problem here. The issue is that Samsung serial port clock is chosen from a mux and the logic to select which of the inputs to that mux should be used is in the serial driver. This means that if the set of parent clocks changes then the serial driver needs to be told what they are.
Quoted 5 lines
My suggestion was to push this logic down into the clock API so the serial driver just requests a rate and then clock API picks the best option from the mux. As well as being nicer from the clock API point of view this would also allow other drivers to use the same logic since these muxes are a standard idiom for Samsung SoCs.
What if a device does not operate properly when clocked from one of the available clock sources (lets say machine specific problem)? There must be a way of setting which clock(s) should not be considered when calculating best choice for particular device.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
Quoted 10 lines · Marek Szyprowski
Quoted 3 lines · Mark Brown
My suggestion was to push this logic down into the clock API so the serial driver just requests a rate and then clock API picks the best option from the mux. As well as being nicer from the clock API point of
What if a device does not operate properly when clocked from one of the available clock sources (lets say machine specific problem)? There must be a way of setting which clock(s) should not be considered when calculating best choice for particular device.
Have the machine driver tell the clock API about this - that's what I was suggesting originally before I realised there was the mux managment logic in there.
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
In reply to Marek SzyprowskiQuoted 22 lines · Marek Szyprowski
Hello,
Quoted 12 lines · Mark Brown
Quoted 3 lines · Russell King - ARM Linux
I'm not sure what you're commenting on precisely, but the Samsung code as a whole doesn't use the clk API very well, and I suspect that is starting to cause people to have to pass clock names around.
That's what I'd thought originally but it's not quite the problem here. The issue is that Samsung serial port clock is chosen from a mux and the logic to select which of the inputs to that mux should be used is in the serial driver. This means that if the set of parent clocks changes then the serial driver needs to be told what they are.
Quoted 5 lines
My suggestion was to push this logic down into the clock API so the serial driver just requests a rate and then clock API picks the best option from the mux. As well as being nicer from the clock API point of view this would also allow other drivers to use the same logic since these muxes are a standard idiom for Samsung SoCs.
Quoted 4 lines
What if a device does not operate properly when clocked from one of the available clock sources (lets say machine specific problem)? There must be a way of setting which clock(s) should not be considered when calculating best choice for particular device.
That shudn't be a concern. for example, if some machine doesn't provide clock at some PAD, which could be used as a source, then the clock API wud read the clock as 0 and the calculations wudn't pick that source up. Likewise, any such 'unusable' clock in the machine wud be marked by having invalid(0) rates. The problem is moving this uart-mux into the the Clock API.
PATCH 9/19 drivers: serial: add support for Samsung S5PC110 SoC uart
In reply to Marek SzyprowskiQuoted 4 lines · Marek Szyprowski
What if a device does not operate properly when clocked from one of the available clock sources (lets say machine specific problem)? There must be a way of setting which clock(s) should not be considered when calculating best choice for particular device.
Do you have a real life case where this is true?
PATCH 10/19 ARM: S5PC1XX: add S5PC110 memory map
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds register map for S5PC110 sub-platform.
--- arch/arm/mach-s5pc110/include/mach/map.h | 157 ++++++++++++++++++++++++++++++ 1 files changed, 157 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/include/mach/map.h
arch/arm/mach-s5pc110/include/mach/map.h new file +157 -0
@@ -0,0 +1,157 @@ +/* linux/arch/arm/mach-s5pc110/include/mach/map.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* Based on mach-s3c6400/include/mach/map.h +* +* S5PC110 - Memory map definitions +* +* 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. +*/ + +#ifndef __ASM_ARCH_MAP_H +#define __ASM_ARCH_MAP_H __FILE__ + +#include <plat/map-base.h> + +/* +* map-base.h has already defined virtual memory address +* S3C_VA_IRQ S3C_ADDR(0x00000000) irq controller(s) +* S3C_VA_SYS S3C_ADDR(0x00100000) system control +* S3C_VA_MEM S3C_ADDR(0x00200000) system control (not used) +* S3C_VA_TIMER S3C_ADDR(0x00300000) timer block +* S3C_VA_WATCHDOG S3C_ADDR(0x00400000) watchdog +* S3C_VA_UART S3C_ADDR(0x01000000) UART +* +* S5PC110 specific virtual memory address can be defined here +* S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) GPIO +* +*/ + +/* Chip ID */ +#define S5PC110_PA_CHIPID (0xE0000000) +#define S5PC1XX_PA_CHIPID S5PC110_PA_CHIPID +#define S5PC1XX_VA_CHIPID S3C_VA_SYS + +/* System */ +#define S5PC110_PA_CLK (0xE0100000) +#define S5PC110_PA_PWR (0xE010C000) +#define S5PC1XX_PA_CLK S5PC110_PA_CLK +#define S5PC1XX_PA_PWR S5PC110_PA_PWR +#define S5PC1XX_VA_CLK (S3C_VA_SYS + 0x10000) +#define S5PC1XX_VA_PWR (S3C_VA_SYS + 0x20000) +#define S5PC1XX_SZ_CLK SZ_32K +#define S5PC1XX_SZ_PWR SZ_16K + +/* GPIO */ +#define S5PC110_PA_GPIO (0xE0200000) +#define S5PC1XX_PA_GPIO S5PC110_PA_GPIO +#define S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) + +/* Interrupt */ +#define S5PC110_PA_VIC (0xF2000000) +#define S5PC110_PA_VIC_OFFSET 0x100000 +#define S5PC1XX_PA_VIC (x) (S5PC110_PA_VIC + ((x) * S5PC110_PA_VIC_OFFSET)) +#define S5PC110_VA_VIC S3C_VA_IRQ +#define S5PC110_VA_VIC_OFFSET 0x10000 +#define S5PC1XX_VA_VIC (x) (S5PC110_VA_VIC + ((x) * S5PC110_VA_VIC_OFFSET)) + +/* DMA */ +#define S5PC110_PA_MDMA (0xFA200000) +#define S5PC110_PA_PDMA0 (0xE0900000) +#define S5PC110_PA_PDMA1 (0xE0A00000) + +/* Timer */ +#define S5PC110_PA_TIMER (0xE2500000) +#define S5PC1XX_PA_TIMER S5PC110_PA_TIMER +#define S5PC1XX_VA_TIMER S3C_VA_TIMER + +/* RTC */ +#define S5PC110_PA_RTC (0xEA300000) +#define S5PC1XX_PA_RTC S5PC110_PA_RTC + +/* UART */ +#define S5PC110_PA_UART (0xE2900000) +#define S5PC1XX_PA_UART S5PC110_PA_UART +#define S5PC110_PA_UART0 (S5PC110_PA_UART + 0x0) +#define S5PC110_PA_UART1 (S5PC110_PA_UART + 0x400) +#define S5PC110_PA_UART2 (S5PC110_PA_UART + 0x800) +#define S5PC110_PA_UART3 (S5PC110_PA_UART + 0xC00) +#define S5PC1XX_VA_UART S3C_VA_UART + +/* MFC */ +#define S5PC110_PA_MFC (0xF1700000) + +/* I2C */ +#define S5PC110_PA_I2C (0xE1800000) +#define S5PC110_PA_I2C1 (0xFAB00000) +#define S5PC110_PA_I2C2 (0xE1A00000) + +/* USB HS OTG */ +#define S5PC110_PA_USB_HSOTG (0xEC000000) +#define S5PC110_PA_USB_HSPHY (0xEC100000) + +/* SD/MMC */ +#define S5PC110_PA_HSMMC (x) (0xEB000000 + ((x) * 0x100000)) +#define S5PC110_PA_HSMMC0 S5PC110_PA_HSMMC(0) +#define S5PC110_PA_HSMMC1 S5PC110_PA_HSMMC(1) +#define S5PC110_PA_HSMMC2 S5PC110_PA_HSMMC(2) +#define S5PC110_PA_HSMMC3 S5PC110_PA_HSMMC(2) + +/* LCD */ +#define S5PC110_PA_FB (0xF8000000) + +/* Multimedia */ +#define S5PC11X_PA_MFC (0xF1700000) +#define S5PC11X_SZ_MFC (0x0000FFFF) + +/* I2S */ +#define S5PC110_PA_I2S0 (0xEEE30000) +#define S5PC110_PA_I2S1 (0xE2100000) +#define S5PC110_PA_I2S2 (0xE2A00000) + +/* KEYPAD */ +#define S5PC110_PA_KEYPAD (0xE1600000) + +/* ADC & TouchScreen */ +#define S5PC110_PA_TSADC (0xE1700000) + +/* ETC */ +#define S5PC110_PA_SDRAM (0x30000000) +#define S5PC1XX_PA_SDRAM S5PC110_PA_SDRAM + +/* compatibility defines. */ +#define S3C_PA_RTC S5PC1XX_PA_RTC +#define S3C_PA_UART S5PC1XX_PA_UART +#define S3C_PA_UART0 S5PC110_PA_UART0 +#define S3C_PA_UART1 S5PC110_PA_UART1 +#define S3C_PA_UART2 S5PC110_PA_UART2 +#define S3C_PA_UART3 S5PC110_PA_UART3 + +#define S3C_VA_UART0 (S3C_VA_UART + 0x0) +#define S3C_VA_UART1 (S3C_VA_UART + 0x400) +#define S3C_VA_UART2 (S3C_VA_UART + 0x800) +#define S3C_VA_UART3 (S3C_VA_UART + 0xC00) +#define S3C_UART_OFFSET 0x400 +#define S3C_VA_UARTx (x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET)) + +#define S3C_PA_FB S5PC110_PA_FB +#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x0) +#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) +#define S3C_VA_VIC2 (S3C_VA_IRQ + 0x20000) +#define S3C_VA_VIC3 (S3C_VA_IRQ + 0x30000) +#define S3C_PA_IIC S5PC110_PA_I2C +#define S3C_PA_IIC1 S5PC110_PA_I2C1 +#define S3C_PA_IIC2 S5PC110_PA_I2C2 +#define S3C_PA_USB_HSOTG S5PC110_PA_USB_HSOTG +#define S3C_PA_USB_HSPHY S5PC110_PA_USB_HSPHY +#define S3C_PA_HSMMC0 S5PC110_PA_HSMMC0 +#define S3C_PA_HSMMC1 S5PC110_PA_HSMMC1 +#define S3C_PA_HSMMC2 S5PC110_PA_HSMMC2 +#define S3C_PA_KEYPAD S5PC110_PA_KEYPAD +#define S3C_PA_TSADC S5PC110_PA_TSADC + +#endif /* __ASM_ARCH_C100_MAP_H */
Signature · 1 line
1.6.4
PATCH 10/19 ARM: S5PC1XX: add S5PC110 memory map
There's stuff in here from 'Byungho Min <[email protected]>' but no mention of an ack or signoff from this person.
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 10/19 ARM: S5PC1XX: add S5PC110 memory map
Hi,
Quoted 2 lines · Ben Dooks
There's stuff in here from 'Byungho Min <[email protected]>' but no mention of an ack or signoff from this person.
Mr. Min also works together with me. He knows that this changes since we use the same git.
Thank you,
Kyungmin Park
PATCH 11/19 ARM: S5PC1XX: add S5PC110 cpu initialization code
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds CPU initialization code for S5PC110 sub-platform.
--- arch/arm/mach-s5pc110/Kconfig | 18 ++++ arch/arm/mach-s5pc110/Makefile | 18 ++++ arch/arm/mach-s5pc110/Makefile.boot | 2 + arch/arm/mach-s5pc110/cpu.c | 117 ++++++++++++++++++++++ arch/arm/mach-s5pc110/include/mach/debug-macro.S | 54 ++++++++++ arch/arm/mach-s5pc110/include/mach/entry-macro.S | 56 ++++++++++ arch/arm/mach-s5pc110/include/mach/system.h | 31 ++++++ arch/arm/mach-s5pc110/include/plat/regs-power.h | 80 +++++++++++++++ arch/arm/plat-s5pc1xx/Kconfig | 5 + arch/arm/plat-s5pc1xx/Makefile | 1 + arch/arm/plat-s5pc1xx/cpu.c | 9 ++ arch/arm/plat-s5pc1xx/include/plat/s5pc110.h | 36 +++++++ arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h | 1 + arch/arm/plat-s5pc1xx/s5pc110-init.c | 28 +++++ 14 files changed, 456 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/Kconfig create mode 100644 arch/arm/mach-s5pc110/Makefile create mode 100644 arch/arm/mach-s5pc110/Makefile.boot create mode 100644 arch/arm/mach-s5pc110/cpu.c create mode 100644 arch/arm/mach-s5pc110/include/mach/debug-macro.S create mode 100644 arch/arm/mach-s5pc110/include/mach/entry-macro.S create mode 100644 arch/arm/mach-s5pc110/include/mach/system.h create mode 100644 arch/arm/mach-s5pc110/include/plat/regs-power.h create mode 100644 arch/arm/plat-s5pc1xx/include/plat/s5pc110.h create mode 100644 arch/arm/plat-s5pc1xx/s5pc110-init.c
arch/arm/mach-s5pc110/Kconfig new file +18 -0
@@ -0,0 +1,18 @@ +# arch/arm/mach-s5pc110/Kconfig +# +# Copyright 2009 Samsung Electronics Co. +# Kyungmin Park <[email protected]> +# +# Licensed under GPLv2 + +if ARCH_S5PC110 + +# Configuration options for the S5PC110 CPU + +config CPU_S5PC110 + bool + select CPU_S5PC110_INIT + help + Enable S5PC110 CPU support + +endif
arch/arm/mach-s5pc110/Makefile new file +18 -0
@@ -0,0 +1,18 @@ +# arch/arm/mach-s5pc100/Makefile +# +# Copyright 2009 Samsung Electronics Co. +# +# Licensed under GPLv2 + +obj-y := +obj-m := +obj-n := +obj- := + +# Core support for S5PC110 system + +obj-$(CONFIG_CPU_S5PC110) += cpu.o + +# Helper and device support + +# machine support
arch/arm/mach-s5pc110/Makefile.boot new file +2 -0
@@ -0,0 +1,2 @@ + zreladdr-y := 0x30008000 +params_phys-y := 0x30000100
arch/arm/mach-s5pc110/cpu.c new file +117 -0
117 lines not on this page · raw message
arch/arm/mach-s5pc110/include/mach/debug-macro.S new file +54 -0
54 lines not on this page · raw message
arch/arm/mach-s5pc110/include/mach/entry-macro.S new file +56 -0
56 lines not on this page · raw message
arch/arm/mach-s5pc110/include/mach/system.h new file +31 -0
@@ -0,0 +1,31 @@ +/* linux/arch/arm/mach-s5pc110/include/mach/system.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* S5PC110 - system implementation +* +* Based on mach-s3c6400/include/mach/system.h +*/ + +#ifndef __ASM_ARCH_SYSTEM_H +#define __ASM_ARCH_SYSTEM_H __FILE__ + +#include <linux/io.h> +#include <mach/map.h> +#include <plat/regs-clock.h> + +void (*s5pc1xx_idle)(void ); + +static void arch_idle (void ) +{ +if (s5pc1xx_idle) +s5pc1xx_idle (); +} + +static void arch_reset (char mode,const char *cmd) +{ +__raw_writel (0x1 ,S5PC110_SWRESET ); +return ; +} +#endif /* __ASM_ARCH_IRQ_H */
arch/arm/mach-s5pc110/include/plat/regs-power.h new file +80 -0
80 lines not on this page · raw message
arch/arm/plat-s5pc1xx/Kconfig +5 -0
@@ -45,6 +45,11 @@ config CPU_S5PC100_CLOCK help Common clock support code for the S5PC1XX +config CPU_S5PC110_INIT + bool + help + Common initialisation code for the S5PC1XX + # platform specific device setup endif
arch/arm/plat-s5pc1xx/Makefile +1 -0
@@ -20,6 +20,7 @@ obj-y += gpiolib.o obj-$(CONFIG_CPU_S5PC100_INIT) += s5pc100-init.o obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-plls.o s5pc100-clocks.o +obj-$(CONFIG_CPU_S5PC110_INIT) += s5pc110-init.o # Device setup
arch/arm/plat-s5pc1xx/cpu.c +9 -0
@@ -36,6 +36,7 @@/* table of supported CPUs */ static const char name_s5pc100[] ="S5PC100" ; +static const char name_s5pc110[] ="S5PC110" ;static struct cpu_table cpu_ids[]__initdata = { {
@@ -46,6 +47,14 @@ static struct cpu_table cpu_ids[] __initdata = { .init_uarts = s5pc100_init_uarts, .init = s5pc100_init, .name = name_s5pc100, + }, { + .idcode = 0x43110000, + .idmask = 0xfffff000, + .map_io = s5pc110_map_io, + .init_clocks = s5pc110_init_clocks, + .init_uarts = s5pc110_init_uarts, + .init = s5pc110_init, + .name = name_s5pc110, }, };/* minimal IO mapping */
arch/arm/plat-s5pc1xx/include/plat/s5pc110.h new file +36 -0
@@ -0,0 +1,36 @@ +/* arch/arm/plat-s5pc1xx/include/plat/s5pc100.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* Header file for s5pc100 cpu support +* +* Based on plat-s3c64xx/include/plat/s3c6400.h +* +* 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. +*/ + +/* Common init code for S5PC110 related SoCs */ + +#ifdef CONFIG_CPU_S5PC110 + +extern void s5pc110_map_io (void ); +extern void s5pc110_init_clocks (int xtal); +extern void s5pc110_init_uarts (struct s3c2410_uartcfg *cfg,int no); +extern int s5pc110_init (void ); + +extern void s5pc110_common_init_uarts (struct s3c2410_uartcfg *cfg,int no); +extern void s5pc110_init_irq (void ); +extern void s5pc110_register_clocks (void ); +extern void s5pc110_setup_clocks (void ); + +#else + +#define s5pc110_map_io NULL +#define s5pc110_init_clocks NULL +#define s5pc110_init_uarts NULL +#define s5pc110_init NULL + +#endif
arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h +1 -0
@@ -19,3 +19,4 @@ extern void s5pc1xx_register_clocks(void);extern struct s3c24xx_uart_resources s5pc1xx_uart_resources[];#include <plat/s5pc100.h> +#include <plat/s5pc110.h>
arch/arm/plat-s5pc1xx/s5pc110-init.c new file +28 -0
@@ -0,0 +1,28 @@ +/* +* linux/arch/arm/plat-s5pc1xx/s5pc110-init.c +* +* Copyright 2009 Samsung Electronics Co. +* +* S5PC110 - CPU initialisation +* +* 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. +*/ + +#include <linux/kernel.h> +#include <linux/types.h> +#include <linux/init.h> +#include <linux/clk.h> + +#include <plat/cpu.h> +#include <plat/devs.h> +#include <plat/s5pc1xx.h> + +/* uart registration process */ + +void __init s5pc110_init_uarts (struct s3c2410_uartcfg *cfg,int no) +{ +/* The driver name is s5pc1xx-uart to reuse s5pc1xx_serial_drv */ +s3c24xx_init_uartdevs ("s5pc110-uart" , s5pc1xx_uart_resources, cfg, no); +}
Signature · 1 line
1.6.4
PATCH 12/19 ARM: S5PC1XX: add support for s5pc110 plls and clocks
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds clocks and plls definition for S5PC110 SoCs.
--- arch/arm/mach-s5pc110/Kconfig | 1 + arch/arm/mach-s5pc110/cpu.c | 3 + arch/arm/mach-s5pc110/include/plat/regs-clock.h | 347 ++++++ arch/arm/plat-s5pc1xx/Kconfig | 5 + arch/arm/plat-s5pc1xx/Makefile | 1 + arch/arm/plat-s5pc1xx/include/plat/pll.h | 8 +- arch/arm/plat-s5pc1xx/include/plat/s5pc110.h | 11 + arch/arm/plat-s5pc1xx/s5pc100-plls.c | 8 +- arch/arm/plat-s5pc1xx/s5pc110-clocks.c | 254 +++++ arch/arm/plat-s5pc1xx/s5pc110-plls.c | 1292 +++++++++++++++++++++++ 10 files changed, 1924 insertions(+), 6 deletions(-) create mode 100644 arch/arm/mach-s5pc110/include/plat/regs-clock.h create mode 100644 arch/arm/plat-s5pc1xx/s5pc110-clocks.c create mode 100644 arch/arm/plat-s5pc1xx/s5pc110-plls.c
arch/arm/mach-s5pc110/Kconfig +1 -0
@@ -12,6 +12,7 @@ if ARCH_S5PC110 config CPU_S5PC110 bool select CPU_S5PC110_INIT + select CPU_S5PC110_CLOCK help Enable S5PC110 CPU support
arch/arm/mach-s5pc110/cpu.c +3 -0
@@ -86,6 +86,9 @@ void __init s5pc110_init_clocks(int xtal) {printk (KERN_DEBUG "%s: initialising clocks\n" , __func__);s3c24xx_register_baseclocks (xtal); +s5pc1xx_register_clocks (); +s5pc110_register_clocks (); +s5pc110_setup_clocks (); }void __init s5pc110_init_irq (void )
arch/arm/mach-s5pc110/include/plat/regs-clock.h new file +347 -0
347 lines not on this page · raw message
arch/arm/plat-s5pc1xx/Kconfig +5 -0
@@ -50,6 +50,11 @@ config CPU_S5PC110_INIT help Common initialisation code for the S5PC1XX +config CPU_S5PC110_CLOCK + bool + help + Common clock support code for the S5PC1XX + # platform specific device setup endif
arch/arm/plat-s5pc1xx/Makefile +1 -0
@@ -21,6 +21,7 @@ obj-y += gpiolib.o obj-$(CONFIG_CPU_S5PC100_INIT) += s5pc100-init.o obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-plls.o s5pc100-clocks.o obj-$(CONFIG_CPU_S5PC110_INIT) += s5pc110-init.o +obj-$(CONFIG_CPU_S5PC110_CLOCK) += s5pc110-plls.o s5pc110-clocks.o # Device setup
arch/arm/plat-s5pc1xx/include/plat/pll.h +6 -2
@@ -22,7 +22,7 @@#include <asm/div64.h> static inline unsigned long s5pc1xx_get_pll (unsigned long baseclk, -u32 pllcon) +u32 pllcon,int sub) {u32 mdiv, pdiv, sdiv;u64 fvco = baseclk;
@@ -32,7 +32,11 @@ static inline unsigned long s5pc1xx_get_pll(unsigned long baseclk, sdiv = (pllcon >>S5P_PLL_SDIV_SHIFT ) &S5P_PLL_SDIV_MASK ; fvco *= mdiv; -do_div (fvco, (pdiv << sdiv)); + +if (sub) +do_div (fvco, (pdiv << (sdiv -1 ))); +else +do_div (fvco, (pdiv << sdiv));return (unsigned long )fvco; }
arch/arm/plat-s5pc1xx/include/plat/s5pc110.h +11 -0
@@ -26,6 +26,17 @@ extern void s5pc110_init_irq(void);extern void s5pc110_register_clocks (void );extern void s5pc110_setup_clocks (void ); +extern struct clk clk_hpll; +extern struct clk clk_hd0; +extern struct clk clk_pd0; +extern struct clk clk_54m; +extern struct clk clk_30m; +extern int s5pc110_ip0_ctrl (struct clk *clk,int enable); +extern int s5pc110_ip1_ctrl (struct clk *clk,int enable); +extern int s5pc110_ip2_ctrl (struct clk *clk,int enable); +extern int s5pc110_ip3_ctrl (struct clk *clk,int enable); +extern int s5pc110_ip4_ctrl (struct clk *clk,int enable); +#else #define s5pc110_map_io NULL
arch/arm/plat-s5pc1xx/s5pc100-plls.c +4 -4
@@ -1050,10 +1050,10 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)printk (KERN_DEBUG "%s: xtal is %ld\n" , __func__, xtal); - apll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_APLL_CON )); - mpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_MPLL_CON )); - epll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_EPLL_CON )); - hpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_HPLL_CON )); + apll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_APLL_CON ),0 ); + mpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_MPLL_CON ),0 ); + epll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_EPLL_CON ),0 ); + hpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_HPLL_CON ),0 ); printk(KERN_INFO "S5PC100: Apll=%ld.%03ld Mhz, Mpll=%ld.%03ld Mhz" ", Epll=%ld.%03ld Mhz, Hpll=%ld.%03ld Mhz\n",
arch/arm/plat-s5pc1xx/s5pc110-clocks.c new file +254 -0
254 lines not on this page · raw message
arch/arm/plat-s5pc1xx/s5pc110-plls.c new file +1288 -0
1,288 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 12/19 ARM: S5PC1XX: add support for s5pc110 plls and clocks
Quoted 9 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds clocks and plls definition for S5PC110 SoCs.
Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>
Quoted 11 lines
--- arch/arm/mach-s5pc110/Kconfig | 1 + arch/arm/mach-s5pc110/cpu.c | 3 + arch/arm/mach-s5pc110/include/plat/regs-clock.h | 347 ++++++ arch/arm/plat-s5pc1xx/Kconfig | 5 + arch/arm/plat-s5pc1xx/Makefile | 1 + arch/arm/plat-s5pc1xx/include/plat/pll.h | 8 +- arch/arm/plat-s5pc1xx/include/plat/s5pc110.h | 11 + arch/arm/plat-s5pc1xx/s5pc100-plls.c | 8 +- arch/arm/plat-s5pc1xx/s5pc110-clocks.c | 254 +++++ arch/arm/plat-s5pc1xx/s5pc110-plls.c | 1292 +++++++++++++++++++++++
Are these files likely to be shared with other SoCs? If not, then they would be better off going in arch/arm/mach-s5pc110/ instead of here and just being compiled if the machine support is enabled.
Quoted 2,041 lines
10 files changed, 1924 insertions(+), 6 deletions(-) create mode 100644 arch/arm/mach-s5pc110/include/plat/regs-clock.h create mode 100644 arch/arm/plat-s5pc1xx/s5pc110-clocks.c create mode 100644 arch/arm/plat-s5pc1xx/s5pc110-plls.carch/arm/mach-s5pc110/Kconfig +1
-0@@ -12,6 +12,7 @@ if ARCH_S5PC110 config CPU_S5PC110 bool select CPU_S5PC110_INIT + select CPU_S5PC110_CLOCK help Enable S5PC110 CPU supportarch/arm/mach-s5pc110/cpu.c +3
-0@@ -86,6 +86,9 @@ void __init s5pc110_init_clocks(int xtal) {printk (KERN_DEBUG "%s: initialising clocks\n" , __func__);s3c24xx_register_baseclocks (xtal); +s5pc1xx_register_clocks (); +s5pc110_register_clocks (); +s5pc110_setup_clocks (); }void __init s5pc110_init_irq (void )arch/arm/mach-s5pc110/include/plat/regs-clock.h new file +347
-0@@ -0,0 +1,347 @@ +/* arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* S5PC110 clock register definitions +* +* 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. +*/ + +#ifndef __PLAT_REGS_CLOCK_H +#define __PLAT_REGS_CLOCK_H __FILE__ + +#define S5PC1XX_CLKREG (x) (S5PC1XX_VA_CLK + (x)) + +/* s5pc110 register for clock */ +#define S5PC110_APLL_LOCK S5PC1XX_CLKREG(0x00) +#define S5PC110_MPLL_LOCK S5PC1XX_CLKREG(0x08) +#define S5PC110_EPLL_LOCK S5PC1XX_CLKREG(0x10) +#define S5PC110_VPLL_LOCK S5PC1XX_CLKREG(0x20) + +#define S5PC110_APLL_CON S5PC1XX_CLKREG(0x100) +#define S5PC110_MPLL_CON S5PC1XX_CLKREG(0x108) +#define S5PC110_EPLL_CON S5PC1XX_CLKREG(0x110) +#define S5PC110_VPLL_CON S5PC1XX_CLKREG(0x120) + +#define S5PC110_CLKSRC0 S5PC1XX_CLKREG(0x200) +#define S5PC110_CLKSRC1 S5PC1XX_CLKREG(0x204) +#define S5PC110_CLKSRC2 S5PC1XX_CLKREG(0x208) +#define S5PC110_CLKSRC3 S5PC1XX_CLKREG(0x20C) +#define S5PC110_CLKSRC4 S5PC1XX_CLKREG(0x210) +#define S5PC110_CLKSRC5 S5PC1XX_CLKREG(0x214) +#define S5PC110_CLKSRC6 S5PC1XX_CLKREG(0x218) + +#define S5PC110_CLKSRC_MASK0 S5PC1XX_CLKREG(0x280) +#define S5PC110_CLKSRC_MASK1 S5PC1XX_CLKREG(0x284) + +#define S5PC110_CLKDIV0 S5PC1XX_CLKREG(0x300) +#define S5PC110_CLKDIV1 S5PC1XX_CLKREG(0x304) +#define S5PC110_CLKDIV2 S5PC1XX_CLKREG(0x308) +#define S5PC110_CLKDIV3 S5PC1XX_CLKREG(0x30C) +#define S5PC110_CLKDIV4 S5PC1XX_CLKREG(0x310) +#define S5PC110_CLKDIV5 S5PC1XX_CLKREG(0x314) +#define S5PC110_CLKDIV6 S5PC1XX_CLKREG(0x318) +#define S5PC110_CLKDIV7 S5PC1XX_CLKREG(0x31C) + +#define S5PC110_CLKGATE_IP0 S5PC1XX_CLKREG(0x460) +#define S5PC110_CLKGATE_IP1 S5PC1XX_CLKREG(0x464) +#define S5PC110_CLKGATE_IP2 S5PC1XX_CLKREG(0x468) +#define S5PC110_CLKGATE_IP3 S5PC1XX_CLKREG(0x46C) +#define S5PC110_CLKGATE_IP4 S5PC1XX_CLKREG(0x470) +#define S5PC110_CLKGATE_BLOCK S5PC1XX_CLKREG(0x480) +#define S5PC110_CLKGATE_BUS0 S5PC1XX_CLKREG(0x484) +#define S5PC110_CLKGATE_BUS1 S5PC1XX_CLKREG(0x488) + +#define S5PC110_CLK_OUT S5PC1XX_CLKREG(0x500) +#define S5PC110_MDNIE_SEL S5PC1XX_CLKREG(0x7008) + +#define S5PC110_CLKDIV_STAT0 S5PC1XX_CLKREG(0x1000) +#define S5PC110_CLKDIV_STAT1 S5PC1XX_CLKREG(0x1004) + +#define S5PC110_CLK_MUX_STAT0 S5PC1XX_CLKREG(0x1100) +#define S5PC110_CLK_MUX_STAT1 S5PC1XX_CLKREG(0x1104) + +#define S5PC110_SWRESET S5PC1XX_CLKREG(0x2000) + +#define S5PC110_CLKSRC0_APLL_MASK (0x1<<0) +#define S5PC110_CLKSRC0_APLL_SHIFT (0) +#define S5PC110_CLKSRC0_MPLL_MASK (0x1<<4) +#define S5PC110_CLKSRC0_MPLL_SHIFT (4) +#define S5PC110_CLKSRC0_EPLL_MASK (0x1<<8) +#define S5PC110_CLKSRC0_EPLL_SHIFT (8) +#define S5PC110_CLKSRC0_VPLL_MASK (0x1<<12) +#define S5PC110_CLKSRC0_VPLL_SHIFT (12) +#define S5PC110_CLKSRC0_MUX200_MASK (0x1<<16) +#define S5PC110_CLKSRC0_MUX200_SHIFT (16) +#define S5PC110_CLKSRC0_MUX166_MASK (0x1<<20) +#define S5PC110_CLKSRC0_MUX166_SHIFT (20) +#define S5PC110_CLKSRC0_MUX133_MASK (0x1<<24) +#define S5PC110_CLKSRC0_MUX133_SHIFT (24) +#define S5PC110_CLKSRC0_ONENAND_MASK (0x1<<28) +#define S5PC110_CLKSRC0_ONENAND_SHIFT (28) + +#define S5PC110_CLKSRC1_HDMI_MASK (0x1<<0) +#define S5PC110_CLKSRC1_HDMI_SHIFT (0) +#define S5PC110_CLKSRC1_MIXER_MASK (0x7<<1) +#define S5PC110_CLKSRC1_MIXER_SHIFT (1) +#define S5PC110_CLKSRC1_DAC_MASK (0x1<<8) +#define S5PC110_CLKSRC1_DAC_SHIFT (8) +#define S5PC110_CLKSRC1_CAM0_MASK (0xf<<12) +#define S5PC110_CLKSRC1_CAM0_SHIFT (12) +#define S5PC110_CLKSRC1_CAM1_MASK (0xf<<16) +#define S5PC110_CLKSRC1_CAM1_SHIFT (16) +#define S5PC110_CLKSRC1_FIMD_MASK (0xf<<20) +#define S5PC110_CLKSRC1_FIMD_SHIFT (20) +#define S5PC110_CLKSRC1_CSIS_MASK (0xf<<24) +#define S5PC110_CLKSRC1_CSIS_SHIFT (24) +#define S5PC110_CLKSRC1_VPLLSRC_MASK (0x1<<28) +#define S5PC110_CLKSRC1_VPLLSRC_SHIFT (28) + +#define S5PC110_CLKSRC2_G3D_MASK (0x3<<0) +#define S5PC110_CLKSRC2_G3D_SHIFT (0) +#define S5PC110_CLKSRC2_MFC_MASK (0x3<<4) +#define S5PC110_CLKSRC2_MFC_SHIFT (4) + +#define S5PC110_CLKSRC3_MDNIE_MASK (0xf<<0) +#define S5PC110_CLKSRC3_MDNIE_SHIFT (0) +#define S5PC110_CLKSRC3_MDNIE_PWMCLK_MASK (0xf<<4) +#define S5PC110_CLKSRC3_MDNIE_PWMCLK_SHIFT (4) +#define S5PC110_CLKSRC3_FIMC0_LCLK_MASK (0xf<<12) +#define S5PC110_CLKSRC3_FIMC0_LCLK_SHIFT (12) +#define S5PC110_CLKSRC3_FIMC1_LCLK_MASK (0xf<<16) +#define S5PC110_CLKSRC3_FIMC1_LCLK_SHIFT (16) +#define S5PC110_CLKSRC3_FIMC2_LCLK_MASK (0xf<<20) +#define S5PC110_CLKSRC3_FIMC2_LCLK_SHIFT (20) + +/* CLKSRC4 */ +#define S5PC110_CLKSRC4_MMC0_MASK (0xf<<0) +#define S5PC110_CLKSRC4_MMC0_SHIFT (0) +#define S5PC110_CLKSRC4_MMC1_MASK (0xf<<4) +#define S5PC110_CLKSRC4_MMC1_SHIFT (4) +#define S5PC110_CLKSRC4_MMC2_MASK (0xf<<8) +#define S5PC110_CLKSRC4_MMC2_SHIFT (8) +#define S5PC110_CLKSRC4_MMC3_MASK (0xf<<12) +#define S5PC110_CLKSRC4_MMC3_SHIFT (12) +#define S5PC110_CLKSRC4_UART0_MASK (0xf<<16) +#define S5PC110_CLKSRC4_UART0_SHIFT (16) +#define S5PC110_CLKSRC4_UART1_MASK (0xf<<20) +#define S5PC110_CLKSRC4_UART1_SHIFT (20) +#define S5PC110_CLKSRC4_UART2_MASK (0xf<<24) +#define S5PC110_CLKSRC4_UART2_SHIFT (24) +#define S5PC110_CLKSRC4_UART3_MASK (0xf<<28) +#define S5PC110_CLKSRC4_UART3_SHIFT (28) + +/* CLKSRC5 */ +#define S5PC110_CLKSRC5_SPI0_MASK (0xf<<0) +#define S5PC110_CLKSRC5_SPI0_SHIFT (0) +#define S5PC110_CLKSRC5_SPI1_MASK (0xf<<4) +#define S5PC110_CLKSRC5_SPI1_SHIFT (4) +#define S5PC110_CLKSRC5_SPI2_MASK (0xf<<8) +#define S5PC110_CLKSRC5_SPI2_SHIFT (8) +#define S5PC110_CLKSRC5_PWM_MASK (0xf<<12) +#define S5PC110_CLKSRC5_PWM_SHIFT (12) + +/* CLKSRC6 */ +#define S5PC110_CLKSRC6_AUDIO0_MASK (0xf<<0) +#define S5PC110_CLKSRC6_AUDIO0_SHIFT (0) +#define S5PC110_CLKSRC6_AUDIO1_MASK (0xf<<4) +#define S5PC110_CLKSRC6_AUDIO1_SHIFT (4) +#define S5PC110_CLKSRC6_AUDIO2_MASK (0xf<<8) +#define S5PC110_CLKSRC6_AUDIO2_SHIFT (4) +#define S5PC110_CLKSRC6_SPDIF_MASK (0x3<<12) +#define S5PC110_CLKSRC6_SPDIF_SHIFT (12) +#define S5PC110_CLKSRC6_HPM_MASK (0x1<<16) +#define S5PC110_CLKSRC6_HPM_SHIFT (16) +#define S5PC110_CLKSRC6_PWI_MASK (0xf<<20) +#define S5PC110_CLKSRC6_PWI_SHIFT (20) +#define S5PC110_CLKSRC6_ONEDRAM_MASK (0x3<<24) +#define S5PC110_CLKSRC6_ONEDRAM_SHIFT (24) + +#define S5PC110_CLKDIV0_APLL_MASK (0x7<<0) +#define S5PC110_CLKDIV0_APLL_SHIFT (0) +#define S5PC110_CLKDIV0_A2M_MASK (0x7<<4) +#define S5PC110_CLKDIV0_A2M_SHIFT (4) +#define S5PC110_CLKDIV0_HCLK_MSYS_MASK (0x7<<8) +#define S5PC110_CLKDIV0_HCLK_MSYS_SHIFT (8) +#define S5PC110_CLKDIV0_PCLK_MSYS_MASK (0x7<<12) +#define S5PC110_CLKDIV0_PCLK_MSYS_SHIFT (12) +#define S5PC110_CLKDIV0_HCLK_DSYS_MASK (0xf<<16) +#define S5PC110_CLKDIV0_HCLK_DSYS_SHIFT (16) +#define S5PC110_CLKDIV0_PCLK_DSYS_MASK (0x7<<20) +#define S5PC110_CLKDIV0_PCLK_DSYS_SHIFT (20) +#define S5PC110_CLKDIV0_HCLK_PSYS_MASK (0xf<<24) +#define S5PC110_CLKDIV0_HCLK_PSYS_SHIFT (24) +#define S5PC110_CLKDIV0_PCLK_PSYS_MASK (0x7<<28) +#define S5PC110_CLKDIV0_PCLK_PSYS_SHIFT (28) + +#define S5PC110_CLKDIV1_TBLK_MASK (0xf<<0) +#define S5PC110_CLKDIV1_TBLK_SHIFT (0) +#define S5PC110_CLKDIV1_FIMC_MASK (0xf<<8) +#define S5PC110_CLKDIV1_FIMC_SHIFT (8) +#define S5PC110_CLKDIV1_CAM0_MASK (0xf<<12) +#define S5PC110_CLKDIV1_CAM0_SHIFT (12) +#define S5PC110_CLKDIV1_CAM1_MASK (0xf<<16) +#define S5PC110_CLKDIV1_CAM1_SHIFT (16) +#define S5PC110_CLKDIV1_FIMD_MASK (0xf<<20) +#define S5PC110_CLKDIV1_FIMD_SHIFT (20) +#define S5PC110_CLKDIV1_CSIS_MASK (0xf<<28) +#define S5PC110_CLKDIV1_CSIS_SHIFT (28) + +#define S5PC110_CLKDIV2_G3D_MASK (0xf<<0) +#define S5PC110_CLKDIV2_G3D_SHIFT (0) +#define S5PC110_CLKDIV2_MFC_MASK (0xf<<4) +#define S5PC110_CLKDIV2_MFC_SHIFT (4) + +#define S5PC110_CLKDIV3_MDNIE_MASK (0xf<<0) +#define S5PC110_CLKDIV3_MDNIE_SHIFT (0) +#define S5PC110_CLKDIV3_MDNIE_PWM_MASK (0x7f<<4) +#define S5PC110_CLKDIV3_MDNIE_PWM_SHIFT (4) +#define S5PC110_CLKDIV3_FIMC0_LCLK_MASK (0xf<<12) +#define S5PC110_CLKDIV3_FIMC0_LCLK_SHIFT (12) +#define S5PC110_CLKDIV3_FIMC1_LCLK_MASK (0xf<<16) +#define S5PC110_CLKDIV3_FIMC1_LCLK_SHIFT (16) +#define S5PC110_CLKDIV3_FIMC2_LCLK_MASK (0xf<<20) +#define S5PC110_CLKDIV3_FIMC2_LCLK_SHIFT (20) + +#define S5PC110_CLKDIV4_MMC0_MASK (0xf<<0) +#define S5PC110_CLKDIV4_MMC0_SHIFT (0) +#define S5PC110_CLKDIV4_MMC1_MASK (0xf<<4) +#define S5PC110_CLKDIV4_MMC1_SHIFT (4) +#define S5PC110_CLKDIV4_MMC2_MASK (0xf<<8) +#define S5PC110_CLKDIV4_MMC2_SHIFT (8) +#define S5PC110_CLKDIV4_MMC3_MASK (0xf<<12) +#define S5PC110_CLKDIV4_MMC3_SHIFT (12) +#define S5PC110_CLKDIV4_UART0_MASK (0xf<<16) +#define S5PC110_CLKDIV4_UART0_SHIFT (16) +#define S5PC110_CLKDIV4_UART1_MASK (0xf<<20) +#define S5PC110_CLKDIV4_UART1_SHIFT (20) +#define S5PC110_CLKDIV4_UART2_MASK (0xf<<24) +#define S5PC110_CLKDIV4_UART2_SHIFT (24) +#define S5PC110_CLKDIV4_UART3_MASK (0xf<<28) +#define S5PC110_CLKDIV4_UART3_SHIFT (28) + +/* CLK_DIV5 */ +#define S5PC110_CLKDIV5_SPI0_MASK (0xf<<0) +#define S5PC110_CLKDIV5_SPI0_SHIFT (0) +#define S5PC110_CLKDIV5_SPI1_MASK (0xf<<4) +#define S5PC110_CLKDIV5_SPI1_SHIFT (4) +#define S5PC110_CLKDIV5_SPI2_MASK (0xf<<8) +#define S5PC110_CLKDIV5_SPI2_SHIFT (8) +#define S5PC110_CLKDIV5_PWM_MASK (0xf<<120) +#define S5PC110_CLKDIV5_PWM_SHIFT (12) + +/* CLK_DIV6 */ +#define S5PC110_CLKDIV6_AUDIO0_MASK (0xf<<0) +#define S5PC110_CLKDIV6_AUDIO0_SHIFT (0) +#define S5PC110_CLKDIV6_AUDIO1_MASK (0xf<<4) +#define S5PC110_CLKDIV6_AUDIO1_SHIFT (4) +#define S5PC110_CLKDIV6_AUDIO2_MASK (0xf<<8) +#define S5PC110_CLKDIV6_AUDIO2_SHIFT (8) +#define S5PC110_CLKDIV6_ONENAND_MASK (0x7<<12) +#define S5PC110_CLKDIV6_ONENAND_SHIFT (12) +#define S5PC110_CLKDIV6_COPY_MASK (0x7<<16) +#define S5PC110_CLKDIV6_COPY_SHIFT (16) +#define S5PC110_CLKDIV6_HPM_MASK (0x7<<20) +#define S5PC110_CLKDIV6_HPM_SHIFT (20) +#define S5PC110_CLKDIV6_PWI_MASK (0xf<<24) +#define S5PC110_CLKDIV6_PWI_SHIFT (24) +#define S5PC110_CLKDIV6_ONEDRAM_MASK (0xf<<28) +#define S5PC110_CLKDIV6_ONEDRAM_SHIFT (28) + +/* Clock Gate IP0 */ +#define S5PC110_CLKGATE_IP0_DMC0 (1<<0) +#define S5PC110_CLKGATE_IP0_DMC1 (1<<1) +#define S5PC110_CLKGATE_IP0_MDMA (1<<2) +#define S5PC110_CLKGATE_IP0_PDMA0 (1<<3) +#define S5PC110_CLKGATE_IP0_PDMA1 (1<<4) +#define S5PC110_CLKGATE_IP0_IMEM (1<<5) +#define S5PC110_CLKGATE_IP0_G3D (1<<8) +#define S5PC110_CLKGATE_IP0_MFC (1<<16) +#define S5PC110_CLKGATE_IP0_FIMC0 (1<<24) +#define S5PC110_CLKGATE_IP0_FIMC1 (1<<25) +#define S5PC110_CLKGATE_IP0_FIMC2 (1<<26) +#define S5PC110_CLKGATE_IP0_JPEG (1<<28) +#define S5PC110_CLKGATE_IP0_ROTATOR (1<<29) +#define S5PC110_CLKGATE_IP0_IPC (1<<30) +#define S5PC110_CLKGATE_IP0_CSIS (1<<31) + +/* Clock Gate IP1 */ +#define S5PC110_CLKGATE_IP1_FIMD (1<<0) +#define S5PC110_CLKGATE_IP1_MIE (1<<1) +#define S5PC110_CLKGATE_IP1_DSIM (1<<2) +#define S5PC110_CLKGATE_IP1_VP (1<<8) +#define S5PC110_CLKGATE_IP1_MIXER (1<<9) +#define S5PC110_CLKGATE_IP1_TVENC (1<<10) +#define S5PC110_CLKGATE_IP1_HDMI (1<<11) +#define S5PC110_CLKGATE_IP1_USBOTG (1<<16) +#define S5PC110_CLKGATE_IP1_USBHOST (1<<17) +#define S5PC110_CLKGATE_IP1_NANDXL (1<<24) +#define S5PC110_CLKGATE_IP1_CFCON (1<<25) +#define S5PC110_CLKGATE_IP1_SROMC (1<<26) +#define S5PC110_CLKGATE_IP1_NFCON (1<<28) + +/* Clock Gate IP2 */ +#define S5PC110_CLKGATE_IP2_SECSS (1<<0) +#define S5PC110_CLKGATE_IP2_SDM (1<<1) +#define S5PC110_CLKGATE_IP2_CORESIGHT (1<<8) +#define S5PC110_CLKGATE_IP2_MODEM (1<<9) +#define S5PC110_CLKGATE_IP2_HOSTIF (1<<10) +#define S5PC110_CLKGATE_IP2_SECJTAG (1<<11) +#define S5PC110_CLKGATE_IP2_HSMMC0 (1<<16) +#define S5PC110_CLKGATE_IP2_HSMMC1 (1<<17) +#define S5PC110_CLKGATE_IP2_HSMMC2 (1<<18) +#define S5PC110_CLKGATE_IP2_HSMMC3 (1<<19) +#define S5PC110_CLKGATE_IP2_TSI (1<<20) +#define S5PC110_CLKGATE_IP2_VIC0 (1<<24) +#define S5PC110_CLKGATE_IP2_VIC1 (1<<25) +#define S5PC110_CLKGATE_IP2_VIC2 (1<<26) +#define S5PC110_CLKGATE_IP2_VIC3 (1<<27) +#define S5PC110_CLKGATE_IP2_TZIC0 (1<<28) +#define S5PC110_CLKGATE_IP2_TZIC1 (1<<29) +#define S5PC110_CLKGATE_IP2_TZIC2 (1<<30) +#define S5PC110_CLKGATE_IP2_TZIC3 (1<<31) + +/* Clock Gate IP3 */ +#define S5PC110_CLKGATE_IP3_SPDIF (1<<0) +#define S5PC110_CLKGATE_IP3_AC97 (1<<1) +#define S5PC110_CLKGATE_IP3_I2S0 (1<<4) +#define S5PC110_CLKGATE_IP3_I2S1 (1<<5) +#define S5PC110_CLKGATE_IP3_I2S2 (1<<6) +#define S5PC110_CLKGATE_IP3_I2C0 (1<<7) +#define S5PC110_CLKGATE_IP3_I2C1 (1<<8) +#define S5PC110_CLKGATE_IP3_I2C2 (1<<9) +#define S5PC110_CLKGATE_IP3_I2C_HDMI_DDC (1<<10) +#define S5PC110_CLKGATE_IP3_I2C_HDMI_PHY (1<<11) +#define S5PC110_CLKGATE_IP3_SPI0 (1<<12) +#define S5PC110_CLKGATE_IP3_SPI1 (1<<13) +#define S5PC110_CLKGATE_IP3_SPI2 (1<<14) +#define S5PC110_CLKGATE_IP3_RTC (1<<15) +#define S5PC110_CLKGATE_IP3_SYSTIMER (1<<16) +#define S5PC110_CLKGATE_IP3_UART0 (1<<17) +#define S5PC110_CLKGATE_IP3_UART1 (1<<18) +#define S5PC110_CLKGATE_IP3_UART2 (1<<19) +#define S5PC110_CLKGATE_IP3_UART3 (1<<20) +#define S5PC110_CLKGATE_IP3_KEYIF (1<<21) +#define S5PC110_CLKGATE_IP3_WDT (1<<22) +#define S5PC110_CLKGATE_IP3_PWM (1<<23) +#define S5PC110_CLKGATE_IP3_TSADC (1<<24) +#define S5PC110_CLKGATE_IP3_GPIO (1<<26) +#define S5PC110_CLKGATE_IP3_SYSCON (1<<27) +#define S5PC110_CLKGATE_IP3_PCM0 (1<<28) +#define S5PC110_CLKGATE_IP3_PCM1 (1<<29) +#define S5PC110_CLKGATE_IP3_PCM2 (1<<30) + +/* Clock Gate IP4 */ +#define S5PC110_CLKGATE_IP4_CHIP_ID (1<<0) +#define S5PC110_CLKGATE_IP4_IEM_IEC (1<<1) +#define S5PC110_CLKGATE_IP4_IEM_APC (1<<2) +#define S5PC110_CLKGATE_IP4_SECKEY (1<<3) +#define S5PC110_CLKGATE_IP4_TZPC0 (1<<5) +#define S5PC110_CLKGATE_IP4_TZPC1 (1<<6) +#define S5PC110_CLKGATE_IP4_TZPC2 (1<<7) +#define S5PC110_CLKGATE_IP4_TZPC3 (1<<8) + +#endif /* _PLAT_REGS_CLOCK_H */ arch/arm/plat-s5pc1xx/Kconfig +5
-0@@ -50,6 +50,11 @@ config CPU_S5PC110_INIT help Common initialisation code for the S5PC1XX +config CPU_S5PC110_CLOCK + bool + help + Common clock support code for the S5PC1XX + # platform specific device setup endifarch/arm/plat-s5pc1xx/Makefile +1
-0@@ -21,6 +21,7 @@ obj-y += gpiolib.o obj-$(CONFIG_CPU_S5PC100_INIT) += s5pc100-init.o obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-plls.o s5pc100-clocks.o obj-$(CONFIG_CPU_S5PC110_INIT) += s5pc110-init.o +obj-$(CONFIG_CPU_S5PC110_CLOCK) += s5pc110-plls.o s5pc110-clocks.o # Device setuparch/arm/plat-s5pc1xx/include/plat/pll.h +6
-2@@ -22,7 +22,7 @@#include <asm/div64.h> static inline unsigned long s5pc1xx_get_pll (unsigned long baseclk, -u32 pllcon) +u32 pllcon,int sub) {u32 mdiv, pdiv, sdiv;u64 fvco = baseclk;@@ -32,7 +32,11 @@ static inline unsigned long s5pc1xx_get_pll(unsigned long baseclk, sdiv = (pllcon >>S5P_PLL_SDIV_SHIFT ) &S5P_PLL_SDIV_MASK ; fvco *= mdiv; -do_div (fvco, (pdiv << sdiv)); + +if (sub) +do_div (fvco, (pdiv << (sdiv -1 ))); +else +do_div (fvco, (pdiv << sdiv));return (unsigned long )fvco; }arch/arm/plat-s5pc1xx/include/plat/s5pc110.h +11
-0@@ -26,6 +26,17 @@ extern void s5pc110_init_irq(void);extern void s5pc110_register_clocks (void );extern void s5pc110_setup_clocks (void ); +extern struct clk clk_hpll; +extern struct clk clk_hd0; +extern struct clk clk_pd0; +extern struct clk clk_54m; +extern struct clk clk_30m; +extern int s5pc110_ip0_ctrl (struct clk *clk,int enable); +extern int s5pc110_ip1_ctrl (struct clk *clk,int enable); +extern int s5pc110_ip2_ctrl (struct clk *clk,int enable); +extern int s5pc110_ip3_ctrl (struct clk *clk,int enable); +extern int s5pc110_ip4_ctrl (struct clk *clk,int enable); +#else #define s5pc110_map_io NULLarch/arm/plat-s5pc1xx/s5pc100-plls.c +4
-4@@ -1050,10 +1050,10 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)printk (KERN_DEBUG "%s: xtal is %ld\n" , __func__, xtal); - apll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_APLL_CON )); - mpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_MPLL_CON )); - epll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_EPLL_CON )); - hpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_HPLL_CON )); + apll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_APLL_CON ),0 ); + mpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_MPLL_CON ),0 ); + epll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_EPLL_CON ),0 ); + hpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_HPLL_CON ),0 ); printk(KERN_INFO "S5PC100: Apll=%ld.%03ld Mhz, Mpll=%ld.%03ld Mhz" ", Epll=%ld.%03ld Mhz, Hpll=%ld.%03ld Mhz\n",arch/arm/plat-s5pc1xx/s5pc110-clocks.c new file +254
-0@@ -0,0 +1,254 @@ +/* linux/arch/arm/plat-s5pc1xx/s5pc110-clocks.c +* +* Copyright 2009 Samsung Electronics Co. +* +* S5PC110 - Clocks support +* +* Based on plat-s3c64xx/clock.c +* +* 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. +*/ + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/interrupt.h> +#include <linux/ioport.h> +#include <linux/clk.h> +#include <linux/io.h> + +#include <mach/hardware.h> +#include <mach/map.h> + +#include <plat/regs-clock.h> +#include <plat/devs.h> +#include <plat/clock.h> + +struct clk clk_27m = { + .name ="clk_27m" , + .id =-1 , + .rate =27000000 , +}; + +struct clk clk_48m = { + .name ="clk_48m" , + .id =-1 , + .rate =48000000 , +}; + +struct clk clk_54m = { + .name ="clk_54m" , + .id =-1 , + .rate =54000000 , +}; + +struct clk clk_30m = { + .name ="clk_30m" , + .id =-1 , + .rate =30000000 , +}; + +static int s5pc1xx_clk_gate (void __iomem *reg,struct clk *clk,int enable) +{ +unsigned int ctrlbit = clk->ctrlbit; +u32 con; + + con =__raw_readl (reg); +if (enable) + con |= ctrlbit; +else + con &= ~ctrlbit; +__raw_writel (con, reg); + +return 0 ; +} + +int s5pc110_ip0_ctrl (struct clk *clk,int enable) +{ +return s5pc1xx_clk_gate (S5PC110_CLKGATE_IP0 , clk, enable); +} + +int s5pc110_ip1_ctrl (struct clk *clk,int enable) +{ +return s5pc1xx_clk_gate (S5PC110_CLKGATE_IP1 , clk, enable); +} + +int s5pc110_ip2_ctrl (struct clk *clk,int enable) +{ +return s5pc1xx_clk_gate (S5PC110_CLKGATE_IP2 , clk, enable); +} + +int s5pc110_ip3_ctrl (struct clk *clk,int enable) +{ +return s5pc1xx_clk_gate (S5PC110_CLKGATE_IP3 , clk, enable); +} + +int s5pc110_ip4_ctrl (struct clk *clk,int enable) +{ +return s5pc1xx_clk_gate (S5PC110_CLKGATE_IP4 , clk, enable); +} + +extern struct clk clk_dout_hclkm; +extern struct clk clk_dout_hclkd; +extern struct clk clk_dout_hclkp; +extern struct clk clk_dout_pclkd; +extern struct clk clk_dout_pclkp; + +static struct clk s5pc110_init_clocks_disable[] = { + { + .name ="keypad" , + .id =-1 , + .parent = &clk_dout_pclkp, + .enable = s5pc110_ip3_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP3_KEYIF , + }, +}; + +static struct clk s5pc110_init_clocks[] = { +/* IP0 */ + { + .name ="mfc" , + .id =-1 , + .parent =NULL , + .enable = s5pc110_ip0_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP0_MFC , + }, + +/* IP1 */ + { + .name ="lcd" , + .id =-1 , + .parent = &clk_dout_hclkd, + .enable = s5pc110_ip1_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP1_FIMD , + }, { + .name ="otg" , + .id =-1 , + .parent = &clk_dout_hclkp, + .enable = s5pc110_ip1_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP1_USBOTG , + }, + +/* IP2 */ + { + .name ="hsmmc" , + .id =0 , + .parent = &clk_dout_hclkp, + .enable = s5pc110_ip2_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP2_HSMMC0 , + }, { + .name ="hsmmc" , + .id =1 , + .parent = &clk_dout_hclkp, + .enable = s5pc110_ip2_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP2_HSMMC1 , + }, { + .name ="hsmmc" , + .id =2 , + .parent = &clk_dout_hclkp, + .enable = s5pc110_ip2_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP2_HSMMC2 , + }, { + .name ="hsmmc" , + .id =3 , + .parent = &clk_dout_hclkp, + .enable = s5pc110_ip2_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP2_HSMMC3 , + }, +/* IP3 */ + { + .name ="iis" , + .id =0 , + .parent = &clk_dout_pclkp, + .enable = s5pc110_ip3_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP3_I2S0 , + }, { + .name ="iis" , + .id =1 , + .parent = &clk_dout_pclkp, + .enable = s5pc110_ip3_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP3_I2S1 , + }, { + .name ="iis" , + .id =2 , + .parent = &clk_dout_pclkp, + .enable = s5pc110_ip3_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP3_I2S2 , + }, { + .name ="i2c" , + .id =0 , + .parent = &clk_dout_pclkp, + .enable = s5pc110_ip3_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP3_I2C0 , + }, { + .name ="i2c" , + .id =1 , + .parent = &clk_dout_pclkd, + .enable = s5pc110_ip3_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP3_I2C1 , + }, { + .name ="i2c" , + .id =2 , + .parent = &clk_dout_pclkp, + .enable = s5pc110_ip3_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP3_I2C2 , + }, { + .name ="timers" , + .id =-1 , + .parent = &clk_dout_pclkp, + .enable = s5pc110_ip3_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP3_PWM , + }, { + .name ="adc" , + .id =-1 , + .parent = &clk_dout_pclkp, + .enable = s5pc110_ip3_ctrl, + .ctrlbit =S5PC110_CLKGATE_IP3_TSADC , + }, +}; + +static struct clk *clks[]__initdata = { + &clk_ext, + &clk_epll, + &clk_27m, + &clk_30m, + &clk_48m, + &clk_54m, +}; + +void __init s5pc1xx_register_clocks (void ) +{ +struct clk *clkp; +int ret; +int ptr; +int size; + +s3c24xx_register_clocks (clks,ARRAY_SIZE (clks)); + + clkp = s5pc110_init_clocks; + size =ARRAY_SIZE (s5pc110_init_clocks); + +for (ptr =0 ; ptr < size; ptr++, clkp++) { + ret =s3c24xx_register_clock (clkp); +if (ret <0 ) { +printk (KERN_ERR "Failed to register clock %s (%d)\n" , + clkp->name, ret); + } + } + + clkp = s5pc110_init_clocks_disable; + size =ARRAY_SIZE (s5pc110_init_clocks_disable); + +for (ptr =0 ; ptr < size; ptr++, clkp++) { + ret =s3c24xx_register_clock (clkp); +if (ret <0 ) { +printk (KERN_ERR "Failed to register clock %s (%d)\n" , + clkp->name, ret); + } + + (clkp->enable)(clkp,0 ); + } + +s3c_pwmclk_init (); +}arch/arm/plat-s5pc1xx/s5pc110-plls.c new file +1288
-0@@ -0,0 +1,1288 @@ +/* +* linux/arch/arm/plat-s5pc1xx/s5pc110-plls.c +* +* Copyright 2009 Samsung Electronics, Co. +* Minkyu Kang <[email protected]> +* +* S5PC110 based common clock support +* +* 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. +*/ + +#include <linux/init.h> +#include <linux/module.h> +#include <linux/kernel.h> +#include <linux/list.h> +#include <linux/errno.h> +#include <linux/err.h> +#include <linux/clk.h> +#include <linux/sysdev.h> +#include <linux/io.h> + +#include <mach/hardware.h> +#include <mach/map.h> + +#include <plat/cpu-freq.h> + +#include <plat/regs-clock.h> +#include <plat/clock.h> +#include <plat/cpu.h> +#include <plat/pll.h> +#include <plat/devs.h> +#include <plat/s5pc1xx.h> + +static struct clk clk_ext_xtal_mux = { + .name ="ext_xtal" , + .id =-1 , +}; + +#define clk_fin_apll clk_ext_xtal_mux +#define clk_fin_mpll clk_ext_xtal_mux +#define clk_fin_epll clk_ext_xtal_mux +#define clk_fin_vpll clk_ext_xtal_mux +#define clk_hdmi_phy clk_ext_xtal_mux + +#define clk_fout_mpll clk_mpll +#define clk_hdmi_27m clk_27m +#define clk_usbphy0 clk_30m +#define clk_usbphy1 clk_48m + +static struct clk clk_usb_xtal = { + .name ="usb_xtal" , + .id =-1 , +}; + +static struct clk clk_pcm_cd0 = { + .name ="pcm_cdclk0" , + .id =-1 , +}; + +static struct clk clk_pcm_cd1 = { + .name ="pcm_cdclk1" , + .id =-1 , +}; + +static struct clk clk_iis_cd1 = { + .name ="iis_cdclk1" , + .id =-1 , +}; + +struct clk_sources { +unsigned int nr_sources; +struct clk **sources; +}; + +struct clksrc_clk { +struct clk clk; +unsigned int mask; +unsigned int shift; + +struct clk_sources *sources; + +unsigned int divider_shift; +void __iomem *reg_divider; +void __iomem *reg_source; +}; + +/* APLL */ +static struct clk clk_fout_apll = { + .name ="fout_apll" , + .id =-1 , +}; + +static struct clk *clk_src_apll_list[] = { + [0 ] = &clk_fin_apll, + [1 ] = &clk_fout_apll, +}; + +static struct clk_sources clk_src_apll = { + .sources = clk_src_apll_list, + .nr_sources =ARRAY_SIZE (clk_src_apll_list), +}; + +static struct clksrc_clk clk_mout_apll = { + .clk = { + .name ="mout_apll" , + .id =-1 , + }, + .shift =S5PC110_CLKSRC0_APLL_SHIFT , + .mask =S5PC110_CLKSRC0_APLL_MASK , + .sources = &clk_src_apll, + .reg_source =S5PC110_CLKSRC0 , +}; + +/* MPLL */ +static struct clk *clk_src_mpll_list[] = { + [0 ] = &clk_fin_mpll, + [1 ] = &clk_fout_mpll, +}; + +static struct clk_sources clk_src_mpll = { + .sources = clk_src_mpll_list, + .nr_sources =ARRAY_SIZE (clk_src_mpll_list), +}; + +static struct clksrc_clk clk_mout_mpll = { + .clk = { + .name ="mout_mpll" , + .id =-1 , + }, + .shift =S5PC110_CLKSRC0_MPLL_SHIFT , + .mask =S5PC110_CLKSRC0_MPLL_MASK , + .sources = &clk_src_mpll, + .reg_source =S5PC110_CLKSRC0 , +}; + +static int s5pc110_default_enable (struct clk *clk,int enable) +{ +return 0 ; +} + +/* EPLL */ +static struct clk clk_fout_epll = { + .name ="fout_epll" , + .id =-1 , + .enable = s5pc110_default_enable, +}; + +static struct clk *clk_src_epll_list[] = { + [0 ] = &clk_fin_epll, + [1 ] = &clk_fout_epll, +}; + +static struct clk_sources clk_src_epll = { + .sources = clk_src_epll_list, + .nr_sources =ARRAY_SIZE (clk_src_epll_list), +}; + +static struct clksrc_clk clk_mout_epll = { + .clk = { + .name ="mout_epll" , + .id =-1 , + }, + .shift =S5PC110_CLKSRC0_EPLL_SHIFT , + .mask =S5PC110_CLKSRC0_EPLL_MASK , + .sources = &clk_src_epll, + .reg_source =S5PC110_CLKSRC0 , +}; + +/* VPLLSRC */ +static struct clk *clk_src_vpllsrc_list[] = { + [0 ] = &clk_fin_vpll, + [1 ] = &clk_hdmi_27m, +}; + +static struct clk_sources clk_src_vpllsrc = { + .sources = clk_src_vpllsrc_list, + .nr_sources =ARRAY_SIZE (clk_src_vpllsrc_list), +}; + +static struct clksrc_clk clk_mout_vpllsrc = { + .clk = { + .name ="mout_vpllsrc" , + .id =-1 , + }, + .shift =S5PC110_CLKSRC1_VPLLSRC_SHIFT , + .mask =S5PC110_CLKSRC1_VPLLSRC_MASK , + .sources = &clk_src_vpllsrc, + .reg_source =S5PC110_CLKSRC1 , +}; + +/* VPLL */ +static struct clk clk_fout_vpll = { + .name ="fout_vpll" , + .id =-1 , +}; + +static struct clk *clk_src_vpll_list[] = { + [0 ] = &clk_mout_vpllsrc.clk, + [1 ] = &clk_fout_vpll, +}; + +static struct clk_sources clk_src_vpll = { + .sources = clk_src_vpll_list, + .nr_sources =ARRAY_SIZE (clk_src_vpll_list), +}; + +static struct clksrc_clk clk_mout_vpll = { + .clk = { + .name ="mout_vpll" , + .id =-1 , + }, + .shift =S5PC110_CLKSRC0_VPLL_SHIFT , + .mask =S5PC110_CLKSRC0_VPLL_MASK , + .sources = &clk_src_vpll, + .reg_source =S5PC110_CLKSRC0 , +}; + +/* Dout A2M */ +static unsigned long s5pc110_clk_dout_a2m_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +unsigned int ratio; + + ratio =__raw_readl (S5PC110_CLKDIV0 ) &S5PC110_CLKDIV0_A2M_MASK ; + ratio >>=S5PC110_CLKDIV0_A2M_SHIFT ; + +return rate / (ratio +1 ); +} + +static struct clk clk_dout_a2m = { + .name ="dout_a2m" , + .id =-1 , + .parent = &clk_mout_apll.clk, + .get_rate = s5pc110_clk_dout_a2m_get_rate, +}; + +/* HPM */ +static struct clk *clk_src_hpm_list[] = { + [0 ] = &clk_mout_apll.clk, + [1 ] = &clk_mout_mpll.clk, +}; + +static struct clk_sources clk_src_hpm = { + .sources = clk_src_hpm_list, + .nr_sources =ARRAY_SIZE (clk_src_hpm_list), +}; + +static struct clksrc_clk clk_mout_hpm = { + .clk = { + .name ="mout_hpm" , + .id =-1 , + }, + .shift =S5PC110_CLKSRC6_HPM_SHIFT , + .mask =S5PC110_CLKSRC6_HPM_MASK , + .sources = &clk_src_hpm, + .reg_source =S5PC110_CLKSRC6 , +}; + +/* MSYS */ +static struct clk *clk_src_msys_list[] = { + [0 ] = &clk_mout_apll.clk, + [1 ] = &clk_mout_mpll.clk, +}; + +static struct clk_sources clk_src_msys = { + .sources = clk_src_msys_list, + .nr_sources =ARRAY_SIZE (clk_src_msys_list), +}; + +static struct clksrc_clk clk_mout_msys = { + .clk = { + .name ="mout_msys" , + .id =-1 , + }, + .shift =S5PC110_CLKSRC0_MUX200_SHIFT , + .mask =S5PC110_CLKSRC0_MUX200_MASK , + .sources = &clk_src_msys, + .reg_source =S5PC110_CLKSRC0 , +}; + +/* DSYS */ +static struct clk *clk_src_dsys_list[] = { + [0 ] = &clk_mout_mpll.clk, + [1 ] = &clk_dout_a2m, +}; + +static struct clk_sources clk_src_dsys = { + .sources = clk_src_dsys_list, + .nr_sources =ARRAY_SIZE (clk_src_dsys_list), +}; + +struct clksrc_clk clk_mout_dsys = { + .clk = { + .name ="mout_dsys" , + .id =-1 , + }, + .shift =S5PC110_CLKSRC0_MUX166_SHIFT , + .mask =S5PC110_CLKSRC0_MUX166_MASK , + .sources = &clk_src_dsys, + .reg_source =S5PC110_CLKSRC0 , +}; + +/* PSYS */ +static struct clk *clk_src_psys_list[] = { + [0 ] = &clk_mout_mpll.clk, + [1 ] = &clk_dout_a2m, +}; + +static struct clk_sources clk_src_psys = { + .sources = clk_src_psys_list, + .nr_sources =ARRAY_SIZE (clk_src_psys_list), +}; + +static struct clksrc_clk clk_mout_psys = { + .clk = { + .name ="mout_psys" , + .id =-1 , + }, + .shift =S5PC110_CLKSRC0_MUX133_SHIFT , + .mask =S5PC110_CLKSRC0_MUX133_MASK , + .sources = &clk_src_psys, + .reg_source =S5PC110_CLKSRC0 , +}; + +/* Dout COPY */ +static unsigned long s5pc110_clk_dout_copy_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +unsigned int ratio; + + ratio =__raw_readl (S5PC110_CLKDIV6 ) &S5PC110_CLKDIV6_COPY_MASK ; + ratio >>=S5PC110_CLKDIV6_COPY_SHIFT ; + +return rate / (ratio +1 ); +} + +static struct clk clk_dout_copy = { + .name ="dout_copy" , + .id =-1 , + .parent = &clk_mout_hpm.clk, + .get_rate = s5pc110_clk_dout_copy_get_rate, +}; + +/* Dout HPM */ +static unsigned long s5pc110_clk_dout_hpm_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +unsigned int ratio; + + ratio =__raw_readl (S5PC110_CLKDIV6 ) &S5PC110_CLKDIV6_HPM_MASK ; + ratio >>=S5PC110_CLKDIV6_HPM_SHIFT ; + +return rate / (ratio +1 ); +} + +static struct clk clk_dout_hpm = { + .name ="dout_hpm" , + .id =-1 , + .parent = &clk_dout_copy, + .get_rate = s5pc110_clk_dout_hpm_get_rate, +}; + +/* Dout APLL - ARMCLK */ +static unsigned long s5pc110_clk_dout_apll_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +unsigned int ratio; + + ratio =__raw_readl (S5PC110_CLKDIV0 ) &S5PC110_CLKDIV0_APLL_MASK ; + ratio >>=S5PC110_CLKDIV0_APLL_SHIFT ; + +return rate / (ratio +1 ); +} + +static struct clk clk_dout_apll = { + .name ="dout_apll" , + .id =-1 , + .parent = &clk_mout_msys.clk, + .get_rate = s5pc110_clk_dout_apll_get_rate, +}; + +/* Dout HCLKM - ACLK200, HCLK_MSYS */ +static unsigned long s5pc110_clk_dout_hclkm_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +unsigned int ratio; + + ratio =__raw_readl (S5PC110_CLKDIV0 ) &S5PC110_CLKDIV0_HCLK_MSYS_MASK ; + ratio >>=S5PC110_CLKDIV0_HCLK_MSYS_SHIFT ; + +return rate / (ratio +1 ); +} + +struct clk clk_dout_hclkm = { + .name ="dout_hclkm" , + .id =-1 , + .parent = &clk_dout_apll, + .get_rate = s5pc110_clk_dout_hclkm_get_rate, +}; + +/* Dout PCLKM - PCLK_MSYS */ +static unsigned long s5pc110_clk_dout_pclkm_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +unsigned int ratio; + + ratio =__raw_readl (S5PC110_CLKDIV0 ) &S5PC110_CLKDIV0_PCLK_MSYS_MASK ; + ratio >>=S5PC110_CLKDIV0_HCLK_PSYS_SHIFT ; + +return rate / (ratio +1 ); +} + +struct clk clk_dout_pclkm = { + .name ="dout_pclkm" , + .id =-1 , + .parent = &clk_dout_hclkm, + .get_rate = s5pc110_clk_dout_pclkm_get_rate, +}; + +/* Dout IMEM - HCLK100 */ +static unsigned long s5pc110_clk_dout_imem_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +return rate /2 ; +} + +static struct clk clk_dout_imem = { + .name ="dout_imem" , + .id =-1 , + .parent = &clk_dout_hclkm, + .get_rate = s5pc110_clk_dout_imem_get_rate, +}; + +/* Dout HCLKD - HCLK_DSYS */ +static unsigned long s5pc110_clk_dout_hclkd_get_rate (struct clk *clk) +{ +unsigned long rate; +unsigned int ratio; + + rate =clk_get_rate (clk->parent); + ratio =__raw_readl (S5PC110_CLKDIV0 ) &S5PC110_CLKDIV0_HCLK_DSYS_MASK ; + ratio >>=S5PC110_CLKDIV0_HCLK_DSYS_SHIFT ; + +return rate / (ratio +1 ); +} + +struct clk clk_dout_hclkd = { + .name ="dout_hclkd" , + .id =-1 , + .parent = &clk_mout_dsys.clk, + .get_rate = s5pc110_clk_dout_hclkd_get_rate, +}; + +/* Dout PCLKD - PCLK_DSYS */ +static unsigned long s5pc110_clk_dout_pclkd_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +unsigned int ratio; + + ratio =__raw_readl (S5PC110_CLKDIV0 ) &S5PC110_CLKDIV0_PCLK_DSYS_MASK ; + ratio >>=S5PC110_CLKDIV0_PCLK_DSYS_SHIFT ; + +return rate / (ratio +1 ); +} + +struct clk clk_dout_pclkd = { + .name ="dout_pclkd" , + .id =-1 , + .parent = &clk_dout_hclkd, + .get_rate = s5pc110_clk_dout_pclkd_get_rate, +}; + +/* Dout FIMC - SCLK_FIMC */ +static unsigned long s5pc110_clk_dout_fimc_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +unsigned int ratio; + + ratio =__raw_readl (S5PC110_CLKDIV1 ) &S5PC110_CLKDIV1_FIMC_MASK ; + ratio >>=S5PC110_CLKDIV1_FIMC_SHIFT ; + +return rate / (ratio +1 ); +} + +static struct clk clk_dout_fimc = { + .name ="dout_fimc" , + .id =-1 , + .parent = &clk_mout_dsys.clk, + .get_rate = s5pc110_clk_dout_fimc_get_rate, +}; + +/* Dout HCLKP - ARMATCLK, HCLK_PSYS */ +static unsigned long s5pc110_clk_dout_hclkp_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +unsigned int ratio; + + ratio =__raw_readl (S5PC110_CLKDIV0 ) &S5PC110_CLKDIV0_HCLK_PSYS_MASK ; + ratio >>=S5PC110_CLKDIV0_HCLK_PSYS_SHIFT ; + +return rate / (ratio +1 ); +} + +struct clk clk_dout_hclkp = { + .name ="dout_hclkp" , + .id =-1 , + .parent = &clk_mout_psys.clk, + .get_rate = s5pc110_clk_dout_hclkp_get_rate, +}; + +/* Dout PCLKD - PCLK_DSYS */ +static unsigned long s5pc110_clk_dout_pclkp_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +unsigned int ratio; + + ratio =__raw_readl (S5PC110_CLKDIV0 ) &S5PC110_CLKDIV0_PCLK_PSYS_MASK ; + ratio >>=S5PC110_CLKDIV0_PCLK_PSYS_SHIFT ; + +return rate / (ratio +1 ); +} + +struct clk clk_dout_pclkp = { + .name ="dout_pclkp" , + .id =-1 , + .parent = &clk_dout_hclkp, + .get_rate = s5pc110_clk_dout_pclkp_get_rate, +}; + +/* FLASH */ +static struct clk *clk_src_onenand_list[] = { + [0 ] = &clk_dout_hclkd, + [1 ] = &clk_dout_hclkp, +}; + +static struct clk_sources clk_src_onenand = { + .sources = clk_src_onenand_list, + .nr_sources =ARRAY_SIZE (clk_src_onenand_list), +}; + +static struct clksrc_clk clk_mout_onenand = { + .clk = { + .name ="mout_onenand" , + .id =-1 , + }, + .shift =S5PC110_CLKSRC0_ONENAND_SHIFT , + .mask =S5PC110_CLKSRC0_ONENAND_MASK , + .sources = &clk_src_onenand, + .reg_source =S5PC110_CLKSRC0 , +}; + +/* Dout FLASH - SCLK_ONENAND */ +static unsigned long s5pc110_clk_dout_onenand_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +unsigned int ratio; + + ratio =__raw_readl (S5PC110_CLKDIV6 ) &S5PC110_CLKDIV6_ONENAND_MASK ; + ratio >>=S5PC110_CLKDIV6_ONENAND_SHIFT ; + +return rate / (ratio +1 ); +} + +static struct clk clk_dout_onenand = { + .name ="dout_onenand" , + .id =-1 , + .parent = &clk_mout_onenand.clk, + .get_rate = s5pc110_clk_dout_onenand_get_rate, +}; + +/* Dout FLASH2 - SCLK_ONENAND2 */ +static unsigned long s5pc110_clk_dout_onenand2_get_rate (struct clk *clk) +{ +unsigned long rate =clk_get_rate (clk->parent); +return rate /2 ; +} + +static struct clk clk_dout_onenand2 = { + .name ="dout_onenand2" , + .id =-1 , + .parent = &clk_dout_onenand, + .get_rate = s5pc110_clk_dout_onenand2_get_rate, +}; + +/* Peripherals */ +static inline struct clksrc_clk *to_clksrc (struct clk *clk) +{ + return container_of(clk, struct clksrc_clk, clk); +} + +static unsigned long s5pc110_getrate_clksrc (struct clk *clk) +{ +struct clksrc_clk *sclk =to_clksrc (clk); +unsigned long rate =clk_get_rate (clk->parent); +u32 clkdiv =__raw_readl (sclk->reg_divider); + + clkdiv >>= sclk->divider_shift; + clkdiv &=0xf ; + clkdiv++; + + rate /= clkdiv; +return rate; +} + +static int s5pc110_setrate_clksrc (struct clk *clk,unsigned long rate) +{ +struct clksrc_clk *sclk =to_clksrc (clk); +void __iomem *reg = sclk->reg_divider; +unsigned int div; +u32 val; + + rate =clk_round_rate (clk, rate); + div =clk_get_rate (clk->parent) / rate; +if (div >16 ) +return -EINVAL ; + + val =__raw_readl (reg); + val &= ~(0xf << sclk->divider_shift); + val |= (div -1 ) << sclk->divider_shift; +__raw_writel (val, reg); + +return 0 ; +} + +static int s5pc110_setparent_clksrc (struct clk *clk,struct clk *parent) +{ +struct clksrc_clk *sclk =to_clksrc (clk); +struct clk_sources *srcs = sclk->sources; +u32 clksrc =__raw_readl (sclk->reg_source); +int src_nr =-1 ; +int ptr; + +for (ptr =0 ; ptr < srcs->nr_sources; ptr++) { +if (srcs->sources[ptr] == parent) { + src_nr = ptr; +break ; + } + } + +if (src_nr >=0 ) { + clksrc &= ~sclk->mask; + clksrc |= src_nr << sclk->shift; + +__raw_writel (clksrc, sclk->reg_source); +return 0 ; + } + +return -EINVAL ; +} + +static unsigned long s5pc110_roundrate_clksrc (struct clk *clk, +unsigned long rate) +{ +unsigned long parent_rate =clk_get_rate (clk->parent); +int div; + +if (rate > parent_rate) + rate = parent_rate; +else { + div = parent_rate / rate; + +if (div ==0 ) + div =1 ; +if (div >16 ) + div =16 ; + + rate = parent_rate / div; + } + +return rate; +} + +static struct clk *clkset_default_list[] = { + &clk_fin_apll, + &clk_usb_xtal, + &clk_hdmi_27m, + &clk_usbphy0, + &clk_usbphy1, + &clk_hdmi_phy, + &clk_mout_mpll.clk, + &clk_mout_epll.clk, + &clk_mout_vpll.clk, +}; + + +/* CAM */ +static struct clk_sources clkset_cam = { + .sources = clkset_default_list, + .nr_sources =ARRAY_SIZE (clkset_default_list), +}; + +static struct clksrc_clk clk_cam0 = { + .clk = { + .name ="cam" , + .id =0 , + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC1_CAM0_SHIFT , + .mask =S5PC110_CLKSRC1_CAM0_MASK , + .sources = &clkset_cam, + .divider_shift =S5PC110_CLKDIV1_CAM0_SHIFT , + .reg_divider =S5PC110_CLKDIV1 , + .reg_source =S5PC110_CLKSRC1 , +}; + +static struct clksrc_clk clk_cam1 = { + .clk = { + .name ="cam" , + .id =1 , + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC1_CAM1_SHIFT , + .mask =S5PC110_CLKSRC1_CAM1_MASK , + .sources = &clkset_cam, + .divider_shift =S5PC110_CLKDIV1_CAM1_SHIFT , + .reg_divider =S5PC110_CLKDIV1 , + .reg_source =S5PC110_CLKSRC1 , +}; + +/* FIMD */ +static struct clk_sources clkset_fimd = { + .sources = clkset_default_list, + .nr_sources =ARRAY_SIZE (clkset_default_list), +}; + +static struct clksrc_clk clk_fimd = { + .clk = { + .name ="fimd" , + .id =-1 , + .ctrlbit =S5PC110_CLKGATE_IP1_FIMD , + .enable = s5pc110_ip1_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC1_FIMD_SHIFT , + .mask =S5PC110_CLKSRC1_FIMD_MASK , + .sources = &clkset_fimd, + .divider_shift =S5PC110_CLKDIV1_FIMD_SHIFT , + .reg_divider =S5PC110_CLKDIV1 , + .reg_source =S5PC110_CLKSRC1 , +}; + +/* MMC */ +static struct clk_sources clkset_mmc = { + .sources = clkset_default_list, + .nr_sources =ARRAY_SIZE (clkset_default_list), +}; + +static struct clksrc_clk clk_mmc0 = { + .clk = { + .name ="mmc-bus" , + .id =0 , + .ctrlbit =S5PC110_CLKGATE_IP2_HSMMC0 , + .enable = s5pc110_ip2_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC4_MMC0_SHIFT , + .mask =S5PC110_CLKSRC4_MMC0_MASK , + .sources = &clkset_mmc, + .divider_shift =S5PC110_CLKDIV4_MMC0_SHIFT , + .reg_divider =S5PC110_CLKDIV4 , + .reg_source =S5PC110_CLKSRC4 , +}; + +static struct clksrc_clk clk_mmc1 = { + .clk = { + .name ="mmc-bus" , + .id =1 , + .ctrlbit =S5PC110_CLKGATE_IP2_HSMMC1 , + .enable = s5pc110_ip2_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC4_MMC1_SHIFT , + .mask =S5PC110_CLKSRC4_MMC1_MASK , + .sources = &clkset_mmc, + .divider_shift =S5PC110_CLKDIV4_MMC1_SHIFT , + .reg_divider =S5PC110_CLKDIV4 , + .reg_source =S5PC110_CLKSRC4 , +}; + +static struct clksrc_clk clk_mmc2 = { + .clk = { + .name ="mmc-bus" , + .id =2 , + .ctrlbit =S5PC110_CLKGATE_IP2_HSMMC2 , + .enable = s5pc110_ip2_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC4_MMC2_SHIFT , + .mask =S5PC110_CLKSRC4_MMC2_MASK , + .sources = &clkset_mmc, + .divider_shift =S5PC110_CLKDIV4_MMC2_SHIFT , + .reg_divider =S5PC110_CLKDIV4 , + .reg_source =S5PC110_CLKSRC4 , +}; + +static struct clksrc_clk clk_mmc3 = { + .clk = { + .name ="mmc-bus" , + .id =3 , + .ctrlbit =S5PC110_CLKGATE_IP2_HSMMC3 , + .enable = s5pc110_ip2_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC4_MMC3_SHIFT , + .mask =S5PC110_CLKSRC4_MMC3_MASK , + .sources = &clkset_mmc, + .divider_shift =S5PC110_CLKDIV4_MMC3_SHIFT , + .reg_divider =S5PC110_CLKDIV4 , + .reg_source =S5PC110_CLKSRC4 , +}; + +/* AUDIO0 */ +static struct clk_sources clkset_audio0 = { + .sources = clkset_default_list, + .nr_sources =ARRAY_SIZE (clkset_default_list), +}; + +static struct clksrc_clk clk_audio0 = { + .clk = { + .name ="audio-bus" , + .id =0 , + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC6_AUDIO0_SHIFT , + .mask =S5PC110_CLKSRC6_AUDIO0_MASK , + .sources = &clkset_audio0, + .divider_shift =S5PC110_CLKDIV6_AUDIO0_SHIFT , + .reg_divider =S5PC110_CLKDIV6 , + .reg_source =S5PC110_CLKSRC6 , +}; + +/* AUDIO1 */ +static struct clk *clkset_audio1_list[] = { + &clk_iis_cd1, + &clk_pcm_cd1, + &clk_hdmi_27m, + &clk_usbphy0, + &clk_usbphy1, + &clk_hdmi_phy, + &clk_mout_mpll.clk, + &clk_mout_epll.clk, + &clk_mout_vpll.clk, +}; + +static struct clk_sources clkset_audio1 = { + .sources = clkset_audio1_list, + .nr_sources =ARRAY_SIZE (clkset_audio1_list), +}; + +static struct clksrc_clk clk_audio1 = { + .clk = { + .name ="audio-bus" , + .id =1 , + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC6_AUDIO1_SHIFT , + .mask =S5PC110_CLKSRC6_AUDIO1_MASK , + .sources = &clkset_audio1, + .divider_shift =S5PC110_CLKDIV6_AUDIO1_SHIFT , + .reg_divider =S5PC110_CLKDIV6 , + .reg_source =S5PC110_CLKSRC6 , +}; + +/* AUDIO2 */ +static struct clk *clkset_audio2_list[] = { + &clk_fin_apll, + &clk_pcm_cd0, + &clk_hdmi_27m, + &clk_usbphy0, + &clk_usbphy1, + &clk_hdmi_phy, + &clk_mout_mpll.clk, + &clk_mout_epll.clk, + &clk_mout_vpll.clk, +}; + +static struct clk_sources clkset_audio2 = { + .sources = clkset_audio2_list, + .nr_sources =ARRAY_SIZE (clkset_audio2_list), +}; + +static struct clksrc_clk clk_audio2 = { + .clk = { + .name ="audio-bus" , + .id =2 , + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC6_AUDIO2_SHIFT , + .mask =S5PC110_CLKSRC6_AUDIO2_MASK , + .sources = &clkset_audio2, + .divider_shift =S5PC110_CLKDIV6_AUDIO2_SHIFT , + .reg_divider =S5PC110_CLKDIV6 , + .reg_source =S5PC110_CLKSRC6 , +}; + +/* FIMC */ +static struct clk_sources clkset_fimc = { + .sources = clkset_default_list, + .nr_sources =ARRAY_SIZE (clkset_default_list), +}; + +static struct clksrc_clk clk_fimc0 = { + .clk = { + .name ="fimc" , + .id =0 , + .ctrlbit =S5PC110_CLKGATE_IP0_FIMC0 , + .enable = s5pc110_ip0_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC3_FIMC0_LCLK_SHIFT , + .mask =S5PC110_CLKSRC3_FIMC0_LCLK_MASK , + .sources = &clkset_fimc, + .divider_shift =S5PC110_CLKDIV3_FIMC0_LCLK_SHIFT , + .reg_divider =S5PC110_CLKDIV3 , + .reg_source =S5PC110_CLKSRC3 , +}; + +static struct clksrc_clk clk_fimc1 = { + .clk = { + .name ="fimc" , + .id =1 , + .ctrlbit =S5PC110_CLKGATE_IP0_FIMC1 , + .enable = s5pc110_ip0_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC3_FIMC1_LCLK_SHIFT , + .mask =S5PC110_CLKSRC3_FIMC1_LCLK_MASK , + .sources = &clkset_fimc, + .divider_shift =S5PC110_CLKDIV3_FIMC1_LCLK_SHIFT , + .reg_divider =S5PC110_CLKDIV3 , + .reg_source =S5PC110_CLKSRC3 , +}; + +static struct clksrc_clk clk_fimc2 = { + .clk = { + .name ="fimc" , + .id =2 , + .ctrlbit =S5PC110_CLKGATE_IP0_FIMC2 , + .enable = s5pc110_ip0_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC3_FIMC2_LCLK_SHIFT , + .mask =S5PC110_CLKSRC3_FIMC2_LCLK_MASK , + .sources = &clkset_fimc, + .divider_shift =S5PC110_CLKDIV3_FIMC2_LCLK_SHIFT , + .reg_divider =S5PC110_CLKDIV3 , + .reg_source =S5PC110_CLKSRC3 , +}; + +/* UART */ +static struct clk_sources clkset_uart = { + .sources = clkset_default_list, + .nr_sources =ARRAY_SIZE (clkset_default_list), +}; + +static struct clksrc_clk clk_uart0 = { + .clk = { + .name ="uart" , + .id =0 , + .ctrlbit =S5PC110_CLKGATE_IP3_UART0 , + .enable = s5pc110_ip3_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC4_UART0_SHIFT , + .mask =S5PC110_CLKSRC4_UART0_MASK , + .sources = &clkset_uart, + .divider_shift =S5PC110_CLKDIV4_UART0_SHIFT , + .reg_divider =S5PC110_CLKDIV4 , + .reg_source =S5PC110_CLKSRC4 , +}; + +static struct clksrc_clk clk_uart1 = { + .clk = { + .name ="uart" , + .id =1 , + .ctrlbit =S5PC110_CLKGATE_IP3_UART1 , + .enable = s5pc110_ip3_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC4_UART1_SHIFT , + .mask =S5PC110_CLKSRC4_UART1_MASK , + .sources = &clkset_uart, + .divider_shift =S5PC110_CLKDIV4_UART1_SHIFT , + .reg_divider =S5PC110_CLKDIV4 , + .reg_source =S5PC110_CLKSRC4 , +}; + +static struct clksrc_clk clk_uart2 = { + .clk = { + .name ="uart" , + .id =2 , + .ctrlbit =S5PC110_CLKGATE_IP3_UART2 , + .enable = s5pc110_ip3_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC4_UART2_SHIFT , + .mask =S5PC110_CLKSRC4_UART2_MASK , + .sources = &clkset_uart, + .divider_shift =S5PC110_CLKDIV4_UART2_SHIFT , + .reg_divider =S5PC110_CLKDIV4 , + .reg_source =S5PC110_CLKSRC4 , +}; + +static struct clksrc_clk clk_uart3 = { + .clk = { + .name ="uart" , + .id =3 , + .ctrlbit =S5PC110_CLKGATE_IP3_UART3 , + .enable = s5pc110_ip3_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC4_UART3_SHIFT , + .mask =S5PC110_CLKSRC4_UART3_MASK , + .sources = &clkset_uart, + .divider_shift =S5PC110_CLKDIV4_UART3_SHIFT , + .reg_divider =S5PC110_CLKDIV4 , + .reg_source =S5PC110_CLKSRC4 , +}; + +/* PWM */ +static struct clk_sources clkset_pwm = { + .sources = clkset_default_list, + .nr_sources =ARRAY_SIZE (clkset_default_list), +}; + +static struct clksrc_clk clk_pwm = { + .clk = { + .name ="pwm" , + .id =-1 , + .ctrlbit =S5PC110_CLKGATE_IP3_PWM , + .enable = s5pc110_ip3_ctrl, + .set_parent = s5pc110_setparent_clksrc, + .get_rate = s5pc110_getrate_clksrc, + .set_rate = s5pc110_setrate_clksrc, + .round_rate = s5pc110_roundrate_clksrc, + }, + .shift =S5PC110_CLKSRC5_PWM_SHIFT , + .mask =S5PC110_CLKSRC5_PWM_MASK , + .sources = &clkset_pwm, + .divider_shift =S5PC110_CLKDIV5_PWM_SHIFT , + .reg_divider =S5PC110_CLKDIV5 , + .reg_source =S5PC110_CLKSRC5 , +}; + +/* Clock initialisation code */ +static struct clksrc_clk *init_parents[] = { + &clk_mout_apll, + &clk_mout_mpll, + &clk_mout_epll, + &clk_mout_vpllsrc, + &clk_mout_vpll, + &clk_mout_hpm, + &clk_mout_msys, + &clk_mout_dsys, + &clk_mout_psys, + &clk_mout_onenand, + &clk_cam0, + &clk_cam1, + &clk_fimd, + &clk_mmc0, + &clk_mmc1, + &clk_mmc2, + &clk_mmc3, + &clk_audio0, + &clk_audio1, + &clk_audio2, + &clk_fimc0, + &clk_fimc1, + &clk_fimc2, + &clk_uart0, + &clk_uart1, + &clk_uart2, + &clk_uart3, + &clk_pwm, +}; + +static void __init_or_cpufreq s5pc110_set_clksrc(struct clksrc_clk *clk) +{ +struct clk_sources *srcs = clk->sources; +u32 clksrc =__raw_readl (clk->reg_source); + + clksrc &= clk->mask; + clksrc >>= clk->shift; + +if (clksrc > srcs->nr_sources || !srcs->sources[clksrc]) { +printk (KERN_ERR "%s: bad source %d\n" , + clk->clk.name, clksrc); +return ; + } + + clk->clk.parent = srcs->sources[clksrc]; + +printk (KERN_INFO "%s: source is %s (%d), rate is %ld.%03ld MHz\n" , + clk->clk.name, clk->clk.parent->name, clksrc, +print_mhz (clk_get_rate (&clk->clk))); +} + +#define GET_DIV (clk, field) ((((clk) & field##_MASK) >> field##_SHIFT) + 1) + +void __init_or_cpufreq s5pc110_setup_clocks(void) +{ +struct clk *xtal_clk; +unsigned long xtal; +unsigned long armclk; +unsigned long hclk_msys, hclk_dsys, hclk_psys; +unsigned long pclk_msys, pclk_dsys, pclk_psys; +unsigned long apll, mpll, epll, vpll; +unsigned int clkdiv0; +unsigned int ptr; + +printk (KERN_DEBUG "%s: registering clocks\n" , __func__); + + clkdiv0 =__raw_readl (S5PC110_CLKDIV0 ); + +printk (KERN_DEBUG "%s: clkdiv0 = %08x\n" , __func__, clkdiv0); + + xtal_clk =clk_get (NULL ,"xtal" ); +BUG_ON (IS_ERR (xtal_clk)); + + xtal =clk_get_rate (xtal_clk); +clk_put (xtal_clk); + +printk (KERN_DEBUG "%s: xtal is %ld\n" , __func__, xtal); + + apll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC110_APLL_CON ),1 ); + mpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC110_MPLL_CON ),0 ); + epll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC110_EPLL_CON ),0 ); + vpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC110_VPLL_CON ),0 ); + +printk (KERN_INFO "S5PC110: Apll=%ld.%03ld Mhz, Mpll=%ld.%03ld Mhz" +", Epll=%ld.%03ld Mhz, Vpll=%ld.%03ld Mhz\n" , +print_mhz (apll),print_mhz (mpll), +print_mhz (epll),print_mhz (vpll)); + + armclk = apll /GET_DIV (clkdiv0,S5PC110_CLKDIV0_APLL ); + hclk_msys = armclk /GET_DIV (clkdiv0,S5PC110_CLKDIV0_HCLK_MSYS ); + hclk_dsys = mpll /GET_DIV (clkdiv0,S5PC110_CLKDIV0_HCLK_DSYS ); + hclk_psys = mpll /GET_DIV (clkdiv0,S5PC110_CLKDIV0_HCLK_PSYS ); + pclk_msys = hclk_msys /GET_DIV (clkdiv0,S5PC110_CLKDIV0_PCLK_MSYS ); + pclk_dsys = hclk_dsys /GET_DIV (clkdiv0,S5PC110_CLKDIV0_PCLK_DSYS ); + pclk_psys = hclk_psys /GET_DIV (clkdiv0,S5PC110_CLKDIV0_PCLK_PSYS ); + +printk (KERN_INFO "S5PC110: ARMCLK=%ld.%03ld MHz\n" +"HCLK: Msys %ld.%03ld MHz, Dsys %ld.%03ld MHz, Psys %ld.%03ld MHz\n" +"PCLK: Msys %ld.%03ld MHz, Dsys %ld.%03ld MHz, Psys %ld.%03ld MHz\n" , +print_mhz (armclk), +print_mhz (hclk_msys),print_mhz (hclk_dsys),print_mhz (hclk_psys), +print_mhz (pclk_msys),print_mhz (pclk_dsys),print_mhz (pclk_psys)); + + clk_ext_xtal_mux.rate = xtal; + clk_fout_apll.rate = apll; + clk_fout_mpll.rate = mpll; + clk_fout_epll.rate = epll; + clk_fout_vpll.rate = vpll; + + clk_dout_hclkm.rate = hclk_msys; + clk_dout_hclkd.rate = hclk_dsys; + clk_dout_hclkp.rate = hclk_psys; + clk_dout_pclkm.rate = pclk_msys; + clk_dout_pclkd.rate = pclk_dsys; + clk_dout_pclkp.rate = pclk_psys; + + clk_h.rate = hclk_psys; + clk_p.rate = pclk_psys; + clk_f.rate = armclk; + +for (ptr =0 ; ptr <ARRAY_SIZE (init_parents); ptr++) +s5pc110_set_clksrc (init_parents[ptr]); +} + +static struct clk *clks[]__initdata = { + &clk_ext_xtal_mux, + &clk_usb_xtal, + &clk_pcm_cd0, + &clk_pcm_cd1, + &clk_iis_cd1, + &clk_mout_apll.clk, + &clk_mout_mpll.clk, + &clk_mout_epll.clk, + &clk_mout_vpllsrc.clk, + &clk_mout_vpll.clk, + &clk_dout_a2m, + &clk_mout_hpm.clk, + &clk_mout_msys.clk, + &clk_mout_dsys.clk, + &clk_mout_psys.clk, + &clk_dout_copy, + &clk_dout_hpm, + &clk_dout_apll, + &clk_dout_hclkm, + &clk_dout_pclkm, + &clk_dout_hclkd, + &clk_dout_pclkd, + &clk_dout_hclkp, + &clk_dout_pclkp, + &clk_dout_fimc, + &clk_dout_imem, + &clk_mout_onenand.clk, + &clk_dout_onenand, + &clk_dout_onenand2, + &clk_cam0.clk, + &clk_cam1.clk, + &clk_fimd.clk, + &clk_mmc0.clk, + &clk_mmc1.clk, + &clk_mmc2.clk, + &clk_mmc3.clk, + &clk_audio0.clk, + &clk_audio1.clk, + &clk_audio2.clk, + &clk_fimc0.clk, + &clk_fimc1.clk, + &clk_fimc2.clk, + &clk_uart0.clk, + &clk_uart1.clk, + &clk_uart2.clk, + &clk_uart3.clk, + &clk_pwm.clk, +}; + +void __init s5pc110_register_clocks (void ) +{ +struct clk *clkp; +int ret; +int ptr; + +for (ptr =0 ; ptr <ARRAY_SIZE (clks); ptr++) { + clkp = clks[ptr]; + ret =s3c24xx_register_clock (clkp); +if (ret <0 ) { +printk (KERN_ERR "Failed to register clock %s (%d)\n" , + clkp->name, ret); + } + } +}Signature · 7 lines
1.6.4 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 13/19 ARM: S5PC1XX: add support for s5pc110 irqs
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds interrupt support on S5PC110 SoCs. Unlike S5PC100, S5PC110 has 4 VICs, so the S5PC110 specifi virtual memory area is extended to cover VIC3 register block.
--- arch/arm/mach-s5pc110/cpu.c | 10 ++ arch/arm/mach-s5pc110/include/mach/regs-irq.h | 25 +++ arch/arm/mach-s5pc110/include/plat/irqs.h | 209 +++++++++++++++++++++++++ 3 files changed, 244 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/include/mach/regs-irq.h create mode 100644 arch/arm/mach-s5pc110/include/plat/irqs.h
arch/arm/mach-s5pc110/cpu.c +10 -0
@@ -43,6 +43,12 @@/* Initial IO mappings */ static struct map_desc s5pc110_iodesc[]__initdata = { + { + .virtual = (unsigned long )S5PC1XX_VA_VIC (3 ), + .pfn =__phys_to_pfn (S5PC1XX_PA_VIC (3 )), + .length =SZ_4K , + .type =MT_DEVICE , + }, };static void s5pc110_idle (void )
@@ -93,6 +99,10 @@ void __init s5pc110_init_clocks(int xtal)void __init s5pc110_init_irq (void ) { +u32 vic_valid[] = {~0 , ~0 , ~0 , ~0 }; + +/* VIC0, VIC1, VIC2, and VIC3 are fully populated. */ +s5pc1xx_init_irq (vic_valid,ARRAY_SIZE (vic_valid)); }struct sysdev_class s5pc110_sysclass = {
arch/arm/mach-s5pc110/include/mach/regs-irq.h new file +25 -0
@@ -0,0 +1,25 @@ +/* linux/arch/arm/mach-s5pc110/include/mach/regs-irq.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* S5PC110 - IRQ register definitions +* +* 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. +*/ + +#ifndef __ASM_ARCH_REGS_IRQ_H +#define __ASM_ARCH_REGS_IRQ_H __FILE__ + +#include <mach/map.h> +#include <asm/hardware/vic.h> + +/* interrupt controller */ +#define S5PC1XX_VIC0REG (x) ((x) + S5PC1XX_VA_VIC(0)) +#define S5PC1XX_VIC1REG (x) ((x) + S5PC1XX_VA_VIC(1)) +#define S5PC1XX_VIC2REG (x) ((x) + S5PC1XX_VA_VIC(2)) +#define S5PC1XX_VIC3REG (x) ((x) + S5PC1XX_VA_VIC(3)) + +#endif /* __ASM_ARCH_REGS_IRQ_H */
arch/arm/mach-s5pc110/include/plat/irqs.h new file +209 -0
209 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 14/19 ARM: S5PC1XX: add support for s5pc110 gpio
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds gpiolib support for S5PC110 sub-platform.
--- arch/arm/mach-s5pc110/include/mach/gpio.h | 149 +++++++++++++ arch/arm/mach-s5pc110/include/plat/regs-gpio.h | 65 ++++++ arch/arm/plat-s5pc1xx/gpiolib.c | 266 ++++++++++++++++++++++++ arch/arm/plat-s5pc1xx/irq-gpio.c | 110 ++++++++++ 4 files changed, 590 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/include/mach/gpio.h create mode 100644 arch/arm/mach-s5pc110/include/plat/regs-gpio.h
arch/arm/mach-s5pc110/include/mach/gpio.h new file +149 -0
@@ -0,0 +1,149 @@ +/* arch/arm/mach-s5pc110/include/mach/gpio.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* S5PC110 - GPIO lib support +* +* Base on mach-s3c6400/include/mach/gpio.h +* +* 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. +*/ + +#define gpio_get_value __gpio_get_value +#define gpio_set_value __gpio_set_value +#define gpio_cansleep __gpio_cansleep +#define gpio_to_irq __gpio_to_irq + +/* GPIO bank sizes */ +#define S5PC110_GPIO_A0_NR (8) +#define S5PC110_GPIO_A1_NR (8) +#define S5PC110_GPIO_B_NR (8) +#define S5PC110_GPIO_C0_NR (8) +#define S5PC110_GPIO_C1_NR (8) +#define S5PC110_GPIO_D0_NR (8) +#define S5PC110_GPIO_D1_NR (8) +#define S5PC110_GPIO_E0_NR (8) +#define S5PC110_GPIO_E1_NR (8) +#define S5PC110_GPIO_F0_NR (8) +#define S5PC110_GPIO_F1_NR (8) +#define S5PC110_GPIO_F2_NR (8) +#define S5PC110_GPIO_F3_NR (8) +#define S5PC110_GPIO_G0_NR (8) +#define S5PC110_GPIO_G1_NR (8) +#define S5PC110_GPIO_G2_NR (8) +#define S5PC110_GPIO_G3_NR (8) +#define S5PC110_GPIO_H0_NR (8) +#define S5PC110_GPIO_H1_NR (8) +#define S5PC110_GPIO_H2_NR (8) +#define S5PC110_GPIO_H3_NR (8) +#define S5PC110_GPIO_I_NR (8) +#define S5PC110_GPIO_J0_NR (8) +#define S5PC110_GPIO_J1_NR (8) +#define S5PC110_GPIO_J2_NR (8) +#define S5PC110_GPIO_J3_NR (8) +#define S5PC110_GPIO_J4_NR (8) +#define S5PC110_GPIO_MP0_1_NR (8) +#define S5PC110_GPIO_MP0_2_NR (8) +#define S5PC110_GPIO_MP0_3_NR (8) +#define S5PC110_GPIO_MP0_4_NR (8) +#define S5PC110_GPIO_MP0_5_NR (8) +#define S5PC110_GPIO_MP0_6_NR (8) + +/* GPIO bank numbes */ + +/* CONFIG_S3C_GPIO_SPACE allows the user to select extra +* space for debugging purposes so that any accidental +* change from one gpio bank to another can be caught. +*/ + +#define S5PC1XX_GPIO_NEXT (__gpio) \ + ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1) + +enum s5pc110_gpio_number { +S5PC110_GPIO_A0_START =0 , +S5PC110_GPIO_A1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_A0 ), +S5PC110_GPIO_B_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_A1 ), +S5PC110_GPIO_C0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_B ), +S5PC110_GPIO_C1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_C0 ), +S5PC110_GPIO_D0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_C1 ), +S5PC110_GPIO_D1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_D0 ), +S5PC110_GPIO_E0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_D1 ), +S5PC110_GPIO_E1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_E0 ), +S5PC110_GPIO_F0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_E1 ), +S5PC110_GPIO_F1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_F0 ), +S5PC110_GPIO_F2_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_F1 ), +S5PC110_GPIO_F3_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_F2 ), +S5PC110_GPIO_G0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_F3 ), +S5PC110_GPIO_G1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_G0 ), +S5PC110_GPIO_G2_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_G1 ), +S5PC110_GPIO_G3_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_G2 ), +S5PC110_GPIO_H0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_G3 ), +S5PC110_GPIO_H1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_H0 ), +S5PC110_GPIO_H2_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_H1 ), +S5PC110_GPIO_H3_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_H2 ), +S5PC110_GPIO_I_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_H3 ), +S5PC110_GPIO_J0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_I ), +S5PC110_GPIO_J1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_J0 ), +S5PC110_GPIO_J2_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_J1 ), +S5PC110_GPIO_J3_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_J2 ), +S5PC110_GPIO_J4_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_J3 ), +S5PC110_GPIO_MP0_1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_J4 ), +S5PC110_GPIO_MP0_2_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_MP0_1 ), +S5PC110_GPIO_MP0_3_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_MP0_2 ), +S5PC110_GPIO_MP0_4_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_MP0_3 ), +S5PC110_GPIO_MP0_5_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_MP0_4 ), +S5PC110_GPIO_MP0_6_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_MP0_5 ), +S5PC110_GPIO_END =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_MP0_6 ), +}; + +#define S5PC110_GPA0 (_nr) (S5PC110_GPIO_A0_START + (_nr)) +#define S5PC110_GPA1 (_nr) (S5PC110_GPIO_A1_START + (_nr)) +#define S5PC110_GPB (_nr) (S5PC110_GPIO_B_START + (_nr)) +#define S5PC110_GPC0 (_nr) (S5PC110_GPIO_C0_START + (_nr)) +#define S5PC110_GPC1 (_nr) (S5PC110_GPIO_C1_START + (_nr)) +#define S5PC110_GPD0 (_nr) (S5PC110_GPIO_D0_START + (_nr)) +#define S5PC110_GPD1 (_nr) (S5PC110_GPIO_D1_START + (_nr)) +#define S5PC110_GPE0 (_nr) (S5PC110_GPIO_E0_START + (_nr)) +#define S5PC110_GPE1 (_nr) (S5PC110_GPIO_E1_START + (_nr)) +#define S5PC110_GPF0 (_nr) (S5PC110_GPIO_F0_START + (_nr)) +#define S5PC110_GPF1 (_nr) (S5PC110_GPIO_F1_START + (_nr)) +#define S5PC110_GPF2 (_nr) (S5PC110_GPIO_F2_START + (_nr)) +#define S5PC110_GPF3 (_nr) (S5PC110_GPIO_F3_START + (_nr)) +#define S5PC110_GPG0 (_nr) (S5PC110_GPIO_G0_START + (_nr)) +#define S5PC110_GPG1 (_nr) (S5PC110_GPIO_G1_START + (_nr)) +#define S5PC110_GPG2 (_nr) (S5PC110_GPIO_G2_START + (_nr)) +#define S5PC110_GPG3 (_nr) (S5PC110_GPIO_G3_START + (_nr)) +#define S5PC110_GPH0 (_nr) (S5PC110_GPIO_H0_START + (_nr)) +#define S5PC110_GPH1 (_nr) (S5PC110_GPIO_H1_START + (_nr)) +#define S5PC110_GPH2 (_nr) (S5PC110_GPIO_H2_START + (_nr)) +#define S5PC110_GPH3 (_nr) (S5PC110_GPIO_H3_START + (_nr)) +#define S5PC110_GPI (_nr) (S5PC110_GPIO_I_START + (_nr)) +#define S5PC110_GPJ0 (_nr) (S5PC110_GPIO_J0_START + (_nr)) +#define S5PC110_GPJ1 (_nr) (S5PC110_GPIO_J1_START + (_nr)) +#define S5PC110_GPJ2 (_nr) (S5PC110_GPIO_J2_START + (_nr)) +#define S5PC110_GPJ3 (_nr) (S5PC110_GPIO_J3_START + (_nr)) +#define S5PC110_GPJ4 (_nr) (S5PC110_GPIO_J4_START + (_nr)) +#define S5PC110_MP0_1 (_nr) (S5PC110_GPIO_MP0_1_START + (_nr)) +#define S5PC110_MP0_2 (_nr) (S5PC110_GPIO_MP0_2_START + (_nr)) +#define S5PC110_MP0_3 (_nr) (S5PC110_GPIO_MP0_3_START + (_nr)) +#define S5PC110_MP0_4 (_nr) (S5PC110_GPIO_MP0_4_START + (_nr)) +#define S5PC110_MP0_5 (_nr) (S5PC110_GPIO_MP0_5_START + (_nr)) +#define S5PC110_MP0_6 (_nr) (S5PC110_GPIO_MP0_6_START + (_nr)) + +/* It used the end of the S5PC100 gpios */ +#define S3C_GPIO_END S5PC110_GPIO_END + +/* define the number of gpios we need to the one after the MP05() range */ +#define ARCH_NR_GPIOS (S5PC110_GPIO_END + 1) + +/* Common compatibility defines */ +#define S5PC1XX_GPIO_EINT_SFN S3C_GPIO_SFN(0xf) +#define S5PC1XX_GPH0 (n) S5PC110_GPH0(n) +#define S5PC1XX_GPH1 (n) S5PC110_GPH1(n) +#define S5PC1XX_GPH2 (n) S5PC110_GPH2(n) +#define S5PC1XX_GPH3 (n) S5PC110_GPH3(n) + +#include <asm-generic/gpio.h>
arch/arm/mach-s5pc110/include/plat/regs-gpio.h new file +65 -0
65 lines not on this page · raw message
arch/arm/plat-s5pc1xx/gpiolib.c +266 -0
272 lines not on this page · raw message
arch/arm/plat-s5pc1xx/irq-gpio.c +110 -0
116 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 14/19 ARM: S5PC1XX: add support for s5pc110 gpio
Quoted 5 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds gpiolib support for S5PC110 sub-platform.
Hmm, another file with Byungho Min <[email protected]> in and no signoff from this person.
Quoted 243 lines
Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>--- arch/arm/mach-s5pc110/include/mach/gpio.h | 149 +++++++++++++ arch/arm/mach-s5pc110/include/plat/regs-gpio.h | 65 ++++++ arch/arm/plat-s5pc1xx/gpiolib.c | 266 ++++++++++++++++++++++++ arch/arm/plat-s5pc1xx/irq-gpio.c | 110 ++++++++++ 4 files changed, 590 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/include/mach/gpio.h create mode 100644 arch/arm/mach-s5pc110/include/plat/regs-gpio.harch/arm/mach-s5pc110/include/mach/gpio.h new file +149
-0@@ -0,0 +1,149 @@ +/* arch/arm/mach-s5pc110/include/mach/gpio.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* S5PC110 - GPIO lib support +* +* Base on mach-s3c6400/include/mach/gpio.h +* +* 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. +*/ + +#define gpio_get_value __gpio_get_value +#define gpio_set_value __gpio_set_value +#define gpio_cansleep __gpio_cansleep +#define gpio_to_irq __gpio_to_irq + +/* GPIO bank sizes */ +#define S5PC110_GPIO_A0_NR (8) +#define S5PC110_GPIO_A1_NR (8) +#define S5PC110_GPIO_B_NR (8) +#define S5PC110_GPIO_C0_NR (8) +#define S5PC110_GPIO_C1_NR (8) +#define S5PC110_GPIO_D0_NR (8) +#define S5PC110_GPIO_D1_NR (8) +#define S5PC110_GPIO_E0_NR (8) +#define S5PC110_GPIO_E1_NR (8) +#define S5PC110_GPIO_F0_NR (8) +#define S5PC110_GPIO_F1_NR (8) +#define S5PC110_GPIO_F2_NR (8) +#define S5PC110_GPIO_F3_NR (8) +#define S5PC110_GPIO_G0_NR (8) +#define S5PC110_GPIO_G1_NR (8) +#define S5PC110_GPIO_G2_NR (8) +#define S5PC110_GPIO_G3_NR (8) +#define S5PC110_GPIO_H0_NR (8) +#define S5PC110_GPIO_H1_NR (8) +#define S5PC110_GPIO_H2_NR (8) +#define S5PC110_GPIO_H3_NR (8) +#define S5PC110_GPIO_I_NR (8) +#define S5PC110_GPIO_J0_NR (8) +#define S5PC110_GPIO_J1_NR (8) +#define S5PC110_GPIO_J2_NR (8) +#define S5PC110_GPIO_J3_NR (8) +#define S5PC110_GPIO_J4_NR (8) +#define S5PC110_GPIO_MP0_1_NR (8) +#define S5PC110_GPIO_MP0_2_NR (8) +#define S5PC110_GPIO_MP0_3_NR (8) +#define S5PC110_GPIO_MP0_4_NR (8) +#define S5PC110_GPIO_MP0_5_NR (8) +#define S5PC110_GPIO_MP0_6_NR (8) + +/* GPIO bank numbes */ + +/* CONFIG_S3C_GPIO_SPACE allows the user to select extra +* space for debugging purposes so that any accidental +* change from one gpio bank to another can be caught. +*/ + +#define S5PC1XX_GPIO_NEXT (__gpio) \ + ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1) + +enum s5pc110_gpio_number { +S5PC110_GPIO_A0_START =0 , +S5PC110_GPIO_A1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_A0 ), +S5PC110_GPIO_B_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_A1 ), +S5PC110_GPIO_C0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_B ), +S5PC110_GPIO_C1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_C0 ), +S5PC110_GPIO_D0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_C1 ), +S5PC110_GPIO_D1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_D0 ), +S5PC110_GPIO_E0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_D1 ), +S5PC110_GPIO_E1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_E0 ), +S5PC110_GPIO_F0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_E1 ), +S5PC110_GPIO_F1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_F0 ), +S5PC110_GPIO_F2_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_F1 ), +S5PC110_GPIO_F3_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_F2 ), +S5PC110_GPIO_G0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_F3 ), +S5PC110_GPIO_G1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_G0 ), +S5PC110_GPIO_G2_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_G1 ), +S5PC110_GPIO_G3_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_G2 ), +S5PC110_GPIO_H0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_G3 ), +S5PC110_GPIO_H1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_H0 ), +S5PC110_GPIO_H2_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_H1 ), +S5PC110_GPIO_H3_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_H2 ), +S5PC110_GPIO_I_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_H3 ), +S5PC110_GPIO_J0_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_I ), +S5PC110_GPIO_J1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_J0 ), +S5PC110_GPIO_J2_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_J1 ), +S5PC110_GPIO_J3_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_J2 ), +S5PC110_GPIO_J4_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_J3 ), +S5PC110_GPIO_MP0_1_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_J4 ), +S5PC110_GPIO_MP0_2_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_MP0_1 ), +S5PC110_GPIO_MP0_3_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_MP0_2 ), +S5PC110_GPIO_MP0_4_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_MP0_3 ), +S5PC110_GPIO_MP0_5_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_MP0_4 ), +S5PC110_GPIO_MP0_6_START =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_MP0_5 ), +S5PC110_GPIO_END =S5PC1XX_GPIO_NEXT (S5PC110_GPIO_MP0_6 ), +}; + +#define S5PC110_GPA0 (_nr) (S5PC110_GPIO_A0_START + (_nr)) +#define S5PC110_GPA1 (_nr) (S5PC110_GPIO_A1_START + (_nr)) +#define S5PC110_GPB (_nr) (S5PC110_GPIO_B_START + (_nr)) +#define S5PC110_GPC0 (_nr) (S5PC110_GPIO_C0_START + (_nr)) +#define S5PC110_GPC1 (_nr) (S5PC110_GPIO_C1_START + (_nr)) +#define S5PC110_GPD0 (_nr) (S5PC110_GPIO_D0_START + (_nr)) +#define S5PC110_GPD1 (_nr) (S5PC110_GPIO_D1_START + (_nr)) +#define S5PC110_GPE0 (_nr) (S5PC110_GPIO_E0_START + (_nr)) +#define S5PC110_GPE1 (_nr) (S5PC110_GPIO_E1_START + (_nr)) +#define S5PC110_GPF0 (_nr) (S5PC110_GPIO_F0_START + (_nr)) +#define S5PC110_GPF1 (_nr) (S5PC110_GPIO_F1_START + (_nr)) +#define S5PC110_GPF2 (_nr) (S5PC110_GPIO_F2_START + (_nr)) +#define S5PC110_GPF3 (_nr) (S5PC110_GPIO_F3_START + (_nr)) +#define S5PC110_GPG0 (_nr) (S5PC110_GPIO_G0_START + (_nr)) +#define S5PC110_GPG1 (_nr) (S5PC110_GPIO_G1_START + (_nr)) +#define S5PC110_GPG2 (_nr) (S5PC110_GPIO_G2_START + (_nr)) +#define S5PC110_GPG3 (_nr) (S5PC110_GPIO_G3_START + (_nr)) +#define S5PC110_GPH0 (_nr) (S5PC110_GPIO_H0_START + (_nr)) +#define S5PC110_GPH1 (_nr) (S5PC110_GPIO_H1_START + (_nr)) +#define S5PC110_GPH2 (_nr) (S5PC110_GPIO_H2_START + (_nr)) +#define S5PC110_GPH3 (_nr) (S5PC110_GPIO_H3_START + (_nr)) +#define S5PC110_GPI (_nr) (S5PC110_GPIO_I_START + (_nr)) +#define S5PC110_GPJ0 (_nr) (S5PC110_GPIO_J0_START + (_nr)) +#define S5PC110_GPJ1 (_nr) (S5PC110_GPIO_J1_START + (_nr)) +#define S5PC110_GPJ2 (_nr) (S5PC110_GPIO_J2_START + (_nr)) +#define S5PC110_GPJ3 (_nr) (S5PC110_GPIO_J3_START + (_nr)) +#define S5PC110_GPJ4 (_nr) (S5PC110_GPIO_J4_START + (_nr)) +#define S5PC110_MP0_1 (_nr) (S5PC110_GPIO_MP0_1_START + (_nr)) +#define S5PC110_MP0_2 (_nr) (S5PC110_GPIO_MP0_2_START + (_nr)) +#define S5PC110_MP0_3 (_nr) (S5PC110_GPIO_MP0_3_START + (_nr)) +#define S5PC110_MP0_4 (_nr) (S5PC110_GPIO_MP0_4_START + (_nr)) +#define S5PC110_MP0_5 (_nr) (S5PC110_GPIO_MP0_5_START + (_nr)) +#define S5PC110_MP0_6 (_nr) (S5PC110_GPIO_MP0_6_START + (_nr)) + +/* It used the end of the S5PC100 gpios */ +#define S3C_GPIO_END S5PC110_GPIO_END + +/* define the number of gpios we need to the one after the MP05() range */ +#define ARCH_NR_GPIOS (S5PC110_GPIO_END + 1) + +/* Common compatibility defines */ +#define S5PC1XX_GPIO_EINT_SFN S3C_GPIO_SFN(0xf) +#define S5PC1XX_GPH0 (n) S5PC110_GPH0(n) +#define S5PC1XX_GPH1 (n) S5PC110_GPH1(n) +#define S5PC1XX_GPH2 (n) S5PC110_GPH2(n) +#define S5PC1XX_GPH3 (n) S5PC110_GPH3(n) + +#include <asm-generic/gpio.h> arch/arm/mach-s5pc110/include/plat/regs-gpio.h new file +65
-0@@ -0,0 +1,65 @@ +/* linux/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* S5PC110 - GPIO register definitions +*/ + +#ifndef __ASM_PLAT_S5PC1XX_REGS_GPIO_H +#define __ASM_PLAT_S5PC1XX_REGS_GPIO_H __FILE__ + +#include <mach/map.h> + +/* S5PC110 */ +#define S5PC110_GPIO_BASE S5PC1XX_VA_GPIO +#define S5PC110_GPA0_BASE (S5PC110_GPIO_BASE + 0x0000) +#define S5PC110_GPA1_BASE (S5PC110_GPIO_BASE + 0x0020) +#define S5PC110_GPB_BASE (S5PC110_GPIO_BASE + 0x0040) +#define S5PC110_GPC0_BASE (S5PC110_GPIO_BASE + 0x0060) +#define S5PC110_GPC1_BASE (S5PC110_GPIO_BASE + 0x0080) +#define S5PC110_GPD0_BASE (S5PC110_GPIO_BASE + 0x00A0) +#define S5PC110_GPD1_BASE (S5PC110_GPIO_BASE + 0x00C0) +#define S5PC110_GPE0_BASE (S5PC110_GPIO_BASE + 0x00E0) +#define S5PC110_GPE1_BASE (S5PC110_GPIO_BASE + 0x0100) +#define S5PC110_GPF0_BASE (S5PC110_GPIO_BASE + 0x0120) +#define S5PC110_GPF1_BASE (S5PC110_GPIO_BASE + 0x0140) +#define S5PC110_GPF2_BASE (S5PC110_GPIO_BASE + 0x0160) +#define S5PC110_GPF3_BASE (S5PC110_GPIO_BASE + 0x0180) +#define S5PC110_GPG0_BASE (S5PC110_GPIO_BASE + 0x01A0) +#define S5PC110_GPG1_BASE (S5PC110_GPIO_BASE + 0x01C0) +#define S5PC110_GPG2_BASE (S5PC110_GPIO_BASE + 0x01E0) +#define S5PC110_GPG3_BASE (S5PC110_GPIO_BASE + 0x0200) +#define S5PC110_GPH0_BASE (S5PC110_GPIO_BASE + 0x0C00) +#define S5PC110_GPH1_BASE (S5PC110_GPIO_BASE + 0x0C20) +#define S5PC110_GPH2_BASE (S5PC110_GPIO_BASE + 0x0C40) +#define S5PC110_GPH3_BASE (S5PC110_GPIO_BASE + 0x0C60) +#define S5PC110_GPI_BASE (S5PC110_GPIO_BASE + 0x0220) +#define S5PC110_GPJ0_BASE (S5PC110_GPIO_BASE + 0x0240) +#define S5PC110_GPJ1_BASE (S5PC110_GPIO_BASE + 0x0260) +#define S5PC110_GPJ2_BASE (S5PC110_GPIO_BASE + 0x0280) +#define S5PC110_GPJ3_BASE (S5PC110_GPIO_BASE + 0x02A0) +#define S5PC110_GPJ4_BASE (S5PC110_GPIO_BASE + 0x02C0) +#define S5PC110_MP0_1_BASE (S5PC110_GPIO_BASE + 0x02E0) +#define S5PC110_MP0_2_BASE (S5PC110_GPIO_BASE + 0x0300) +#define S5PC110_MP0_3_BASE (S5PC110_GPIO_BASE + 0x0320) +#define S5PC110_MP0_4_BASE (S5PC110_GPIO_BASE + 0x0340) +#define S5PC110_MP0_5_BASE (S5PC110_GPIO_BASE + 0x0360) +#define S5PC110_EXT_INT_BASE (S5PC110_GPIO_BASE + 0x0E00) +#define S5PC110_PDNEN (S5PC110_GPIO_BASE + 0x0F80) +#define S5PC100_PDNEN_NORMAL (0 << 0) + +#define S5PC110_PDNEN_CFG_PDNEN (1 << 1) +#define S5PC110_PDNEN_CFG_AUTO (0 << 1) +#define S5PC110_PDNEN_POWERDOWN (1 << 0) +#define S5PC110_PDNEN_NORMAL (0 << 0) + +/* Common part */ +#define S5PC1XX_EINT_BASE (S5PC110_EXT_INT_BASE) + +#define S5PC1XX_GPx_INPUT (__gpio) (0x0 << ((__gpio) * 4)) +#define S5PC1XX_GPx_OUTPUT (__gpio) (0x1 << ((__gpio) * 4)) +#define S5PC1XX_GPx_CONMASK (__gpio) (0xf << ((__gpio) * 4)) + +#endif /* __ASM_PLAT_S5PC1XX_REGS_GPIO_H */ +arch/arm/plat-s5pc1xx/gpiolib.c +0
-0
arch/arm/plat-s5pc1xx/gpiolib.c static struct s3c_gpio_chip s5pc100_gpio_chips[] = { · line 457
Quoted 5 lines
arch/arm/plat-s5pc1xx/gpiolib.c +2
-0@@ -453,6 +453,272 @@ static struct s3c_gpio_chip s5pc100_gpio_chips[] = {#define s5pc1xx_gpio_chips s5pc100_gpio_chips#endif + +#ifdef CONFIG_CPU_S5PC110
this amount of #ifdef screams seperate file.
Quoted 272 lines
arch/arm/plat-s5pc1xx/gpiolib.c +264
-0+static struct s3c_gpio_chip s5pc110_gpio_chips[] = { + { + .base =S5PC110_GPA0_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPA0 (0 ), + .ngpio =S5PC110_GPIO_A0_NR , + .label ="GPA0" , + }, + }, { + .base =S5PC110_GPA1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPA1 (0 ), + .ngpio =S5PC110_GPIO_A1_NR , + .label ="GPA1" , + }, + }, { + .base =S5PC110_GPB_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPB (0 ), + .ngpio =S5PC110_GPIO_B_NR , + .label ="GPB" , + }, + }, { + .base =S5PC110_GPC0_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPC0 (0 ), + .ngpio =S5PC110_GPIO_C0_NR , + .label ="GPC0" , + }, + }, { + .base =S5PC110_GPC1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPC1 (0 ), + .ngpio =S5PC110_GPIO_C1_NR , + .label ="GPC1" , + }, + }, { + .base =S5PC110_GPD0_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPD0 (0 ), + .ngpio =S5PC110_GPIO_D0_NR , + .label ="GPD0" , + }, + }, { + .base =S5PC110_GPD1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPD1 (0 ), + .ngpio =S5PC110_GPIO_D1_NR , + .label ="GPD1" , + }, + }, { + .base =S5PC110_GPE0_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPE0 (0 ), + .ngpio =S5PC110_GPIO_E0_NR , + .label ="GPE0" , + }, + }, { + .base =S5PC110_GPE1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPE1 (0 ), + .ngpio =S5PC110_GPIO_E1_NR , + .label ="GPE1" , + }, + }, { + .base =S5PC110_GPF0_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPF0 (0 ), + .ngpio =S5PC110_GPIO_F0_NR , + .label ="GPF0" , + }, + }, { + .base =S5PC110_GPF1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPF1 (0 ), + .ngpio =S5PC110_GPIO_F1_NR , + .label ="GPF1" , + }, + }, { + .base =S5PC110_GPF2_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPF2 (0 ), + .ngpio =S5PC110_GPIO_F2_NR , + .label ="GPF2" , + }, + }, { + .base =S5PC110_GPF3_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPF3 (0 ), + .ngpio =S5PC110_GPIO_F3_NR , + .label ="GPF3" , + }, + }, { + .base =S5PC110_GPG0_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPG0 (0 ), + .ngpio =S5PC110_GPIO_G0_NR , + .label ="GPG0" , + }, + }, { + .base =S5PC110_GPG1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPG1 (0 ), + .ngpio =S5PC110_GPIO_G1_NR , + .label ="GPG1" , + }, + }, { + .base =S5PC110_GPG2_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPG2 (0 ), + .ngpio =S5PC110_GPIO_G2_NR , + .label ="GPG2" , + }, + }, { + .base =S5PC110_GPG3_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPG3 (0 ), + .ngpio =S5PC110_GPIO_G3_NR , + .label ="GPG3" , + }, + }, { + .base =S5PC110_GPH0_BASE , + .config = &gpio_cfg_eint, + .chip = { + .base =S5PC110_GPH0 (0 ), + .ngpio =S5PC110_GPIO_H0_NR , + .label ="GPH0" , + }, + }, { + .base =S5PC110_GPH1_BASE , + .config = &gpio_cfg_eint, + .chip = { + .base =S5PC110_GPH1 (0 ), + .ngpio =S5PC110_GPIO_H1_NR , + .label ="GPH1" , + }, + }, { + .base =S5PC110_GPH2_BASE , + .config = &gpio_cfg_eint, + .chip = { + .base =S5PC110_GPH2 (0 ), + .ngpio =S5PC110_GPIO_H2_NR , + .label ="GPH2" , + }, + }, { + .base =S5PC110_GPH3_BASE , + .config = &gpio_cfg_eint, + .chip = { + .base =S5PC110_GPH3 (0 ), + .ngpio =S5PC110_GPIO_H3_NR , + .label ="GPH3" , + }, + }, { + .base =S5PC110_GPI_BASE , + .config = &gpio_cfg_noint, + .chip = { + .base =S5PC110_GPI (0 ), + .ngpio =S5PC110_GPIO_I_NR , + .label ="GPI" , + }, + }, { + .base =S5PC110_GPJ0_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPJ0 (0 ), + .ngpio =S5PC110_GPIO_J0_NR , + .label ="GPJ0" , + }, + }, { + .base =S5PC110_GPJ1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPJ1 (0 ), + .ngpio =S5PC110_GPIO_J1_NR , + .label ="GPJ1" , + }, + }, { + .base =S5PC110_GPJ2_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPJ2 (0 ), + .ngpio =S5PC110_GPIO_J2_NR , + .label ="GPJ2" , + }, + }, { + .base =S5PC110_GPJ3_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPJ3 (0 ), + .ngpio =S5PC110_GPIO_J3_NR , + .label ="GPJ3" , + }, + }, { + .base =S5PC110_GPJ4_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_GPJ4 (0 ), + .ngpio =S5PC110_GPIO_J4_NR , + .label ="GPJ4" , + }, + }, { + .base =S5PC110_MP0_1_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_MP0_1 (0 ), + .ngpio =S5PC110_GPIO_MP0_1_NR , + .label ="MP0_1" , + }, + }, { + .base =S5PC110_MP0_2_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_MP0_2 (0 ), + .ngpio =S5PC110_GPIO_MP0_2_NR , + .label ="MP0_2" , + }, + }, { + .base =S5PC110_MP0_3_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_MP0_3 (0 ), + .ngpio =S5PC110_GPIO_MP0_3_NR , + .label ="MP0_3" , + }, + }, { + .base =S5PC110_MP0_4_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_MP0_4 (0 ), + .ngpio =S5PC110_GPIO_MP0_4_NR , + .label ="MP0_4" , + }, + }, { + .base =S5PC110_MP0_5_BASE , + .config = &gpio_cfg, + .chip = { + .base =S5PC110_MP0_5 (0 ), + .ngpio =S5PC110_GPIO_MP0_5_NR , + .label ="MP0_5" , + }, + }, +}; + +#define s5pc1xx_gpio_chips s5pc110_gpio_chips + +#endif +/* FIXME move from irq-gpio.c */ extern struct irq_chip s5pc1xx_gpioint;extern void s5pc1xx_irq_gpioint_handler (unsigned int irq,struct irq_desc *desc);arch/arm/plat-s5pc1xx/irq-gpio.c +0
-0
arch/arm/plat-s5pc1xx/irq-gpio.c static int s5pc100_group_end = 21; · line 145
Quoted 4 lines
arch/arm/plat-s5pc1xx/irq-gpio.c +1
-0@@ -142,6 +142,116 @@ static int s5pc100_group_end = 21;#endif +#ifdef CONFIG_CPU_S5PC110
these follwing functions could have had their info added to an extended gpio structure, say struct s5p_gpio_chip and had a s3c_gpio_chip embededded in it, which would make the code simpler,
ie:
struct s5p_gpio_chip {
struct s3c_gpio_chip chip;
unsigned int gpio_start;
unsigned int gpio_groupl
};and then you could have gone chip->info easily.
Quoted 120 lines
arch/arm/plat-s5pc1xx/irq-gpio.c +109
-0+static int s5pc110_get_start (unsigned int group) +{ +switch (group) { +case 0 :return S5PC110_GPIO_A0_START ; +case 1 :return S5PC110_GPIO_A1_START ; +case 2 :return S5PC110_GPIO_B_START ; +case 3 :return S5PC110_GPIO_C0_START ; +case 4 :return S5PC110_GPIO_C1_START ; +case 5 :return S5PC110_GPIO_D0_START ; +case 6 :return S5PC110_GPIO_D1_START ; +case 7 :return S5PC110_GPIO_E0_START ; +case 8 :return S5PC110_GPIO_E1_START ; +case 9 :return S5PC110_GPIO_F0_START ; +case 10 :return S5PC110_GPIO_F1_START ; +case 11 :return S5PC110_GPIO_F2_START ; +case 12 :return S5PC110_GPIO_F3_START ; +case 13 :return S5PC110_GPIO_G0_START ; +case 14 :return S5PC110_GPIO_G1_START ; +case 15 :return S5PC110_GPIO_G2_START ; +case 16 :return S5PC110_GPIO_G3_START ; +case 17 :return S5PC110_GPIO_J0_START ; +case 18 :return S5PC110_GPIO_J1_START ; +case 19 :return S5PC110_GPIO_J2_START ; +case 20 :return S5PC110_GPIO_J3_START ; +case 21 :return S5PC110_GPIO_J4_START ; +case 22 :return S5PC110_GPIO_MP0_1_START ; +case 23 :return S5PC110_GPIO_MP0_2_START ; +case 24 :return S5PC110_GPIO_MP0_3_START ; +case 25 :return S5PC110_GPIO_MP0_4_START ; +case 26 :return S5PC110_GPIO_MP0_5_START ; +default : +BUG (); + } +return -EINVAL ; +} + +static int s5pc110_get_group (unsigned int irq) +{ + irq -=S3C_IRQ_GPIO (0 ); + +switch (irq) { + case S5PC110_GPIO_A0_START ... S5PC110_GPIO_A1_START - 1: +return 0 ; + case S5PC110_GPIO_A1_START ... S5PC110_GPIO_B_START - 1: +return 1 ; + case S5PC110_GPIO_B_START ... S5PC110_GPIO_C0_START - 1: +return 2 ; + case S5PC110_GPIO_C0_START ... S5PC110_GPIO_C1_START - 1: +return 3 ; + case S5PC110_GPIO_C1_START ... S5PC110_GPIO_D0_START - 1: +return 4 ; + case S5PC110_GPIO_D0_START ... S5PC110_GPIO_D1_START - 1: +return 5 ; + case S5PC110_GPIO_D1_START ... S5PC110_GPIO_E0_START - 1: +return 6 ; + case S5PC110_GPIO_E0_START ... S5PC110_GPIO_E1_START - 1: +return 7 ; + case S5PC110_GPIO_E1_START ... S5PC110_GPIO_F0_START - 1: +return 8 ; + case S5PC110_GPIO_F0_START ... S5PC110_GPIO_F1_START - 1: +return 9 ; + case S5PC110_GPIO_F1_START ... S5PC110_GPIO_F2_START - 1: +return 10 ; + case S5PC110_GPIO_F2_START ... S5PC110_GPIO_F3_START - 1: +return 11 ; + case S5PC110_GPIO_F3_START ... S5PC110_GPIO_G0_START - 1: +return 12 ; + case S5PC110_GPIO_G0_START ... S5PC110_GPIO_G1_START - 1: +return 13 ; + case S5PC110_GPIO_G1_START ... S5PC110_GPIO_G2_START - 1: +return 14 ; + case S5PC110_GPIO_G2_START ... S5PC110_GPIO_G3_START - 1: +return 15 ; + case S5PC110_GPIO_G3_START ... S5PC110_GPIO_H0_START - 1: +return 16 ; + case S5PC110_GPIO_J0_START ... S5PC110_GPIO_J1_START - 1: +return 17 ; + case S5PC110_GPIO_J1_START ... S5PC110_GPIO_J2_START - 1: +return 18 ; + case S5PC110_GPIO_J2_START ... S5PC110_GPIO_J3_START - 1: +return 19 ; + case S5PC110_GPIO_J3_START ... S5PC110_GPIO_J4_START - 1: +return 20 ; + case S5PC110_GPIO_J4_START ... S5PC110_GPIO_MP0_1_START - 1: +return 21 ; + case S5PC110_GPIO_MP0_1_START ... S5PC110_GPIO_MP0_2_START - 1: +return 22 ; + case S5PC110_GPIO_MP0_2_START ... S5PC110_GPIO_MP0_3_START - 1: +return 23 ; + case S5PC110_GPIO_MP0_3_START ... S5PC110_GPIO_MP0_4_START - 1: +return 24 ; + case S5PC110_GPIO_MP0_4_START ... S5PC110_GPIO_MP0_5_START - 1: +return 25 ; + case S5PC110_GPIO_MP0_5_START ... S5PC110_GPIO_MP0_6_START - 1: +return 26 ; +default : +BUG (); + } +return -EINVAL ; +} + +static int s5pc110_group_end =27 ; + +#define s5pc1xx_get_group s5pc110_get_group +#define s5pc1xx_get_start s5pc110_get_start +#define s5pc1xx_group_end s5pc110_group_end + +#endif +static int s5pc1xx_get_offset (unsigned int irq) {struct gpio_chip *chip =get_irq_data (irq);Signature · 7 lines
1.6.4 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH 14/19 ARM: S5PC1XX: add support for s5pc110 gpio
Hello,
Quoted 9 lines · Ben Dooks
Quoted 5 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds gpiolib support for S5PC110 sub-platform.
Hmm, another file with Byungho Min <[email protected]> in and no signoff from this person.
Ok, we will handle this better next time.
Quoted 52 lines
[...]
arch/arm/plat-s5pc1xx/gpiolib.c static struct s3c_gpio_chip s5pc100_gpio_chips[] = { · line 457
Quoted 10 lines
arch/arm/plat-s5pc1xx/gpiolib.c +2
-0@@ -453,6 +453,272 @@ static struct s3c_gpio_chip s5pc100_gpio_chips[] = {#define s5pc1xx_gpio_chips s5pc100_gpio_chips#endif + +#ifdef CONFIG_CPU_S5PC110 this amount of #ifdef screams seperate file.
[...]
Quoted 23 lines
arch/arm/plat-s5pc1xx/gpiolib.c +15
-0+ }, { + .base = S5PC110_MP0_5_BASE, + .config = &gpio_cfg, + .chip = { + .base = S5PC110_MP0_5(0), + .ngpio = S5PC110_GPIO_MP0_5_NR, + .label = "MP0_5", + }, + }, +}; + +#define s5pc1xx_gpio_chips s5pc110_gpio_chips + +#endif +/* FIXME move from irq-gpio.c */ extern struct irq_chip s5pc1xx_gpioint;extern void s5pc1xx_irq_gpioint_handler (unsigned int irq,struct irq_desc *desc);arch/arm/plat-s5pc1xx/irq-gpio.c +0
-0arch/arm/plat-s5pc1xx/irq-gpio.c static int s5pc100_group_end = 21; · line 145
Quoted 4 lines
arch/arm/plat-s5pc1xx/irq-gpio.c +1
-0@@ -142,6 +142,116 @@ static int s5pc100_group_end = 21;#endif +#ifdef CONFIG_CPU_S5PC110 these follwing functions could have had their info added to an extended gpio structure, say struct
s5p_gpio_chipand had as3c_gpio_chipembededded in it, which would make the code simpler,ie:
Quoted 7 lines
struct s5p_gpio_chip { struct s3c_gpio_chip chip; unsigned int gpio_start; unsigned int gpio_groupl };and then you could have gone
chip->infoeasily.
Thanks for suggestion! I will rewrite this and split gpio lib support into separate files for each sub-platform and send new patches soon.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
PATCH 15/19 ARM: S5PC1XX: add i2c platform helpers on s5pc110 sub-platform
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds required I2C platform helpers. S5PC110 SoCs has 3 I2C controllers.
--- arch/arm/mach-s5pc110/Kconfig | 18 +++++++++ arch/arm/mach-s5pc110/Makefile | 3 + arch/arm/mach-s5pc110/cpu.c | 3 + arch/arm/mach-s5pc110/setup-i2c0.c | 31 +++++++++++++++ arch/arm/mach-s5pc110/setup-i2c1.c | 31 +++++++++++++++ arch/arm/mach-s5pc110/setup-i2c2.c | 32 ++++++++++++++++ arch/arm/plat-s3c/Kconfig | 5 ++ arch/arm/plat-s3c/Makefile | 1 + arch/arm/plat-s3c/dev-i2c2.c | 69 ++++++++++++++++++++++++++++++++++ arch/arm/plat-s3c/include/plat/iic.h | 2 + 10 files changed, 195 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/setup-i2c0.c create mode 100644 arch/arm/mach-s5pc110/setup-i2c1.c create mode 100644 arch/arm/mach-s5pc110/setup-i2c2.c create mode 100644 arch/arm/plat-s3c/dev-i2c2.c
arch/arm/mach-s5pc110/Kconfig +18 -0
@@ -16,4 +16,22 @@ config CPU_S5PC110 help Enable S5PC110 CPU support +config S5PC110_SETUP_I2C0 + bool + default y + help + Common setup code for i2c bus 0. + + Note, currently since i2c0 is always compiled, this setup helper + is always compiled with it. + +config S5PC110_SETUP_I2C1 + bool + help + Common setup code for i2c bus 1. + +config S5PC110_SETUP_I2C2 + bool + help + Common setup code for i2c bus 2. endif
arch/arm/mach-s5pc110/Makefile +3 -0
@@ -14,5 +14,8 @@ obj- := obj-$(CONFIG_CPU_S5PC110) += cpu.o # Helper and device support +obj-$(CONFIG_S5PC110_SETUP_I2C0) += setup-i2c0.o +obj-$(CONFIG_S5PC110_SETUP_I2C1) += setup-i2c1.o +obj-$(CONFIG_S5PC110_SETUP_I2C2) += setup-i2c2.o # machine support
arch/arm/mach-s5pc110/cpu.c +3 -0
@@ -86,6 +86,9 @@ void __init s5pc110_map_io(void)iotable_init (s5pc110_iodesc,ARRAY_SIZE (s5pc110_iodesc));/* initialise device information early */ +/* the i2c devices are directly compatible with s3c2440 */ +s3c_i2c0_setname ("s3c2440-i2c" ); +s3c_i2c1_setname ("s3c2440-i2c" ); }void __init s5pc110_init_clocks (int xtal)
arch/arm/mach-s5pc110/setup-i2c0.c new file +31 -0
@@ -0,0 +1,31 @@ +/* +* linux/arch/arm/mach-s5pc110/setup-i2c2.c +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* Base S5PC110 I2C bus 0 gpio configuration +* +* Based on plat-s3c64xx/setup-i2c0.c +* +* 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. +*/ + +#include <linux/kernel.h> +#include <linux/types.h> + +struct platform_device ;/* don't need the contents */ + +#include <mach/gpio.h> +#include <plat/iic.h> +#include <plat/gpio-cfg.h> + +void s3c_i2c0_cfg_gpio (struct platform_device *dev) +{ +s3c_gpio_cfgpin (S5PC110_GPD1 (0 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC110_GPD1 (0 ),S3C_GPIO_PULL_UP ); +s3c_gpio_cfgpin (S5PC110_GPD1 (1 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC110_GPD1 (1 ),S3C_GPIO_PULL_UP ); +}
arch/arm/mach-s5pc110/setup-i2c1.c new file +31 -0
@@ -0,0 +1,31 @@ +/* +* linux/arch/arm/mach-s5pc110/setup-i2c1.c +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* Base S5PC110 I2C bus 1 gpio configuration +* +* Based on plat-s3c64xx/setup-i2c1.c +* +* 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. +*/ + +#include <linux/kernel.h> +#include <linux/types.h> + +struct platform_device ;/* don't need the contents */ + +#include <mach/gpio.h> +#include <plat/iic.h> +#include <plat/gpio-cfg.h> + +void s3c_i2c1_cfg_gpio (struct platform_device *dev) +{ +s3c_gpio_cfgpin (S5PC110_GPD1 (2 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC110_GPD1 (2 ),S3C_GPIO_PULL_UP ); +s3c_gpio_cfgpin (S5PC110_GPD1 (3 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC110_GPD1 (3 ),S3C_GPIO_PULL_UP ); +}
arch/arm/mach-s5pc110/setup-i2c2.c new file +32 -0
@@ -0,0 +1,32 @@ +/* +* linux/arch/arm/mach-s5pc110/setup-i2c2.c +* +* Copyright (C) 2009 Samsung Electronics Co.Ltd +* Joonyoung Shim <[email protected]> +* +* Base S5PC110 I2C bus 2 gpio configuration +* +* Based on plat-s3c64xx/setup-i2c1.c +* +* 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. +* +*/ + +#include <linux/kernel.h> +#include <linux/types.h> + +struct platform_device ;/* don't need the contents */ + +#include <mach/gpio.h> +#include <plat/iic.h> +#include <plat/gpio-cfg.h> + +void s3c_i2c2_cfg_gpio (struct platform_device *dev) +{ +s3c_gpio_cfgpin (S5PC110_GPD1 (4 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC110_GPD1 (4 ),S3C_GPIO_PULL_UP ); +s3c_gpio_cfgpin (S5PC110_GPD1 (5 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC110_GPD1 (5 ),S3C_GPIO_PULL_UP ); +}
arch/arm/plat-s3c/Kconfig +5 -0
@@ -194,6 +194,11 @@ config S3C_DEV_I2C1 help Compile in platform device definitions for I2C channel 1 +config S3C_DEV_I2C2 + bool + help + Compile in platform device definitions for I2C channel 2 + config S3C_DEV_FB bool help
arch/arm/plat-s3c/Makefile +1 -0
@@ -39,6 +39,7 @@ obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o obj-y += dev-i2c0.o obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o +obj-$(CONFIG_S3C_DEV_I2C2) += dev-i2c2.o obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
arch/arm/plat-s3c/dev-i2c2.c new file +69 -0
69 lines not on this page · raw message
arch/arm/plat-s3c/include/plat/iic.h +2 -0
@@ -54,9 +54,11 @@ struct s3c2410_platform_i2c {*/ extern void s3c_i2c0_set_platdata (struct s3c2410_platform_i2c *i2c);extern void s3c_i2c1_set_platdata (struct s3c2410_platform_i2c *i2c); +extern void s3c_i2c2_set_platdata (struct s3c2410_platform_i2c *i2c);/* defined by architecture to configure gpio */ extern void s3c_i2c0_cfg_gpio (struct platform_device *dev);extern void s3c_i2c1_cfg_gpio (struct platform_device *dev); +extern void s3c_i2c2_cfg_gpio (struct platform_device *dev);#endif /* __ASM_ARCH_IIC_H */
Signature · 1 line
1.6.4
PATCH 16/19 ARM: S5PC1XX: enable S5PC110 sub-platform
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch enables S5PC110 sub-platform.
--- arch/arm/Kconfig | 1 + arch/arm/Makefile | 1 + arch/arm/plat-s5pc1xx/Kconfig | 3 +++ 3 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/Kconfig +1 -0
@@ -770,6 +770,7 @@ source "arch/arm/plat-stmp3xxx/Kconfig" if ARCH_S5PC1XX source "arch/arm/mach-s5pc100/Kconfig" +source "arch/arm/mach-s5pc110/Kconfig" endif source "arch/arm/mach-lh7a40x/Kconfig"
arch/arm/Makefile +1 -0
@@ -161,6 +161,7 @@ machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c24 machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0 machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410 machine-$(CONFIG_ARCH_S5PC100) := s5pc100 +machine-$(CONFIG_ARCH_S5PC110) := s5pc110 machine-$(CONFIG_ARCH_SA1100) := sa1100 machine-$(CONFIG_ARCH_SHARK) := shark machine-$(CONFIG_ARCH_STMP378X) := stmp378x
arch/arm/plat-s5pc1xx/Kconfig +3 -0
@@ -30,6 +30,9 @@ choice config ARCH_S5PC100 bool "S5PC100" +config ARCH_S5PC110 + bool "S5PC110" + endchoice
Signature · 1 line
1.6.4
PATCH 17/19 ARM: S5PC1XX: add sdhci platform helpers for s5pc110 sub-platform
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds common SDHCI platform helper for S5PC110 sub-platform.
--- arch/arm/mach-s5pc110/Kconfig | 12 +++ arch/arm/mach-s5pc110/Makefile | 2 + arch/arm/mach-s5pc110/cpu.c | 5 + arch/arm/mach-s5pc110/setup-sdhci-gpio.c | 123 ++++++++++++++++++++++++++++++ arch/arm/mach-s5pc110/setup-sdhci.c | 59 ++++++++++++++ arch/arm/plat-s3c/include/plat/sdhci.h | 64 +++++++++++++++ 6 files changed, 265 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/setup-sdhci-gpio.c create mode 100644 arch/arm/mach-s5pc110/setup-sdhci.c
arch/arm/mach-s5pc110/Kconfig +12 -0
@@ -34,4 +34,16 @@ config S5PC110_SETUP_I2C2 bool help Common setup code for i2c bus 2. + +config S5PC110_SETUP_SDHCI + bool + select S5PC110_SETUP_SDHCI_GPIO + help + Internal helper functions for S5PC110 based SDHCI systems + +config S5PC110_SETUP_SDHCI_GPIO + bool + help + Common setup code for SDHCI gpio. + endif
arch/arm/mach-s5pc110/Makefile +2 -0
@@ -17,5 +17,7 @@ obj-$(CONFIG_CPU_S5PC110) += cpu.o obj-$(CONFIG_S5PC110_SETUP_I2C0) += setup-i2c0.o obj-$(CONFIG_S5PC110_SETUP_I2C1) += setup-i2c1.o obj-$(CONFIG_S5PC110_SETUP_I2C2) += setup-i2c2.o +obj-$(CONFIG_S5PC110_SETUP_SDHCI) += setup-sdhci.o +obj-$(CONFIG_S5PC110_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o # machine support
arch/arm/mach-s5pc110/cpu.c +5 -0
@@ -86,6 +86,11 @@ void __init s5pc110_map_io(void)iotable_init (s5pc110_iodesc,ARRAY_SIZE (s5pc110_iodesc));/* initialise device information early */ +s5pc110_default_sdhci0 (); +s5pc110_default_sdhci1 (); +s5pc110_default_sdhci2 (); +s5pc110_default_sdhci3 (); +/* the i2c devices are directly compatible with s3c2440 */ s3c_i2c0_setname ("s3c2440-i2c" );s3c_i2c1_setname ("s3c2440-i2c" );
arch/arm/mach-s5pc110/setup-sdhci-gpio.c new file +123 -0
123 lines not on this page · raw message
arch/arm/mach-s5pc110/setup-sdhci.c new file +59 -0
59 lines not on this page · raw message
arch/arm/plat-s3c/include/plat/sdhci.h +64 -0
74 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 18/19 ARM: S5PC1XX: add framebuffer platform helpers for s5pc110 sub-platform
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds common framebuffer device helpers and register defines for S5PC110 sub-platform.
--- arch/arm/mach-s5pc110/Kconfig | 5 ++ arch/arm/mach-s5pc110/Makefile | 1 + arch/arm/mach-s5pc110/include/mach/regs-fb.h | 91 ++++++++++++++++++++++++++ arch/arm/mach-s5pc110/setup-fb-24bpp.c | 63 ++++++++++++++++++ arch/arm/plat-s3c/include/plat/fb.h | 7 ++ 5 files changed, 167 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/include/mach/regs-fb.h create mode 100644 arch/arm/mach-s5pc110/setup-fb-24bpp.c
arch/arm/mach-s5pc110/Kconfig +5 -0
@@ -16,6 +16,11 @@ config CPU_S5PC110 help Enable S5PC110 CPU support +config S5PC110_SETUP_FB_24BPP + bool + help + Common setup code for S5PC110 with an 24bpp RGB display helper. + config S5PC110_SETUP_I2C0 bool default y
arch/arm/mach-s5pc110/Makefile +1 -0
@@ -14,6 +14,7 @@ obj- := obj-$(CONFIG_CPU_S5PC110) += cpu.o # Helper and device support +obj-$(CONFIG_S5PC110_SETUP_FB_24BPP) += setup-fb-24bpp.o obj-$(CONFIG_S5PC110_SETUP_I2C0) += setup-i2c0.o obj-$(CONFIG_S5PC110_SETUP_I2C1) += setup-i2c1.o obj-$(CONFIG_S5PC110_SETUP_I2C2) += setup-i2c2.o
arch/arm/mach-s5pc110/include/mach/regs-fb.h new file +91 -0
91 lines not on this page · raw message
arch/arm/mach-s5pc110/setup-fb-24bpp.c new file +67 -0
67 lines not on this page · raw message
arch/arm/plat-s3c/include/plat/fb.h +7 -0
@@ -77,4 +77,11 @@ extern void s3c64xx_fb_gpio_setup_24bpp(void);*/ extern void s5pc100_fb_gpio_setup_24bpp (void ); +/** +* s5pc110_fb_gpio_setup_24bpp() - S5PC110 setup function for 24bpp LCD +* +* Initialise the GPIO for an 24bpp LCD display on the RGB interface. +*/ +extern void s5pc110_fb_gpio_setup_24bpp (void ); +#endif /* __PLAT_S3C_FB_H */
Signature · 1 line
1.6.4
PATCH 19/19 ARM: S5PC1XX: add support for SMDKC110 board
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds support for SMDKC110 evaluation board. The board can be obtained from Meritech (http://www.meritech.co.kr).
--- arch/arm/mach-s5pc110/Kconfig | 6 ++ arch/arm/mach-s5pc110/Makefile | 1 + arch/arm/mach-s5pc110/mach-smdkc110.c | 102 +++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/mach-smdkc110.c
arch/arm/mach-s5pc110/Kconfig +6 -0
@@ -51,4 +51,10 @@ config S5PC110_SETUP_SDHCI_GPIO help Common setup code for SDHCI gpio. +config MACH_SMDKC110 + bool "SMDKC110" + select CPU_S5PC110 + help + Machine support for the SMDKC110 board + endif
arch/arm/mach-s5pc110/Makefile +1 -0
@@ -22,3 +22,4 @@ obj-$(CONFIG_S5PC110_SETUP_SDHCI) += setup-sdhci.o obj-$(CONFIG_S5PC110_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o # machine support +obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o
arch/arm/mach-s5pc110/mach-smdkc110.c new file +102 -0
102 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 1/1 Add Samsung S5PC110 SoC support
In reply to Marek SzyprowskiQuoted 16 lines · Marek Szyprowski
Hello,
This preliminary patch series adds support for Samsung S5PC110 SoC. S5PC110 belongs to S5PC1XX family (CortexA8 ARM core), but differs in many places from the S5PC100 SoC: new memory map, different clock hierarchy, new gpio banks and much more powerful integrated peripherals. Such differences cannot be easily handled in the current Samsung machine&platform framework. To avoid duplication of code and adding yet another plat-* directory, we decided to introduce sub-platforms in the current s5pc1xx platform.
First 8 patches prepare s5pc1xx platform code for introduction of the new sub-platform approach. Then in the next 11 patches all core functions and drivers are subsequently added, so S5PC110 sub-platform gets similar level of support as S5PC100.
Quoted 8 lines
This patch series has been prepared against latest ARM Kernel tree from
http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm.git/I know that Ben is working hard on new Samsung SoC platform framework, but stabilizing it and porting all the existing Samsung platforms would take time. This sub-platform solution is already prepared and until the new framework will be available and merged, we would like to use our approach.
running these through checkpatch first would have been a good idea:
fyi, these need fixing:
WARNING: externs should be avoided in .c files #666: FILE: arch/arm/plat-s5pc1xx/s5pc110-clocks.c:92:
+extern struct clk clk_dout_hclkm;
WARNING: externs should be avoided in .c files #667: FILE: arch/arm/plat-s5pc1xx/s5pc110-clocks.c:93:
+extern struct clk clk_dout_hclkd;
WARNING: externs should be avoided in .c files #668: FILE: arch/arm/plat-s5pc1xx/s5pc110-clocks.c:94:
+extern struct clk clk_dout_hclkp;
WARNING: externs should be avoided in .c files #669: FILE: arch/arm/plat-s5pc1xx/s5pc110-clocks.c:95:
+extern struct clk clk_dout_pclkd;
WARNING: externs should be avoided in .c files #670: FILE: arch/arm/plat-s5pc1xx/s5pc110-clocks.c:96:
+extern struct clk clk_dout_pclkp;
#348: FILE: arch/arm/mach-s5pc110/include/plat/irqs.h:197:
+#define IRQ_EINT_BIT(x) (x < IRQ_EINT16_31 ? x - IRQ_EINT0 : x - S3C_EINT(0))
could this be made an inline, or at least have x encased in brackets to avoid any problems with macro expansion?
Signature · 4 lines
Ben Q: What's a light-year? A: One-third less calories than a regular year.
PATCH v2 1/1 Add Samsung S5PC110 SoC support
In reply to Marek SzyprowskiHello,
This preliminary patch series adds support for Samsung S5PC110 SoC. S5PC110 belongs to S5PC1XX family (CortexA8 ARM core), but differs in many places from the S5PC100 SoC: new memory map, different clock hierarchy, new gpio banks and much more powerful integrated peripherals. Such differences cannot be easily handled in the current Samsung machine&platform framework. To avoid duplication of code and adding yet another plat-* directory, we decided to introduce sub-platforms in the current s5pc1xx platform.
First 8 patches prepare s5pc1xx platform code for introduction of the new sub-platform approach. Then in the next 11 patches all core functions and drivers are subsequently added, so S5PC110 sub-platform gets similar level of support as S5PC100. The last patch updated MAINTAINERS information.
This patch series has been prepared against latest ARM Kernel tree from
http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm.git/
This is the second version of this patch series. The following issues reported by Ben have been fixed: gpiolib support has been rewriten, more SoC specific files have been moved to mach-s5pc* directories (gpio chip, plls and clocks definitions). Also author/sender issues are resolved.
The clock issue in S5PC110 driver has not been addressed. The driver uses clock API in the same way as it is handled in other Samsung UART drivers. This clock issue should be resolved in a separate patch which would fix all Samsung drivers at once. Until then we would like to use the current approach.
This patch series includes:
[PATCH 01/20] ARM: S5PC100: use 0x30008000 as memory base
[PATCH 02/20] ARM: S5PC1XX: create sub-platform for S5PC100 SoCs
[PATCH 03/20] ARM: S5PC1XX: prepare common cpu&clocks code for S5PC110 sub-platform [PATCH 04/20] ARM: S5PC1XX: prepare common gpiolib code for S5PC110 sub-platform [PATCH 05/20] ARM: S5PC1XX: move common s5pc1xx mach/* includes to plat-s5pc1xx/include/mach [PATCH 06/20] ARM: S5PC1XX: cleanup of s5pc1xx common code
[PATCH 07/20] ARM: S5PC1XX: move s5pc100 specific device helpers to mach-s5pc100 dir [PATCH 08/20] ARM: S5PC1XX: move common s5pc1xx s3c-fb regs to platform directory [PATCH 09/20] drivers: serial: add support for Samsung S5PC110 SoC uart [PATCH 10/20] ARM: S5PC1XX: add S5PC110 memory map
[PATCH 11/20] ARM: S5PC1XX: add S5PC110 cpu initialization code
[PATCH 12/20] ARM: S5PC1XX: add support for s5pc110 plls and clocks
[PATCH 13/20] ARM: S5PC1XX: add support for s5pc110 irqs
[PATCH 14/20] ARM: S5PC1XX: add support for s5pc110 gpio
[PATCH 15/20] ARM: S5PC1XX: add i2c platform helpers on s5pc110 sub-platform [PATCH 16/20] ARM: S5PC1XX: enable S5PC110 sub-platform
[PATCH 17/20] ARM: S5PC1XX: add sdhci platform helpers for s5pc110 sub-platform [PATCH 18/20] ARM: S5PC1XX: add framebuffer platform helpers for s5pc110 sub-platform [PATCH 19/20] ARM: S5PC1XX: add support for SMDKC110 board
[PATCH 20/20] MAINTAINERS: add ARM/S5PC100 and ARM/S5PC110 architectures
PATCH 1/20 ARM: S5PC100: use 0x30008000 as memory base
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
We decided to use 0x3000'0000 as base memory address on S5PC1XX SoCs (s5pc100 and s5pc110).
A patch to u-boot that configures SMDKC100 board and sets base memory as 0x3000'0000 has been already posted.
--- arch/arm/mach-s5pc100/Makefile.boot | 4 ++-- arch/arm/mach-s5pc100/include/mach/map.h | 2 +- arch/arm/mach-s5pc100/include/mach/memory.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-s5pc100/Makefile.boot +2 -2
@@ -1,2 +1,2 @@ - zreladdr-y := 0x20008000 -params_phys-y := 0x20000100 + zreladdr-y := 0x30008000 +params_phys-y := 0x30000100
arch/arm/mach-s5pc100/include/mach/map.h +1 -1
@@ -113,7 +113,7 @@#define S5PC100_PA_TSADC (0xF3000000)/* ETC */ -#define S5PC100_PA_SDRAM (0x20000000) +#define S5PC100_PA_SDRAM (0x30000000)#define S5PC1XX_PA_SDRAM S5PC100_PA_SDRAM/* compatibility defines. */
arch/arm/mach-s5pc100/include/mach/memory.h +1 -1
@@ -13,6 +13,6 @@#ifndef __ASM_ARCH_MEMORY_H#define __ASM_ARCH_MEMORY_H -#define PHYS_OFFSET UL(0x20000000) +#define PHYS_OFFSET UL(0x30000000)#endif
Signature · 1 line
1.6.4
PATCH 1/20 ARM: S5PC100: use 0x30008000 as memory base
Quoted 4 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
We decided to use 0x3000'0000 as base memory address on S5PC1XX SoCs (s5pc100 and s5pc110).
you might as well want to explain the reason behind it, if any?
Quoted 53 lines
A patch to u-boot that configures SMDKC100 board and sets base memory as 0x3000'0000 has been already posted.
Signed-off-by Kyungmin Park <[email protected]>Signed-off-by Marek Szyprowski <[email protected]>---
arch/arm/mach-s5pc100/Makefile.boot | 4 ++--arch/arm/mach-s5pc100/include/mach/map.h| 2 +-arch/arm/mach-s5pc100/include/mach/memory.h| 2 +-3 files changed, 4 insertions(+), 4 deletions(-)arch/arm/mach-s5pc100/Makefile.boot +2
-2@@ -1,2 +1,2 @@ - zreladdr-y := 0x20008000 -params_phys-y := 0x20000100 + zreladdr-y := 0x30008000 +params_phys-y := 0x30000100arch/arm/mach-s5pc100/include/mach/map.h +1
-1@@ -113,7 +113,7 @@ #define S5PC100_PA_TSADC (0xF3000000) /* ETC */ -#define S5PC100_PA_SDRAM (0x20000000) +#define S5PC100_PA_SDRAM (0x30000000) #define S5PC1XX_PA_SDRAM S5PC100_PA_SDRAM /* compatibility defines. */arch/arm/mach-s5pc100/include/mach/memory.h +1
-2@@ -13,6 +13,6 @@ #ifndef __ASM_ARCH_MEMORY_H #define __ASM_ARCH_MEMORY_H -#define PHYS_OFFSET UL(0x20000000) +#define PHYS_OFFSET UL(0x30000000) #endif --1.6.4
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/20 ARM: S5PC100: use 0x30008000 as memory base
Hello,
Quoted 7 lines · jassi brar
Quoted 4 lines · Marek Szyprowski
From: Kyungmin Park <[email protected]>
We decided to use 0x3000'0000 as base memory address on S5PC1XX SoCs (s5pc100 and s5pc110).
you might as well want to explain the reason behind it, if any?
We decided to change the base memory address to 0x30000000 to be able to support systems with 512MB in the second bank (DRAM1) without using HIMEM. In first bank (DRAM0), which is integrated with SOC (POP) we would always have no more than 256MB of memory. If we would leave the first bank at 0x2000'0000, we would lose 256MB of kernel virtual address space for useless memory hole. With this patch (and proper u-boot) we can run kernel on systems with max 256MB + 512MB of memory in 1GB kernel/3GB userspace address space configuration.
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
PATCH 2/20 ARM: S5PC1XX: create sub-platform for S5PC100 SoCs
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC100 and S5PC110 SoCs differs a lot in register map and other core platform definitions, so it is not possible to have both SoCs in the current platform framework without runtime hacks. To address this issue a sub-platform has been introduced, so each SoC in sub-platform can have its own set of include files (register map, irq&gpio definitions, etc)
--- arch/arm/Makefile | 2 +- arch/arm/mach-s5pc100/Kconfig | 4 ++++ arch/arm/plat-s5pc1xx/Kconfig | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletions(-)
arch/arm/Makefile +1 -1
@@ -160,7 +160,7 @@ machine-$(CONFIG_ARCH_RPC) := rpc machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c2443 machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0 machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410 -machine-$(CONFIG_ARCH_S5PC1XX) := s5pc100 +machine-$(CONFIG_ARCH_S5PC100) := s5pc100 machine-$(CONFIG_ARCH_SA1100) := sa1100 machine-$(CONFIG_ARCH_SHARK) := shark machine-$(CONFIG_ARCH_STMP378X) := stmp378x
arch/arm/mach-s5pc100/Kconfig +4 -0
@@ -5,6 +5,8 @@ # # Licensed under GPLv2 +if ARCH_S5PC100 + # Configuration options for the S5PC100 CPU config CPU_S5PC100
@@ -34,3 +36,5 @@ config MACH_SMDKC100 select S5PC100_SETUP_SDHCI help Machine support for the Samsung SMDKC100 + +endif
arch/arm/plat-s5pc1xx/Kconfig +10 -0
@@ -23,6 +23,16 @@ config PLAT_S5PC1XX if PLAT_S5PC1XX +choice + prompt "S5PC1xx SoC Type" + default ARCH_S5PC100 + +config ARCH_S5PC100 + bool "S5PC100" + +endchoice + + # Configuration options shared by all S3C64XX implementations config CPU_S5PC100_INIT
Signature · 1 line
1.6.4
PATCH 3/20 ARM: S5PC1XX: prepare common cpu&clocks code for S5PC110 sub-platform
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
CLK_OTHER register block is specific for S5PC100 SoC, so move the definition to mach-s5pc100/cpu.c. Size of CLK and PWR register block is different on S5PC100 and S5PC110, thus new defines are introduced.
Clock and pll hierarchy is completely different between S5PC100 and S5PC110 SoCs, so move related includes to new sub-platform and rename plat-s5pc1xx/clocks.c and plat-s5pc1xx/s5pc100-clock.c to s5pc100-clocks.c (periperal clocks definition) and s5pc100-plls.c (core pll hierarchy definition).
---
arch/arm/mach-s5pc100/Kconfig | 2 --
arch/arm/mach-s5pc100/Makefile | 3 +++
.../clock.c => mach-s5pc100/clocks.c} | 4 ++--
arch/arm/mach-s5pc100/cpu.c | 6 ++++++
arch/arm/mach-s5pc100/include/mach/map.h | 2 ++
.../include/plat/regs-clock.h | 2 +-
.../include/plat/regs-power.h | 2 +-
.../s5pc100-clock.c => mach-s5pc100/plls.c} | 2 +-
.../s5pc100-init.c => mach-s5pc100/uarts.c} | 2 +-
arch/arm/plat-s5pc1xx/Kconfig | 12 +-----------
arch/arm/plat-s5pc1xx/Makefile | 4 ----
arch/arm/plat-s5pc1xx/cpu.c | 18 ++++++------------
12 files changed, 24 insertions(+), 35 deletions(-)
rename arch/arm/{plat-s5pc1xx/clock.c => mach-s5pc100/clocks.c} (99%)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/include/plat/regs-clock.h (99%)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/include/plat/regs-power.h (98%)
rename arch/arm/{plat-s5pc1xx/s5pc100-clock.c => mach-s5pc100/plls.c} (99%)
rename arch/arm/{plat-s5pc1xx/s5pc100-init.c => mach-s5pc100/uarts.c} (94%)arch/arm/mach-s5pc100/Kconfig +0 -2
@@ -11,8 +11,6 @@ if ARCH_S5PC100 config CPU_S5PC100 bool - select CPU_S5PC100_INIT - select CPU_S5PC100_CLOCK help Enable S5PC100 CPU support
arch/arm/mach-s5pc100/Makefile +3 -0
@@ -12,6 +12,9 @@ obj- := # Core support for S5PC100 system obj-$(CONFIG_CPU_S5PC100) += cpu.o +obj-$(CONFIG_CPU_S5PC100) += clocks.o +obj-$(CONFIG_CPU_S5PC100) += plls.o +obj-$(CONFIG_CPU_S5PC100) += uarts.o # Helper and device support
arch/arm/mach-s5pc100/clocks.c renamed from arch/arm/plat-s5pc1xx/clock.c +2 -2
@@ -1,8 +1,8 @@ -/* linux/arch/arm/plat-s5pc1xx/clock.c +/* linux/arch/arm/mach-s5pc100/clocks.c * * Copyright 2009 Samsung Electronics Co. * -* S5PC1XX Base clock support +* S5PC100 - Clocks support * * Based on plat-s3c64xx/clock.c *
arch/arm/mach-s5pc100/cpu.c +6 -0
@@ -46,6 +46,12 @@/* Initial IO mappings */ static struct map_desc s5pc100_iodesc[]__initdata = { + { + .virtual = (unsigned long )S5PC1XX_VA_CLK_OTHER , + .pfn =__phys_to_pfn (S5PC1XX_PA_CLK_OTHER ), + .length =SZ_4K , + .type =MT_DEVICE , + } };static void s5pc100_idle (void )
arch/arm/mach-s5pc100/include/mach/map.h +2 -0
@@ -46,6 +46,8 @@#define S5PC1XX_VA_CLK (S3C_VA_SYS + 0x10000)#define S5PC1XX_VA_PWR (S3C_VA_SYS + 0x20000)#define S5PC1XX_VA_CLK_OTHER (S3C_VA_SYS + 0x30000) +#define S5PC1XX_SZ_CLK SZ_4K +#define S5PC1XX_SZ_PWR SZ_4K/* GPIO */ #define S5PC100_PA_GPIO (0xE0300000)
arch/arm/mach-s5pc100/include/plat/regs-clock.h renamed from arch/arm/plat-s5pc1xx/include/plat/regs-clock.h +1 -1
@@ -3,7 +3,7 @@* Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]> * -* S5PC1XX clock register definitions +* S5PC100 clock register definitions * * 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
arch/arm/mach-s5pc100/include/plat/regs-power.h renamed from arch/arm/plat-s5pc1xx/include/plat/regs-power.h +1 -1
@@ -3,7 +3,7 @@* Copyright 2009 Samsung Electronics Co. * Jongse Won <[email protected]> * -* S5PC1XX clock register definitions +* S5PC100 power controll register definitions * * 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
arch/arm/mach-s5pc100/plls.c renamed from arch/arm/plat-s5pc1xx/s5pc100-clock.c +1 -1
@@ -1,4 +1,4 @@ -/* linux/arch/arm/plat-s5pc1xx/s5pc100-clock.c +/* linux/arch/arm/mach-s5pc100/s5pc100-plls.c * * Copyright 2009 Samsung Electronics, Co. * Byungho Min <[email protected]>
arch/arm/mach-s5pc100/uarts.c renamed from arch/arm/plat-s5pc1xx/s5pc100-init.c +1 -1
@@ -1,4 +1,4 @@ -/* linux/arch/arm/plat-s5pc1xx/s5pc100-init.c +/* linux/arch/arm/mach-s5pc100/uarts.c * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/Kconfig +1 -11
@@ -33,17 +33,7 @@ config ARCH_S5PC100 endchoice -# Configuration options shared by all S3C64XX implementations - -config CPU_S5PC100_INIT - bool - help - Common initialisation code for the S5PC1XX - -config CPU_S5PC100_CLOCK - bool - help - Common clock support code for the S5PC1XX +# configuration options shared by all S5PC1XX implementations # platform specific device setup
arch/arm/plat-s5pc1xx/Makefile +0 -4
@@ -14,14 +14,10 @@ obj- := obj-y += dev-uart.o obj-y += cpu.o obj-y += irq.o irq-gpio.o irq-eint.o -obj-y += clock.o obj-y += gpiolib.o # CPU support -obj-$(CONFIG_CPU_S5PC100_INIT) += s5pc100-init.o -obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-clock.o - # Device setup obj-$(CONFIG_S5P_GPIO_CFG_S5PC1XX) += gpio-config.o
arch/arm/plat-s5pc1xx/cpu.c +6 -12
@@ -50,18 +50,11 @@ static struct cpu_table cpu_ids[] __initdata = { };/* minimal IO mapping */ -/* see notes on uart map in arch/arm/mach-s5pc100/include/mach/debug-macro.S */ -#define UART_OFFS (S3C_PA_UART & 0xffff)static struct map_desc s5pc1xx_iodesc[]__initdata = { { - .virtual = (unsigned long )S5PC1XX_VA_CLK_OTHER , - .pfn =__phys_to_pfn (S5PC1XX_PA_CLK_OTHER ), - .length =SZ_4K , - .type =MT_DEVICE , - }, { .virtual = (unsigned long )S5PC1XX_VA_GPIO , - .pfn =__phys_to_pfn (S5PC100_PA_GPIO ), + .pfn =__phys_to_pfn (S5PC1XX_PA_GPIO ), .length =SZ_4K , .type =MT_DEVICE , }, {
@@ -72,15 +65,15 @@ static struct map_desc s5pc1xx_iodesc[] __initdata = { }, { .virtual = (unsigned long)S5PC1XX_VA_CLK, .pfn = __phys_to_pfn(S5PC1XX_PA_CLK), - .length = SZ_4K, + .length = S5PC1XX_SZ_CLK, .type = MT_DEVICE, }, { .virtual = (unsigned long)S5PC1XX_VA_PWR, .pfn = __phys_to_pfn(S5PC1XX_PA_PWR), - .length = SZ_4K, + .length = S5PC1XX_SZ_PWR, .type = MT_DEVICE, }, { - .virtual = (unsigned long)(S5PC1XX_VA_UART), + .virtual = (unsigned long)S5PC1XX_VA_UART, .pfn = __phys_to_pfn(S5PC1XX_PA_UART), .length = SZ_4K, .type = MT_DEVICE,
@@ -115,8 +108,9 @@ void __init s5pc1xx_init_io(struct map_desc *mach_desc, int size)/* initialise the io descriptors we need for initialisation */ iotable_init (s5pc1xx_iodesc,ARRAY_SIZE (s5pc1xx_iodesc)); -iotable_init (mach_desc, size); idcode =__raw_readl (S5PC1XX_VA_CHIPID );s3c_init_cpu (idcode, cpu_ids,ARRAY_SIZE (cpu_ids)); + +iotable_init (mach_desc, size); }
Signature · 1 line
1.6.4
PATCH 4/20 ARM: S5PC1XX: prepare common gpiolib code for S5PC110 sub-platform
In reply to Marek SzyprowskiS5PC100 GPIOlib support has been rewriten to make it possible to reuse most of the common code in the upcoming S5PC110 sub-platform.
---
arch/arm/mach-s5pc100/Makefile | 1 +
arch/arm/mach-s5pc100/gpio-chips.c | 106 ++++++
arch/arm/mach-s5pc100/include/mach/gpio.h | 46 +++
.../include/plat/irqs.h | 2 +-
.../include/plat/regs-gpio.h | 2 +-
arch/arm/plat-s5pc1xx/gpiolib.c | 374 ++------------------
arch/arm/plat-s5pc1xx/include/plat/gpio-s5pc1xx.h | 79 ++++
arch/arm/plat-s5pc1xx/irq-eint.c | 13 +-
arch/arm/plat-s5pc1xx/irq-gpio.c | 105 +-----
9 files changed, 292 insertions(+), 436 deletions(-)
create mode 100644 arch/arm/mach-s5pc100/gpio-chips.c
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/include/plat/irqs.h (99%)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/include/plat/regs-gpio.h (98%)
create mode 100644 arch/arm/plat-s5pc1xx/include/plat/gpio-s5pc1xx.harch/arm/mach-s5pc100/Makefile +1 -0
@@ -13,6 +13,7 @@ obj- := obj-$(CONFIG_CPU_S5PC100) += cpu.o obj-$(CONFIG_CPU_S5PC100) += clocks.o +obj-$(CONFIG_CPU_S5PC100) += gpio-chips.o obj-$(CONFIG_CPU_S5PC100) += plls.o obj-$(CONFIG_CPU_S5PC100) += uarts.o
arch/arm/mach-s5pc100/gpio-chips.c new file +106 -0
106 lines not on this page · raw message
arch/arm/mach-s5pc100/include/mach/gpio.h +46 -0
50 lines not on this page · raw message
arch/arm/mach-s5pc100/include/plat/irqs.h renamed from arch/arm/plat-s5pc1xx/include/plat/irqs.h +1 -1
@@ -3,7 +3,7 @@* Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]> * -* S5PC1XX - Common IRQ support +* S5PC100 - Common IRQ support * * Based on plat-s3c64xx/include/plat/irqs.h */
arch/arm/mach-s5pc100/include/plat/regs-gpio.h renamed from arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h +1 -1
@@ -3,7 +3,7 @@* Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]> * -* S5PC1XX - GPIO register definitions +* S5PC100 - GPIO register definitions */ #ifndef __ASM_PLAT_S5PC1XX_REGS_GPIO_H
arch/arm/plat-s5pc1xx/gpiolib.c +33 -341
444 lines not on this page · raw message
arch/arm/plat-s5pc1xx/include/plat/gpio-s5pc1xx.h new file +79 -0
79 lines not on this page · raw message
arch/arm/plat-s5pc1xx/irq-eint.c +6 -7
@@ -105,7 +105,7 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type) {u32 bank =s3c_get_bank (irq);int real =s3c_get_eint (irq); -int gpio, shift, sfn; +int gpio, shift;u32 ctrl, con =0 ;switch (type) {
@@ -148,23 +148,22 @@ static int s3c_irq_eint_set_type(unsigned int irq, unsigned int type)switch (real) { case 0 ... 7: - gpio =S5PC100_GPH0 (gpio); + gpio =S5PC1XX_GPH0 (gpio);break ; case 8 ... 15: - gpio =S5PC100_GPH1 (gpio); + gpio =S5PC1XX_GPH1 (gpio);break ; case 16 ... 23: - gpio =S5PC100_GPH2 (gpio); + gpio =S5PC1XX_GPH2 (gpio);break ; case 24 ... 31: - gpio =S5PC100_GPH3 (gpio); + gpio =S5PC1XX_GPH3 (gpio);break ;default :return -EINVAL ; } - sfn =S3C_GPIO_SFN (0x2 ); -s3c_gpio_cfgpin (gpio, sfn); +s3c_gpio_cfgpin (gpio,S5PC1XX_GPIO_EINT_SFN );return 0 ; }
arch/arm/plat-s5pc1xx/irq-gpio.c +19 -86
143 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 5/20 ARM: S5PC1XX: move common s5pc1xx mach/* includes to plat-s5pc1xx/include/mach
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
All includes that are common for S5PC100 and S5PC110 are moved to plat-s5pc1xx/include/mach, so they can be used by both sub-platforms.
---
.../include/mach/gpio-core.h | 2 +-
.../include/mach/hardware.h | 2 +-
.../include/mach/irqs.h | 2 +-
.../include/mach/memory.h | 2 +-
.../include/mach/pwm-clock.h | 2 +-
.../include/mach/tick.h | 2 +-
.../include/mach/uncompress.h | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/gpio-core.h (91%)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/hardware.h (83%)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/irqs.h (87%)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/memory.h (89%)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/pwm-clock.h (96%)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/tick.h (93%)
rename arch/arm/{mach-s5pc100 => plat-s5pc1xx}/include/mach/uncompress.h (92%)arch/arm/plat-s5pc1xx/include/mach/gpio-core.h renamed from arch/arm/mach-s5pc100/include/mach/gpio-core.h +1 -1
@@ -1,4 +1,4 @@ -/* arch/arm/mach-s5pc100/include/mach/gpio-core.h +/* arch/arm/plat-s5pc1xx/include/mach/gpio-core.h * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/include/mach/hardware.h renamed from arch/arm/mach-s5pc100/include/mach/hardware.h +1 -1
@@ -1,4 +1,4 @@ -/* linux/arch/arm/mach-s5pc100/include/mach/hardware.h +/* linux/arch/arm/plat-s5pc1xx/include/mach/hardware.h * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/include/mach/irqs.h renamed from arch/arm/mach-s5pc100/include/mach/irqs.h +1 -1
@@ -1,4 +1,4 @@ -/* linux/arch/arm/mach-s5pc100/include/mach/irqs.h +/* linux/arch/arm/plat-s5pc1xx/include/mach/irqs.h * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/include/mach/memory.h renamed from arch/arm/mach-s5pc100/include/mach/memory.h +1 -1
@@ -1,4 +1,4 @@ -/* arch/arm/mach-s5pc100/include/mach/memory.h +/* linux/arch/arm/plat-s5pc1xx/include/mach/memory.h * * Copyright 2008 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/include/mach/pwm-clock.h renamed from arch/arm/mach-s5pc100/include/mach/pwm-clock.h +1 -1
@@ -1,4 +1,4 @@ -/* linux/arch/arm/mach-s5pc100/include/mach/pwm-clock.h +/* linux/arch/arm/plat-s5pc1xx/include/mach/pwm-clock.h * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/include/mach/tick.h renamed from arch/arm/mach-s5pc100/include/mach/tick.h +1 -1
@@ -1,4 +1,4 @@ -/* linux/arch/arm/mach-s5pc100/include/mach/tick.h +/* linux/arch/arm/plat-s5pc1xx/include/mach/tick.h * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
arch/arm/plat-s5pc1xx/include/mach/uncompress.h renamed from arch/arm/mach-s5pc100/include/mach/uncompress.h +1 -1
@@ -1,4 +1,4 @@ -/* arch/arm/mach-s5pc100/include/mach/uncompress.h +/* linux/arch/arm/plat-s5pc1xx/include/mach/uncompress.h * * Copyright 2009 Samsung Electronics Co. * Byungho Min <[email protected]>
Signature · 1 line
1.6.4
PATCH 6/20 ARM: S5PC1XX: cleanup of s5pc1xx common code
In reply to Marek SzyprowskiThis patch removes all useless definitions from plat/s5pc100.h and introduces new common plat/s5pc1xx.h include.
--- arch/arm/mach-s5pc100/cpu.c | 2 +- arch/arm/mach-s5pc100/include/plat/regs-clock.h | 8 ++-- arch/arm/mach-s5pc100/mach-smdkc100.c | 2 +- arch/arm/mach-s5pc100/plls.c | 2 +- arch/arm/mach-s5pc100/uarts.c | 5 +- arch/arm/plat-s5pc1xx/cpu.c | 2 +- arch/arm/plat-s5pc1xx/include/plat/s5pc100.h | 51 ++++++----------------- arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h | 21 +++++++++ 8 files changed, 45 insertions(+), 48 deletions(-) create mode 100644 arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h
arch/arm/mach-s5pc100/cpu.c +1 -1
@@ -41,7 +41,7 @@#include <plat/clock.h> #include <plat/sdhci.h> #include <plat/iic-core.h> -#include <plat/s5pc100.h> +#include <plat/s5pc1xx.h> /* Initial IO mappings */
arch/arm/mach-s5pc100/include/plat/regs-clock.h +4 -4
@@ -341,10 +341,10 @@#define S5PC100_HDMI_PHY_CON0 S5PC100_CLKREG_OTHER(0x420)#define S5PC100_SWRESET_RESETVAL 0xc100 -#define S5PC100_OTHER_SYS_INT 24 -#define S5PC100_OTHER_STA_TYPE 23 -#define STA_TYPE_EXPON 0 -#define STA_TYPE_SFR 1 +#define S5PC100_OTHERS_PMU_INT_DISALBE (1 << 24) +#define S5PC100_OTHERS_STABLE_COUNTER_TYPE_MASK (1 << 23) +#define S5PC100_OTHERS_STABLE_COUNTER_TYPE_SFR (1 << 23) +#define S5PC100_OTHERS_STABLE_COUNTER_TYPE_EXP (0 << 23)#define S5PC100_SLEEP_CFG_OSC_EN 0
arch/arm/mach-s5pc100/mach-smdkc100.c +1 -1
@@ -40,7 +40,7 @@#include <plat/clock.h> #include <plat/devs.h> #include <plat/cpu.h> -#include <plat/s5pc100.h> +#include <plat/s5pc1xx.h> #include <plat/fb.h> #include <plat/iic.h>
arch/arm/mach-s5pc100/plls.c +1 -1
@@ -32,7 +32,7 @@#include <plat/cpu.h> #include <plat/pll.h> #include <plat/devs.h> -#include <plat/s5pc100.h> +#include <plat/s5pc1xx.h> /* fin_apll, fin_mpll and fin_epll are all the same clock, which we call * ext_xtal_mux for want of an actual name from the manual.
arch/arm/mach-s5pc100/uarts.c +3 -2
@@ -13,14 +13,15 @@#include <linux/kernel.h> #include <linux/types.h> #include <linux/init.h> +#include <linux/clk.h> #include <plat/cpu.h> #include <plat/devs.h> -#include <plat/s5pc100.h> +#include <plat/s5pc1xx.h> /* uart registration process */ -void __init s5pc100_common_init_uarts (struct s3c2410_uartcfg *cfg,int no) +void __init s5pc100_init_uarts (struct s3c2410_uartcfg *cfg,int no) {/* The driver name is s3c6400-uart to reuse s3c6400_serial_drv */ s3c24xx_init_uartdevs ("s3c6400-uart" , s5pc1xx_uart_resources, cfg, no);
arch/arm/plat-s5pc1xx/cpu.c +1 -1
@@ -31,7 +31,7 @@#include <plat/devs.h> #include <plat/clock.h> -#include <plat/s5pc100.h> +#include <plat/s5pc1xx.h> /* table of supported CPUs */
arch/arm/plat-s5pc1xx/include/plat/s5pc100.h +13 -38
65 lines not on this page · raw message
arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h new file +21 -0
@@ -0,0 +1,21 @@ +/* arch/arm/plat-s5pc1xx/include/plat/s5pc100.h +* +* Copyright 2009 Samsung Electronics Co. +* Marek Szyprowski <[email protected]> +* +* Header file for s5pc1xx cpu support +* +* 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. +*/ + +/* Common init code for S5PC1XX related SoCs */ + +extern void s5pc1xx_init_irq (u32 *vic_valid,int num); +extern void s5pc1xx_init_io (struct map_desc *mach_desc,int size); +extern void s5pc1xx_register_clocks (void ); + +extern struct s3c24xx_uart_resources s5pc1xx_uart_resources[]; + +#include <plat/s5pc100.h>
Signature · 1 line
1.6.4
PATCH 7/20 ARM: S5PC1XX: move s5pc100 specific device helpers to mach-s5pc100 dir
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
All device helpers that are defined in plat-s5pc1xx are S5PC100 specific. This patch moves them to mach-s5pc100 directory to make use of newly created sub-platform support.
---
arch/arm/mach-s5pc100/Kconfig | 32 +++++++++++++++++--
arch/arm/mach-s5pc100/Makefile | 4 ++
.../setup-fb-24bpp.c | 0
.../{plat-s5pc1xx => mach-s5pc100}/setup-i2c0.c | 0
.../{plat-s5pc1xx => mach-s5pc100}/setup-i2c1.c | 0
.../setup-sdhci-gpio.c | 0
arch/arm/plat-s5pc1xx/Kconfig | 24 ---------------
arch/arm/plat-s5pc1xx/Makefile | 4 --
8 files changed, 32 insertions(+), 32 deletions(-)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-fb-24bpp.c (100%)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-i2c0.c (100%)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-i2c1.c (100%)
rename arch/arm/{plat-s5pc1xx => mach-s5pc100}/setup-sdhci-gpio.c (100%)arch/arm/mach-s5pc100/Kconfig +28 -4
@@ -14,12 +14,36 @@ config CPU_S5PC100 help Enable S5PC100 CPU support +config S5PC100_SETUP_FB_24BPP + bool + help + Common setup code for S5PC1XX with an 24bpp RGB display helper. + +config S5PC100_SETUP_I2C0 + bool + default y + help + Common setup code for i2c bus 0. + + Note, currently since i2c0 is always compiled, this setup helper + is always compiled with it. + +config S5PC100_SETUP_I2C1 + bool + help + Common setup code for i2c bus 1. + config S5PC100_SETUP_SDHCI bool - select S5PC1XX_SETUP_SDHCI_GPIO + select S5PC100_SETUP_SDHCI_GPIO help Internal helper functions for S5PC100 based SDHCI systems +config S5PC100_SETUP_SDHCI_GPIO + bool + help + Common setup code for SDHCI gpio. + config MACH_SMDKC100 bool "SMDKC100" select CPU_S5PC100
@@ -28,9 +52,9 @@ config MACH_SMDKC100 select S3C_DEV_HSMMC select S3C_DEV_HSMMC1 select S3C_DEV_HSMMC2 - select S5PC1XX_SETUP_I2C0 - select S5PC1XX_SETUP_I2C1 - select S5PC1XX_SETUP_FB_24BPP + select S5PC100_SETUP_I2C0 + select S5PC100_SETUP_I2C1 + select S5PC100_SETUP_FB_24BPP select S5PC100_SETUP_SDHCI help Machine support for the Samsung SMDKC100
arch/arm/mach-s5pc100/Makefile +4 -0
@@ -19,7 +19,11 @@ obj-$(CONFIG_CPU_S5PC100) += uarts.o # Helper and device support +obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o +obj-$(CONFIG_S5PC100_SETUP_I2C0) += setup-i2c0.o +obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.o +obj-$(CONFIG_S5PC100_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o # machine support obj-$(CONFIG_MACH_SMDKC100) += mach-smdkc100.o
arch/arm/mach-s5pc100/setup-fb-24bpp.c renamed from arch/arm/plat-s5pc1xx/setup-fb-24bpp.c +0 -0
arch/arm/mach-s5pc100/setup-i2c0.c renamed from arch/arm/plat-s5pc1xx/setup-i2c0.c +0 -0
arch/arm/mach-s5pc100/setup-i2c1.c renamed from arch/arm/plat-s5pc1xx/setup-i2c1.c +0 -0
arch/arm/mach-s5pc100/setup-sdhci-gpio.c renamed from arch/arm/plat-s5pc1xx/setup-sdhci-gpio.c +0 -0
arch/arm/plat-s5pc1xx/Kconfig +0 -24
@@ -37,28 +37,4 @@ endchoice # platform specific device setup -config S5PC1XX_SETUP_FB_24BPP - bool - help - Common setup code for S5PC1XX with an 24bpp RGB display helper. - -config S5PC1XX_SETUP_I2C0 - bool - default y - help - Common setup code for i2c bus 0. - - Note, currently since i2c0 is always compiled, this setup helper - is always compiled with it. - -config S5PC1XX_SETUP_I2C1 - bool - help - Common setup code for i2c bus 1. - -config S5PC1XX_SETUP_SDHCI_GPIO - bool - help - Common setup code for SDHCI gpio. - endif
arch/arm/plat-s5pc1xx/Makefile +0 -4
@@ -21,7 +21,3 @@ obj-y += gpiolib.o # Device setup obj-$(CONFIG_S5P_GPIO_CFG_S5PC1XX) += gpio-config.o -obj-$(CONFIG_S5PC1XX_SETUP_FB_24BPP) += setup-fb-24bpp.o -obj-$(CONFIG_S5PC1XX_SETUP_I2C0) += setup-i2c0.o -obj-$(CONFIG_S5PC1XX_SETUP_I2C1) += setup-i2c1.o -obj-$(CONFIG_S5PC1XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
Signature · 1 line
1.6.4
PATCH 8/20 ARM: S5PC1XX: move common s5pc1xx s3c-fb regs to platform directory
In reply to Marek SzyprowskiFrom: Pawel Osciak <[email protected]>
Framebuffer register blocks on S5PC100 and S5PC110 differ only slightly. This patch moves all register definitions that are common for S5PC100 and S5PC110 to plat-s3c/plat/regs-fb-v5.h.
---
arch/arm/mach-s5pc100/include/mach/regs-fb.h | 133 ++------------------
.../include/plat/regs-fb-v5.h} | 15 +--
2 files changed, 15 insertions(+), 133 deletions(-)
copy arch/arm/{mach-s5pc100/include/mach/regs-fb.h => plat-s3c/include/plat/regs-fb-v5.h} (93%)arch/arm/mach-s5pc100/include/mach/regs-fb.h +8 -125
@@ -1,139 +1,22 @@ -/* arch/arm/mach-s5pc100/include/mach/regs-fb.h -* +/* * Copyright 2009 Samsung Electronics Co. * Pawel Osciak <[email protected]> * -* Framebuffer register definitions for Samsung S5PC100. +* Machine-specific framebuffer definitions for Samsung S5PC100. * * 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. -*/ - -#ifndef __ASM_ARCH_REGS_FB_H -#define __ASM_ARCH_REGS_FB_H __FILE__ - -#include <plat/regs-fb-v4.h> - -/* VP1 interface timing control */ -#define VP1CON0 (0x118) -#define VP1_RATECON_EN (1 << 31) -#define VP1_CLKRATE_MASK (0xff) - -#define VP1CON1 (0x11c) -#define VP1_VTREGCON_EN (1 << 31) -#define VP1_VBPD_MASK (0xfff) -#define VP1_VBPD_SHIFT (16) - - -#define WPALCON_H (0x19c) -#define WPALCON_L (0x1a0) - -/* Pallete contro for WPAL0 and WPAL1 is the same as in S3C64xx, but -* different for WPAL2-4 -*/ -/* In WPALCON_L (aka WPALCON) */ -#define WPALCON_W1PAL_32BPP_A888 (0x7 << 3) -#define WPALCON_W0PAL_32BPP_A888 (0x7 << 0) - -/* To set W2PAL-W4PAL consist of one bit from WPALCON_L and two from WPALCON_H, -* e.g. W2PAL[2..0] is made of (WPALCON_H[10..9], WPALCON_L[6]). -*/ -#define WPALCON_L_WxPAL_L_MASK (0x1) -#define WPALCON_L_W2PAL_L_SHIFT (6) -#define WPALCON_L_W3PAL_L_SHIFT (7) -#define WPALCON_L_W4PAL_L_SHIFT (8) - -#define WPALCON_L_WxPAL_H_MASK (0x3) -#define WPALCON_H_W2PAL_H_SHIFT (9) -#define WPALCON_H_W3PAL_H_SHIFT (13) -#define WPALCON_H_W4PAL_H_SHIFT (17) - -/* Per-window alpha value registers */ -/* For window 0 8-bit alpha values are in VIDW0ALPHAx, -* for windows 1-4 alpha values consist of two parts, the 4 low bits are -* taken from VIDWxALPHAx and 4 high bits are from VIDOSDxC, -* e.g. WIN1_ALPHA0_B[7..0] = (VIDOSD1C[3..0], VIDW1ALPHA0[3..0]) -*/ -#define VIDWxALPHA0 (_win) (0x200 + (_win * 8)) -#define VIDWxALPHA1 (_win) (0x204 + (_win * 8)) - -/* Only for window 0 in VIDW0ALPHAx. */ -#define VIDW0ALPHAx_R (_x) ((_x) << 16) -#define VIDW0ALPHAx_R_MASK (0xff << 16) -#define VIDW0ALPHAx_R_SHIFT (16) -#define VIDW0ALPHAx_G (_x) ((_x) << 8) -#define VIDW0ALPHAx_G_MASK (0xff << 8) -#define VIDW0ALPHAx_G_SHIFT (8) -#define VIDW0ALPHAx_B (_x) ((_x) << 0) -#define VIDW0ALPHAx_B_MASK (0xff << 0) -#define VIDW0ALPHAx_B_SHIFT (0) - -/* Low 4 bits of alpha0-1 for windows 1-4 */ -#define VIDW14ALPHAx_R_L (_x) ((_x) << 16) -#define VIDW14ALPHAx_R_L_MASK (0xf << 16) -#define VIDW14ALPHAx_R_L_SHIFT (16) -#define VIDW14ALPHAx_G_L (_x) ((_x) << 8) -#define VIDW14ALPHAx_G_L_MASK (0xf << 8) -#define VIDW14ALPHAx_G_L_SHIFT (8) -#define VIDW14ALPHAx_B_L (_x) ((_x) << 0) -#define VIDW14ALPHAx_B_L_MASK (0xf << 0) -#define VIDW14ALPHAx_B_L_SHIFT (0) - - -/* Per-window blending equation control registers */ -#define BLENDEQx (_win) (0x244 + ((_win) * 4)) -#define BLENDEQ1 (0x244) -#define BLENDEQ2 (0x248) -#define BLENDEQ3 (0x24c) -#define BLENDEQ4 (0x250) - -#define BLENDEQx_Q_FUNC (_x) ((_x) << 18) -#define BLENDEQx_Q_FUNC_MASK (0xf << 18) -#define BLENDEQx_P_FUNC (_x) ((_x) << 12) -#define BLENDEQx_P_FUNC_MASK (0xf << 12) -#define BLENDEQx_B_FUNC (_x) ((_x) << 6) -#define BLENDEQx_B_FUNC_MASK (0xf << 6) -#define BLENDEQx_A_FUNC (_x) ((_x) << 0) -#define BLENDEQx_A_FUNC_MASK (0xf << 0) - -#define BLENDCON (0x260) -#define BLENDCON_8BIT_ALPHA (1 << 0) - -/* Per-window palette base addresses (start of palette memory). -* Each window palette area consists of 256 32-bit entries. -* START is the first address (entry 0th), END is the address of 255th entry. */ -#define WIN0_PAL_BASE (0x2400) -#define WIN0_PAL_END (0x27fc) -#define WIN1_PAL_BASE (0x2800) -#define WIN1_PAL_END (0x2bfc) -#define WIN2_PAL_BASE (0x2c00) -#define WIN2_PAL_END (0x2ffc) -#define WIN3_PAL_BASE (0x3000) -#define WIN3_PAL_END (0x33fc) -#define WIN4_PAL_BASE (0x3400) -#define WIN4_PAL_END (0x37fc) -#define WIN0_PAL (_entry) (WIN0_PAL_BASE + ((_entry) * 4)) -#define WIN1_PAL (_entry) (WIN1_PAL_BASE + ((_entry) * 4)) -#define WIN2_PAL (_entry) (WIN2_PAL_BASE + ((_entry) * 4)) -#define WIN3_PAL (_entry) (WIN3_PAL_BASE + ((_entry) * 4)) -#define WIN4_PAL (_entry) (WIN4_PAL_BASE + ((_entry) * 4)) +#ifndef __ASM_ARCH_MACH_REGS_FB_H +#define __ASM_ARCH_MACH_REGS_FB_H __FILE__ -static inline unsigned int s3c_fb_pal_reg (unsigned int window,int reg) -{ -switch (window) { -case 0 :return WIN0_PAL (reg); -case 1 :return WIN1_PAL (reg); -case 2 :return WIN2_PAL (reg); -case 3 :return WIN3_PAL (reg); -case 4 :return WIN4_PAL (reg); - } +#include <plat/regs-fb-v5.h> -BUG (); -} +#define PRTCON (0xc) +#define PRTCON_PROTECT (1 << 11) -#endif /* __ASM_ARCH_REGS_FB_H */ +#endif /* __ASM_ARCH_MACH_REGS_FB_H */
arch/arm/plat-s3c/include/plat/regs-fb-v5.h renamed from arch/arm/mach-s5pc100/include/mach/regs-fb.h +7 -8
@@ -1,17 +1,16 @@ -/* arch/arm/mach-s5pc100/include/mach/regs-fb.h -* +/* * Copyright 2009 Samsung Electronics Co. * Pawel Osciak <[email protected]> * -* Framebuffer register definitions for Samsung S5PC100. +* Common framebuffer register definitions for Samsung S5PC1xx family. * * 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. -*/ +*/ -#ifndef __ASM_ARCH_REGS_FB_H -#define __ASM_ARCH_REGS_FB_H __FILE__ +#ifndef __ASM_ARCH_REGS_FB_V5_H +#define __ASM_ARCH_REGS_FB_V5_H __FILE__#include <plat/regs-fb-v4.h>
@@ -36,7 +35,7 @@#define WPALCON_W1PAL_32BPP_A888 (0x7 << 3)#define WPALCON_W0PAL_32BPP_A888 (0x7 << 0) -/* To set W2PAL-W4PAL consist of one bit from WPALCON_L and two from WPALCON_H, +/* W2PAL-W4PAL consist of one bit from WPALCON_L and two from WPALCON_H, * e.g. W2PAL[2..0] is made of (WPALCON_H[10..9], WPALCON_L[6]). */ #define WPALCON_L_WxPAL_L_MASK (0x1)
@@ -135,5 +134,5 @@ static inline unsigned int s3c_fb_pal_reg(unsigned int window, int reg) } -#endif /* __ASM_ARCH_REGS_FB_H */ +#endif /* __ASM_ARCH_REGS_FB_V5_H */
Signature · 1 line
1.6.4
PATCH 9/20 drivers: serial: add support for Samsung S5PC110 SoC uart
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoCs have UART that differs a bit from the one known from the previous Samsung SoCs. This patch adds support for this new driver.
--- arch/arm/plat-s3c/include/plat/regs-serial.h | 31 ++++++ drivers/serial/Kconfig | 7 ++ drivers/serial/Makefile | 1 + drivers/serial/s5pc110.c | 143 ++++++++++++++++++++++++++ 4 files changed, 182 insertions(+), 0 deletions(-) create mode 100644 drivers/serial/s5pc110.c
arch/arm/plat-s3c/include/plat/regs-serial.h +31 -0
@@ -194,6 +194,37 @@#define S3C64XX_UINTSP 0x34#define S3C64XX_UINTM 0x38 +/* S5PC110 UCON */ +#define S5PC110_UCON_CLKMASK (1<<10) +#define S5PC110_UCON_PCLK (0<<10) +#define S5PC110_UCON_SCLK_UART (1<<10) + +/* S5PC110 FIFO trigger levels */ +#define S5PC110_UFCON_RXTRIG1 (0<<4) +#define S5PC110_UFCON_RXTRIG4 (1<<4) +#define S5PC110_UFCON_RXTRIG8 (2<<4) +#define S5PC110_UFCON_RXTRIG16 (3<<4) +#define S5PC110_UFCON_RXTRIG32 (4<<4) +#define S5PC110_UFCON_RXTRIG64 (5<<4) +#define S5PC110_UFCON_RXTRIG128 (6<<4) +#define S5PC110_UFCON_RXTRIG256 (7<<4) + +#define S5PC110_UFCON_TXTRIG1 (0<<8) +#define S5PC110_UFCON_TXTRIG4 (1<<8) +#define S5PC110_UFCON_TXTRIG8 (2<<8) +#define S5PC110_UFCON_TXTRIG16 (3<<8) +#define S5PC110_UFCON_TXTRIG32 (4<<8) +#define S5PC110_UFCON_TXTRIG64 (5<<8) +#define S5PC110_UFCON_TXTRIG128 (6<<8) +#define S5PC110_UFCON_TXTRIG256 (7<<8) + +#define S5PC110_UFSTAT_TXFULL (1<<24) +#define S5PC110_UFSTAT_RXFULL (1<<8) +#define S5PC110_UFSTAT_TXSHIFT (16) +#define S5PC110_UFSTAT_RXSHIFT (0) +#define S5PC110_UFSTAT_TXMASK (255<<16) +#define S5PC110_UFSTAT_RXMASK (255) +#ifndef __ASSEMBLY__/* struct s3c24xx_uart_clksrc
drivers/serial/Kconfig +7 -0
@@ -540,6 +540,13 @@ config SERIAL_S5PC100 help Serial port support for the Samsung S5PC100 SoCs +config SERIAL_S5PC110 + tristate "Samsung S5PC110 Serial port support" + depends on SERIAL_SAMSUNG && CPU_S5PC110 + default y + help + Serial port support for the Samsung S5PC110 SoCs + config SERIAL_MAX3100 tristate "MAX3100 support" depends on SPI
drivers/serial/Makefile +1 -0
@@ -45,6 +45,7 @@ obj-$(CONFIG_SERIAL_S3C2440) += s3c2440.o obj-$(CONFIG_SERIAL_S3C24A0) += s3c24a0.o obj-$(CONFIG_SERIAL_S3C6400) += s3c6400.o obj-$(CONFIG_SERIAL_S5PC100) += s3c6400.o +obj-$(CONFIG_SERIAL_S5PC110) += s5pc110.o obj-$(CONFIG_SERIAL_MAX3100) += max3100.o obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o obj-$(CONFIG_SERIAL_MUX) += mux.o
drivers/serial/s5pc110.c new file +143 -0
143 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 10/20 ARM: S5PC1XX: add S5PC110 memory map
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds register map for S5PC110 sub-platform.
--- arch/arm/mach-s5pc110/include/mach/map.h | 154 ++++++++++++++++++++++++++++++ 1 files changed, 154 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/include/mach/map.h
arch/arm/mach-s5pc110/include/mach/map.h new file +154 -0
@@ -0,0 +1,154 @@ +/* linux/arch/arm/mach-s5pc110/include/mach/map.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* Based on mach-s3c6400/include/mach/map.h +* +* S5PC110 - Memory map definitions +* +* 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. +*/ + +#ifndef __ASM_ARCH_MAP_H +#define __ASM_ARCH_MAP_H __FILE__ + +#include <plat/map-base.h> + +/* +* map-base.h has already defined virtual memory address +* S3C_VA_IRQ S3C_ADDR(0x00000000) irq controller(s) +* S3C_VA_SYS S3C_ADDR(0x00100000) system control +* S3C_VA_MEM S3C_ADDR(0x00200000) system control (not used) +* S3C_VA_TIMER S3C_ADDR(0x00300000) timer block +* S3C_VA_WATCHDOG S3C_ADDR(0x00400000) watchdog +* S3C_VA_UART S3C_ADDR(0x01000000) UART +* +* S5PC110 specific virtual memory address can be defined here +* S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) GPIO +* +*/ + +/* Chip ID */ +#define S5PC110_PA_CHIPID (0xE0000000) +#define S5PC1XX_PA_CHIPID S5PC110_PA_CHIPID +#define S5PC1XX_VA_CHIPID S3C_VA_SYS + +/* System */ +#define S5PC110_PA_CLK (0xE0100000) +#define S5PC110_PA_PWR (0xE010C000) +#define S5PC1XX_PA_CLK S5PC110_PA_CLK +#define S5PC1XX_PA_PWR S5PC110_PA_PWR +#define S5PC1XX_VA_CLK (S3C_VA_SYS + 0x10000) +#define S5PC1XX_VA_PWR (S3C_VA_SYS + 0x20000) +#define S5PC1XX_SZ_CLK SZ_32K +#define S5PC1XX_SZ_PWR SZ_16K + +/* GPIO */ +#define S5PC110_PA_GPIO (0xE0200000) +#define S5PC1XX_PA_GPIO S5PC110_PA_GPIO +#define S5PC1XX_VA_GPIO S3C_ADDR(0x00500000) + +/* Interrupt */ +#define S5PC110_PA_VIC (0xF2000000) +#define S5PC110_PA_VIC_OFFSET 0x100000 +#define S5PC1XX_PA_VIC (x) (S5PC110_PA_VIC + ((x) * S5PC110_PA_VIC_OFFSET)) +#define S5PC110_VA_VIC S3C_VA_IRQ +#define S5PC110_VA_VIC_OFFSET 0x10000 +#define S5PC1XX_VA_VIC (x) (S5PC110_VA_VIC + ((x) * S5PC110_VA_VIC_OFFSET)) + +/* DMA */ +#define S5PC110_PA_MDMA (0xFA200000) +#define S5PC110_PA_PDMA0 (0xE0900000) +#define S5PC110_PA_PDMA1 (0xE0A00000) + +/* Timer */ +#define S5PC110_PA_TIMER (0xE2500000) +#define S5PC1XX_PA_TIMER S5PC110_PA_TIMER +#define S5PC1XX_VA_TIMER S3C_VA_TIMER + +/* RTC */ +#define S5PC110_PA_RTC (0xE2800000) +#define S5PC1XX_PA_RTC S5PC110_PA_RTC + +/* UART */ +#define S5PC110_PA_UART (0xE2900000) +#define S5PC1XX_PA_UART S5PC110_PA_UART +#define S5PC110_PA_UART0 (S5PC110_PA_UART + 0x0) +#define S5PC110_PA_UART1 (S5PC110_PA_UART + 0x400) +#define S5PC110_PA_UART2 (S5PC110_PA_UART + 0x800) +#define S5PC110_PA_UART3 (S5PC110_PA_UART + 0xC00) +#define S5PC1XX_VA_UART S3C_VA_UART + +/* I2C */ +#define S5PC110_PA_I2C (0xE1800000) +#define S5PC110_PA_I2C1 (0xFAB00000) +#define S5PC110_PA_I2C2 (0xE1A00000) + +/* USB HS OTG */ +#define S5PC110_PA_USB_HSOTG (0xEC000000) +#define S5PC110_PA_USB_HSPHY (0xEC100000) + +/* SD/MMC */ +#define S5PC110_PA_HSMMC (x) (0xEB000000 + ((x) * 0x100000)) +#define S5PC110_PA_HSMMC0 S5PC110_PA_HSMMC(0) +#define S5PC110_PA_HSMMC1 S5PC110_PA_HSMMC(1) +#define S5PC110_PA_HSMMC2 S5PC110_PA_HSMMC(2) +#define S5PC110_PA_HSMMC3 S5PC110_PA_HSMMC(2) + +/* LCD */ +#define S5PC110_PA_FB (0xF8000000) + +/* Multimedia */ +#define S5PC110_PA_MFC (0xF1700000) +#define S5PC110_SZ_MFC (0x0000FFFF) + +/* I2S */ +#define S5PC110_PA_I2S0 (0xEEE30000) +#define S5PC110_PA_I2S1 (0xE2100000) +#define S5PC110_PA_I2S2 (0xE2A00000) + +/* KEYPAD */ +#define S5PC110_PA_KEYPAD (0xE1600000) + +/* ADC & TouchScreen */ +#define S5PC110_PA_TSADC (0xE1700000) + +/* ETC */ +#define S5PC110_PA_SDRAM (0x30000000) +#define S5PC1XX_PA_SDRAM S5PC110_PA_SDRAM + +/* compatibility defines. */ +#define S3C_PA_RTC S5PC1XX_PA_RTC +#define S3C_PA_UART S5PC1XX_PA_UART +#define S3C_PA_UART0 S5PC110_PA_UART0 +#define S3C_PA_UART1 S5PC110_PA_UART1 +#define S3C_PA_UART2 S5PC110_PA_UART2 +#define S3C_PA_UART3 S5PC110_PA_UART3 + +#define S3C_VA_UART0 (S3C_VA_UART + 0x0) +#define S3C_VA_UART1 (S3C_VA_UART + 0x400) +#define S3C_VA_UART2 (S3C_VA_UART + 0x800) +#define S3C_VA_UART3 (S3C_VA_UART + 0xC00) +#define S3C_UART_OFFSET 0x400 +#define S3C_VA_UARTx (x) (S3C_VA_UART + ((x) * S3C_UART_OFFSET)) + +#define S3C_PA_FB S5PC110_PA_FB +#define S3C_VA_VIC0 (S3C_VA_IRQ + 0x0) +#define S3C_VA_VIC1 (S3C_VA_IRQ + 0x10000) +#define S3C_VA_VIC2 (S3C_VA_IRQ + 0x20000) +#define S3C_VA_VIC3 (S3C_VA_IRQ + 0x30000) +#define S3C_PA_IIC S5PC110_PA_I2C +#define S3C_PA_IIC1 S5PC110_PA_I2C1 +#define S3C_PA_IIC2 S5PC110_PA_I2C2 +#define S3C_PA_USB_HSOTG S5PC110_PA_USB_HSOTG +#define S3C_PA_USB_HSPHY S5PC110_PA_USB_HSPHY +#define S3C_PA_HSMMC0 S5PC110_PA_HSMMC0 +#define S3C_PA_HSMMC1 S5PC110_PA_HSMMC1 +#define S3C_PA_HSMMC2 S5PC110_PA_HSMMC2 +#define S3C_PA_KEYPAD S5PC110_PA_KEYPAD +#define S3C_PA_TSADC S5PC110_PA_TSADC + +#endif /* __ASM_ARCH_C100_MAP_H */
Signature · 1 line
1.6.4
PATCH 11/20 ARM: S5PC1XX: add S5PC110 cpu initialization code
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds CPU initialization code for S5PC110 sub-platform.
--- arch/arm/mach-s5pc110/Kconfig | 17 +++ arch/arm/mach-s5pc110/Makefile | 18 ++++ arch/arm/mach-s5pc110/Makefile.boot | 2 + arch/arm/mach-s5pc110/cpu.c | 117 ++++++++++++++++++++++ arch/arm/mach-s5pc110/include/mach/debug-macro.S | 54 ++++++++++ arch/arm/mach-s5pc110/include/mach/entry-macro.S | 56 ++++++++++ arch/arm/mach-s5pc110/include/mach/system.h | 31 ++++++ arch/arm/mach-s5pc110/include/plat/regs-power.h | 79 +++++++++++++++ arch/arm/mach-s5pc110/uarts.c | 28 +++++ arch/arm/plat-s5pc1xx/cpu.c | 9 ++ arch/arm/plat-s5pc1xx/include/plat/s5pc110.h | 36 +++++++ arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h | 1 + 12 files changed, 448 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/Kconfig create mode 100644 arch/arm/mach-s5pc110/Makefile create mode 100644 arch/arm/mach-s5pc110/Makefile.boot create mode 100644 arch/arm/mach-s5pc110/cpu.c create mode 100644 arch/arm/mach-s5pc110/include/mach/debug-macro.S create mode 100644 arch/arm/mach-s5pc110/include/mach/entry-macro.S create mode 100644 arch/arm/mach-s5pc110/include/mach/system.h create mode 100644 arch/arm/mach-s5pc110/include/plat/regs-power.h create mode 100644 arch/arm/mach-s5pc110/uarts.c create mode 100644 arch/arm/plat-s5pc1xx/include/plat/s5pc110.h
arch/arm/mach-s5pc110/Kconfig new file +17 -0
@@ -0,0 +1,17 @@ +# arch/arm/mach-s5pc110/Kconfig +# +# Copyright 2009 Samsung Electronics Co. +# Kyungmin Park <[email protected]> +# +# Licensed under GPLv2 + +if ARCH_S5PC110 + +# Configuration options for the S5PC110 CPU + +config CPU_S5PC110 + bool + help + Enable S5PC110 CPU support + +endif
arch/arm/mach-s5pc110/Makefile new file +18 -0
@@ -0,0 +1,18 @@ +# arch/arm/mach-s5pc100/Makefile +# +# Copyright 2009 Samsung Electronics Co. +# +# Licensed under GPLv2 + +obj-y := +obj-m := +obj-n := +obj- := + +# Core support for S5PC110 system + +obj-$(CONFIG_CPU_S5PC110) += cpu.o + +# Helper and device support + +# machine support
arch/arm/mach-s5pc110/Makefile.boot new file +2 -0
@@ -0,0 +1,2 @@ + zreladdr-y := 0x30008000 +params_phys-y := 0x30000100
arch/arm/mach-s5pc110/cpu.c new file +117 -0
117 lines not on this page · raw message
arch/arm/mach-s5pc110/include/mach/debug-macro.S new file +54 -0
54 lines not on this page · raw message
arch/arm/mach-s5pc110/include/mach/entry-macro.S new file +56 -0
56 lines not on this page · raw message
arch/arm/mach-s5pc110/include/mach/system.h new file +31 -0
@@ -0,0 +1,31 @@ +/* linux/arch/arm/mach-s5pc110/include/mach/system.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* S5PC110 - system implementation +* +* Based on mach-s3c6400/include/mach/system.h +*/ + +#ifndef __ASM_ARCH_SYSTEM_H +#define __ASM_ARCH_SYSTEM_H __FILE__ + +#include <linux/io.h> +#include <mach/map.h> +#include <plat/regs-clock.h> + +void (*s5pc1xx_idle)(void ); + +static void arch_idle (void ) +{ +if (s5pc1xx_idle) +s5pc1xx_idle (); +} + +static void arch_reset (char mode,const char *cmd) +{ +__raw_writel (0x1 ,S5PC110_SWRESET ); +return ; +} +#endif /* __ASM_ARCH_IRQ_H */
arch/arm/mach-s5pc110/include/plat/regs-power.h new file +79 -0
79 lines not on this page · raw message
arch/arm/mach-s5pc110/uarts.c new file +28 -0
@@ -0,0 +1,28 @@ +/* +* linux/arch/arm/mach-s5pc110/uarts.c +* +* Copyright 2009 Samsung Electronics Co. +* +* S5PC110 - CPU initialisation +* +* 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. +*/ + +#include <linux/kernel.h> +#include <linux/types.h> +#include <linux/init.h> +#include <linux/clk.h> + +#include <plat/cpu.h> +#include <plat/devs.h> +#include <plat/s5pc1xx.h> + +/* uart registration process */ + +void __init s5pc110_init_uarts (struct s3c2410_uartcfg *cfg,int no) +{ +/* The driver name is s5pc1xx-uart to reuse s5pc1xx_serial_drv */ +s3c24xx_init_uartdevs ("s5pc110-uart" , s5pc1xx_uart_resources, cfg, no); +}
arch/arm/plat-s5pc1xx/cpu.c +9 -0
@@ -36,6 +36,7 @@/* table of supported CPUs */ static const char name_s5pc100[] ="S5PC100" ; +static const char name_s5pc110[] ="S5PC110" ;static struct cpu_table cpu_ids[]__initdata = { {
@@ -46,6 +47,14 @@ static struct cpu_table cpu_ids[] __initdata = { .init_uarts = s5pc100_init_uarts, .init = s5pc100_init, .name = name_s5pc100, + }, { + .idcode = 0x43110000, + .idmask = 0xfffff000, + .map_io = s5pc110_map_io, + .init_clocks = s5pc110_init_clocks, + .init_uarts = s5pc110_init_uarts, + .init = s5pc110_init, + .name = name_s5pc110, }, };/* minimal IO mapping */
arch/arm/plat-s5pc1xx/include/plat/s5pc110.h new file +36 -0
@@ -0,0 +1,36 @@ +/* arch/arm/plat-s5pc1xx/include/plat/s5pc100.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* Header file for s5pc100 cpu support +* +* Based on plat-s3c64xx/include/plat/s3c6400.h +* +* 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. +*/ + +/* Common init code for S5PC110 related SoCs */ + +#ifdef CONFIG_CPU_S5PC110 + +extern void s5pc110_map_io (void ); +extern void s5pc110_init_clocks (int xtal); +extern void s5pc110_init_uarts (struct s3c2410_uartcfg *cfg,int no); +extern int s5pc110_init (void ); + +extern void s5pc110_common_init_uarts (struct s3c2410_uartcfg *cfg,int no); +extern void s5pc110_init_irq (void ); +extern void s5pc110_register_clocks (void ); +extern void s5pc110_setup_clocks (void ); + +#else + +#define s5pc110_map_io NULL +#define s5pc110_init_clocks NULL +#define s5pc110_init_uarts NULL +#define s5pc110_init NULL + +#endif
arch/arm/plat-s5pc1xx/include/plat/s5pc1xx.h +1 -0
@@ -19,3 +19,4 @@ extern void s5pc1xx_register_clocks(void);extern struct s3c24xx_uart_resources s5pc1xx_uart_resources[];#include <plat/s5pc100.h> +#include <plat/s5pc110.h>
Signature · 1 line
1.6.4
PATCH 12/20 ARM: S5PC1XX: add support for s5pc110 plls and clocks
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds clocks and plls definition for S5PC110 SoCs.
--- arch/arm/mach-s5pc100/plls.c | 8 +- arch/arm/mach-s5pc110/Makefile | 3 + arch/arm/mach-s5pc110/clocks.c | 249 +++++ arch/arm/mach-s5pc110/cpu.c | 3 + arch/arm/mach-s5pc110/include/plat/regs-clock.h | 347 ++++++ arch/arm/mach-s5pc110/plls.c | 1287 +++++++++++++++++++++++ arch/arm/plat-s5pc1xx/include/plat/pll.h | 8 +- arch/arm/plat-s5pc1xx/include/plat/s5pc110.h | 19 + 8 files changed, 1918 insertions(+), 6 deletions(-) create mode 100644 arch/arm/mach-s5pc110/clocks.c create mode 100644 arch/arm/mach-s5pc110/include/plat/regs-clock.h create mode 100644 arch/arm/mach-s5pc110/plls.c
arch/arm/mach-s5pc100/plls.c +4 -4
@@ -1050,10 +1050,10 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)printk (KERN_DEBUG "%s: xtal is %ld\n" , __func__, xtal); - apll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_APLL_CON )); - mpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_MPLL_CON )); - epll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_EPLL_CON )); - hpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_HPLL_CON )); + apll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_APLL_CON ),0 ); + mpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_MPLL_CON ),0 ); + epll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_EPLL_CON ),0 ); + hpll =s5pc1xx_get_pll (xtal,__raw_readl (S5PC100_HPLL_CON ),0 ); printk(KERN_INFO "S5PC100: Apll=%ld.%03ld Mhz, Mpll=%ld.%03ld Mhz" ", Epll=%ld.%03ld Mhz, Hpll=%ld.%03ld Mhz\n",
arch/arm/mach-s5pc110/Makefile +3 -0
@@ -12,6 +12,9 @@ obj- := # Core support for S5PC110 system obj-$(CONFIG_CPU_S5PC110) += cpu.o +obj-$(CONFIG_CPU_S5PC110) += clocks.o +obj-$(CONFIG_CPU_S5PC110) += plls.o +obj-$(CONFIG_CPU_S5PC110) += uarts.o # Helper and device support
arch/arm/mach-s5pc110/clocks.c new file +249 -0
249 lines not on this page · raw message
arch/arm/mach-s5pc110/cpu.c +3 -0
@@ -86,6 +86,9 @@ void __init s5pc110_init_clocks(int xtal) {printk (KERN_DEBUG "%s: initialising clocks\n" , __func__);s3c24xx_register_baseclocks (xtal); +s5pc1xx_register_clocks (); +s5pc110_register_clocks (); +s5pc110_setup_clocks (); }void __init s5pc110_init_irq (void )
arch/arm/mach-s5pc110/include/plat/regs-clock.h new file +347 -0
347 lines not on this page · raw message
arch/arm/mach-s5pc110/plls.c new file +1287 -0
1,287 lines not on this page · raw message
arch/arm/plat-s5pc1xx/include/plat/pll.h +6 -2
@@ -22,7 +22,7 @@#include <asm/div64.h> static inline unsigned long s5pc1xx_get_pll (unsigned long baseclk, -u32 pllcon) +u32 pllcon,int sub) {u32 mdiv, pdiv, sdiv;u64 fvco = baseclk;
@@ -32,7 +32,11 @@ static inline unsigned long s5pc1xx_get_pll(unsigned long baseclk, sdiv = (pllcon >>S5P_PLL_SDIV_SHIFT ) &S5P_PLL_SDIV_MASK ; fvco *= mdiv; -do_div (fvco, (pdiv << sdiv)); + +if (sub) +do_div (fvco, (pdiv << (sdiv -1 ))); +else +do_div (fvco, (pdiv << sdiv));return (unsigned long )fvco; }
arch/arm/plat-s5pc1xx/include/plat/s5pc110.h +19 -0
@@ -16,6 +16,8 @@#ifdef CONFIG_CPU_S5PC110 +struct s3c2410_uartcfg ; +extern void s5pc110_map_io (void );extern void s5pc110_init_clocks (int xtal);extern void s5pc110_init_uarts (struct s3c2410_uartcfg *cfg,int no);
@@ -26,6 +28,23 @@ extern void s5pc110_init_irq(void);extern void s5pc110_register_clocks (void );extern void s5pc110_setup_clocks (void ); +extern struct clk clk_hpll; +extern struct clk clk_hd0; +extern struct clk clk_pd0; +extern struct clk clk_54m; +extern struct clk clk_30m; +extern struct clk clk_dout_hclkm; +extern struct clk clk_dout_hclkd; +extern struct clk clk_dout_hclkp; +extern struct clk clk_dout_pclkd; +extern struct clk clk_dout_pclkp; + +extern int s5pc110_ip0_ctrl (struct clk *clk,int enable); +extern int s5pc110_ip1_ctrl (struct clk *clk,int enable); +extern int s5pc110_ip2_ctrl (struct clk *clk,int enable); +extern int s5pc110_ip3_ctrl (struct clk *clk,int enable); +extern int s5pc110_ip4_ctrl (struct clk *clk,int enable); +#else #define s5pc110_map_io NULL
Signature · 1 line
1.6.4
PATCH 13/20 ARM: S5PC1XX: add support for s5pc110 irqs
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds interrupt support on S5PC110 SoCs. Unlike S5PC100, S5PC110 has 4 VICs, so the S5PC110 specifi virtual memory area is extended to cover VIC3 register block.
--- arch/arm/mach-s5pc110/cpu.c | 10 ++ arch/arm/mach-s5pc110/include/mach/regs-irq.h | 25 +++ arch/arm/mach-s5pc110/include/plat/irqs.h | 209 +++++++++++++++++++++++++ 3 files changed, 244 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/include/mach/regs-irq.h create mode 100644 arch/arm/mach-s5pc110/include/plat/irqs.h
arch/arm/mach-s5pc110/cpu.c +10 -0
@@ -43,6 +43,12 @@/* Initial IO mappings */ static struct map_desc s5pc110_iodesc[]__initdata = { + { + .virtual = (unsigned long )S5PC1XX_VA_VIC (3 ), + .pfn =__phys_to_pfn (S5PC1XX_PA_VIC (3 )), + .length =SZ_4K , + .type =MT_DEVICE , + }, };static void s5pc110_idle (void )
@@ -93,6 +99,10 @@ void __init s5pc110_init_clocks(int xtal)void __init s5pc110_init_irq (void ) { +u32 vic_valid[] = {~0 , ~0 , ~0 , ~0 }; + +/* VIC0, VIC1, VIC2, and VIC3 are fully populated. */ +s5pc1xx_init_irq (vic_valid,ARRAY_SIZE (vic_valid)); }struct sysdev_class s5pc110_sysclass = {
arch/arm/mach-s5pc110/include/mach/regs-irq.h new file +25 -0
@@ -0,0 +1,25 @@ +/* linux/arch/arm/mach-s5pc110/include/mach/regs-irq.h +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* S5PC110 - IRQ register definitions +* +* 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. +*/ + +#ifndef __ASM_ARCH_REGS_IRQ_H +#define __ASM_ARCH_REGS_IRQ_H __FILE__ + +#include <mach/map.h> +#include <asm/hardware/vic.h> + +/* interrupt controller */ +#define S5PC1XX_VIC0REG (x) ((x) + S5PC1XX_VA_VIC(0)) +#define S5PC1XX_VIC1REG (x) ((x) + S5PC1XX_VA_VIC(1)) +#define S5PC1XX_VIC2REG (x) ((x) + S5PC1XX_VA_VIC(2)) +#define S5PC1XX_VIC3REG (x) ((x) + S5PC1XX_VA_VIC(3)) + +#endif /* __ASM_ARCH_REGS_IRQ_H */
arch/arm/mach-s5pc110/include/plat/irqs.h new file +209 -0
209 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 14/20 ARM: S5PC1XX: add support for s5pc110 gpio
In reply to Marek SzyprowskiSamsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds gpiolib support for S5PC110 sub-platform.
--- arch/arm/mach-s5pc110/Makefile | 1 + arch/arm/mach-s5pc110/gpio-chips.c | 66 +++++++++ arch/arm/mach-s5pc110/include/mach/gpio.h | 187 ++++++++++++++++++++++++ arch/arm/mach-s5pc110/include/plat/regs-gpio.h | 65 ++++++++ 4 files changed, 319 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/gpio-chips.c create mode 100644 arch/arm/mach-s5pc110/include/mach/gpio.h create mode 100644 arch/arm/mach-s5pc110/include/plat/regs-gpio.h
arch/arm/mach-s5pc110/Makefile +1 -0
@@ -13,6 +13,7 @@ obj- := obj-$(CONFIG_CPU_S5PC110) += cpu.o obj-$(CONFIG_CPU_S5PC110) += clocks.o +obj-$(CONFIG_CPU_S5PC110) += gpio-chips.o obj-$(CONFIG_CPU_S5PC110) += plls.o obj-$(CONFIG_CPU_S5PC110) += uarts.o
arch/arm/mach-s5pc110/gpio-chips.c new file +66 -0
66 lines not on this page · raw message
arch/arm/mach-s5pc110/include/mach/gpio.h new file +187 -0
187 lines not on this page · raw message
arch/arm/mach-s5pc110/include/plat/regs-gpio.h new file +65 -0
65 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 15/20 ARM: S5PC1XX: add i2c platform helpers on s5pc110 sub-platform
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds required I2C platform helpers. S5PC110 SoCs has 3 I2C controllers.
--- arch/arm/mach-s5pc110/Kconfig | 18 +++++++++ arch/arm/mach-s5pc110/Makefile | 3 + arch/arm/mach-s5pc110/cpu.c | 3 + arch/arm/mach-s5pc110/setup-i2c0.c | 31 +++++++++++++++ arch/arm/mach-s5pc110/setup-i2c1.c | 31 +++++++++++++++ arch/arm/mach-s5pc110/setup-i2c2.c | 32 ++++++++++++++++ arch/arm/plat-s3c/Kconfig | 5 ++ arch/arm/plat-s3c/Makefile | 1 + arch/arm/plat-s3c/dev-i2c2.c | 69 ++++++++++++++++++++++++++++++++++ arch/arm/plat-s3c/include/plat/iic.h | 2 + 10 files changed, 195 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/setup-i2c0.c create mode 100644 arch/arm/mach-s5pc110/setup-i2c1.c create mode 100644 arch/arm/mach-s5pc110/setup-i2c2.c create mode 100644 arch/arm/plat-s3c/dev-i2c2.c
arch/arm/mach-s5pc110/Kconfig +18 -0
@@ -14,4 +14,22 @@ config CPU_S5PC110 help Enable S5PC110 CPU support +config S5PC110_SETUP_I2C0 + bool + default y + help + Common setup code for i2c bus 0. + + Note, currently since i2c0 is always compiled, this setup helper + is always compiled with it. + +config S5PC110_SETUP_I2C1 + bool + help + Common setup code for i2c bus 1. + +config S5PC110_SETUP_I2C2 + bool + help + Common setup code for i2c bus 2. endif
arch/arm/mach-s5pc110/Makefile +3 -0
@@ -18,5 +18,8 @@ obj-$(CONFIG_CPU_S5PC110) += plls.o obj-$(CONFIG_CPU_S5PC110) += uarts.o # Helper and device support +obj-$(CONFIG_S5PC110_SETUP_I2C0) += setup-i2c0.o +obj-$(CONFIG_S5PC110_SETUP_I2C1) += setup-i2c1.o +obj-$(CONFIG_S5PC110_SETUP_I2C2) += setup-i2c2.o # machine support
arch/arm/mach-s5pc110/cpu.c +3 -0
@@ -86,6 +86,9 @@ void __init s5pc110_map_io(void)iotable_init (s5pc110_iodesc,ARRAY_SIZE (s5pc110_iodesc));/* initialise device information early */ +/* the i2c devices are directly compatible with s3c2440 */ +s3c_i2c0_setname ("s3c2440-i2c" ); +s3c_i2c1_setname ("s3c2440-i2c" ); }void __init s5pc110_init_clocks (int xtal)
arch/arm/mach-s5pc110/setup-i2c0.c new file +31 -0
@@ -0,0 +1,31 @@ +/* +* linux/arch/arm/mach-s5pc110/setup-i2c2.c +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* Base S5PC110 I2C bus 0 gpio configuration +* +* Based on plat-s3c64xx/setup-i2c0.c +* +* 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. +*/ + +#include <linux/kernel.h> +#include <linux/types.h> + +struct platform_device ;/* don't need the contents */ + +#include <mach/gpio.h> +#include <plat/iic.h> +#include <plat/gpio-cfg.h> + +void s3c_i2c0_cfg_gpio (struct platform_device *dev) +{ +s3c_gpio_cfgpin (S5PC110_GPD1 (0 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC110_GPD1 (0 ),S3C_GPIO_PULL_UP ); +s3c_gpio_cfgpin (S5PC110_GPD1 (1 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC110_GPD1 (1 ),S3C_GPIO_PULL_UP ); +}
arch/arm/mach-s5pc110/setup-i2c1.c new file +31 -0
@@ -0,0 +1,31 @@ +/* +* linux/arch/arm/mach-s5pc110/setup-i2c1.c +* +* Copyright 2009 Samsung Electronics Co. +* Byungho Min <[email protected]> +* +* Base S5PC110 I2C bus 1 gpio configuration +* +* Based on plat-s3c64xx/setup-i2c1.c +* +* 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. +*/ + +#include <linux/kernel.h> +#include <linux/types.h> + +struct platform_device ;/* don't need the contents */ + +#include <mach/gpio.h> +#include <plat/iic.h> +#include <plat/gpio-cfg.h> + +void s3c_i2c1_cfg_gpio (struct platform_device *dev) +{ +s3c_gpio_cfgpin (S5PC110_GPD1 (2 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC110_GPD1 (2 ),S3C_GPIO_PULL_UP ); +s3c_gpio_cfgpin (S5PC110_GPD1 (3 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC110_GPD1 (3 ),S3C_GPIO_PULL_UP ); +}
arch/arm/mach-s5pc110/setup-i2c2.c new file +32 -0
@@ -0,0 +1,32 @@ +/* +* linux/arch/arm/mach-s5pc110/setup-i2c2.c +* +* Copyright (C) 2009 Samsung Electronics Co.Ltd +* Byungho Min <[email protected]> +* +* Base S5PC110 I2C bus 2 gpio configuration +* +* Based on plat-s3c64xx/setup-i2c1.c +* +* 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. +* +*/ + +#include <linux/kernel.h> +#include <linux/types.h> + +struct platform_device ;/* don't need the contents */ + +#include <mach/gpio.h> +#include <plat/iic.h> +#include <plat/gpio-cfg.h> + +void s3c_i2c2_cfg_gpio (struct platform_device *dev) +{ +s3c_gpio_cfgpin (S5PC110_GPD1 (4 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC110_GPD1 (4 ),S3C_GPIO_PULL_UP ); +s3c_gpio_cfgpin (S5PC110_GPD1 (5 ),S3C_GPIO_SFN (2 )); +s3c_gpio_setpull (S5PC110_GPD1 (5 ),S3C_GPIO_PULL_UP ); +}
arch/arm/plat-s3c/Kconfig +5 -0
@@ -194,6 +194,11 @@ config S3C_DEV_I2C1 help Compile in platform device definitions for I2C channel 1 +config S3C_DEV_I2C2 + bool + help + Compile in platform device definitions for I2C channel 2 + config S3C_DEV_FB bool help
arch/arm/plat-s3c/Makefile +1 -0
@@ -39,6 +39,7 @@ obj-$(CONFIG_S3C_DEV_HSMMC1) += dev-hsmmc1.o obj-$(CONFIG_S3C_DEV_HSMMC2) += dev-hsmmc2.o obj-y += dev-i2c0.o obj-$(CONFIG_S3C_DEV_I2C1) += dev-i2c1.o +obj-$(CONFIG_S3C_DEV_I2C2) += dev-i2c2.o obj-$(CONFIG_S3C_DEV_FB) += dev-fb.o obj-$(CONFIG_S3C_DEV_USB_HOST) += dev-usb.o obj-$(CONFIG_S3C_DEV_USB_HSOTG) += dev-usb-hsotg.o
arch/arm/plat-s3c/dev-i2c2.c new file +69 -0
69 lines not on this page · raw message
arch/arm/plat-s3c/include/plat/iic.h +2 -0
@@ -54,9 +54,11 @@ struct s3c2410_platform_i2c {*/ extern void s3c_i2c0_set_platdata (struct s3c2410_platform_i2c *i2c);extern void s3c_i2c1_set_platdata (struct s3c2410_platform_i2c *i2c); +extern void s3c_i2c2_set_platdata (struct s3c2410_platform_i2c *i2c);/* defined by architecture to configure gpio */ extern void s3c_i2c0_cfg_gpio (struct platform_device *dev);extern void s3c_i2c1_cfg_gpio (struct platform_device *dev); +extern void s3c_i2c2_cfg_gpio (struct platform_device *dev);#endif /* __ASM_ARCH_IIC_H */
Signature · 1 line
1.6.4
PATCH 16/20 ARM: S5PC1XX: enable S5PC110 sub-platform
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch enables S5PC110 sub-platform.
--- arch/arm/Kconfig | 1 + arch/arm/Makefile | 1 + arch/arm/plat-s5pc1xx/Kconfig | 3 +++ 3 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/Kconfig +1 -0
@@ -770,6 +770,7 @@ source "arch/arm/plat-stmp3xxx/Kconfig" if ARCH_S5PC1XX source "arch/arm/mach-s5pc100/Kconfig" +source "arch/arm/mach-s5pc110/Kconfig" endif source "arch/arm/mach-lh7a40x/Kconfig"
arch/arm/Makefile +1 -0
@@ -161,6 +161,7 @@ machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2400 s3c2412 s3c2440 s3c2442 s3c24 machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0 machine-$(CONFIG_ARCH_S3C64XX) := s3c6400 s3c6410 machine-$(CONFIG_ARCH_S5PC100) := s5pc100 +machine-$(CONFIG_ARCH_S5PC110) := s5pc110 machine-$(CONFIG_ARCH_SA1100) := sa1100 machine-$(CONFIG_ARCH_SHARK) := shark machine-$(CONFIG_ARCH_STMP378X) := stmp378x
arch/arm/plat-s5pc1xx/Kconfig +3 -0
@@ -30,6 +30,9 @@ choice config ARCH_S5PC100 bool "S5PC100" +config ARCH_S5PC110 + bool "S5PC110" + endchoice
Signature · 1 line
1.6.4
PATCH 17/20 ARM: S5PC1XX: add sdhci platform helpers for s5pc110 sub-platform
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds common SDHCI platform helper for S5PC110 sub-platform.
--- arch/arm/mach-s5pc110/Kconfig | 12 +++ arch/arm/mach-s5pc110/Makefile | 2 + arch/arm/mach-s5pc110/cpu.c | 5 + arch/arm/mach-s5pc110/setup-sdhci-gpio.c | 123 ++++++++++++++++++++++++++++++ arch/arm/mach-s5pc110/setup-sdhci.c | 59 ++++++++++++++ arch/arm/plat-s3c/include/plat/sdhci.h | 64 +++++++++++++++ 6 files changed, 265 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/setup-sdhci-gpio.c create mode 100644 arch/arm/mach-s5pc110/setup-sdhci.c
arch/arm/mach-s5pc110/Kconfig +12 -0
@@ -32,4 +32,16 @@ config S5PC110_SETUP_I2C2 bool help Common setup code for i2c bus 2. + +config S5PC110_SETUP_SDHCI + bool + select S5PC110_SETUP_SDHCI_GPIO + help + Internal helper functions for S5PC110 based SDHCI systems + +config S5PC110_SETUP_SDHCI_GPIO + bool + help + Common setup code for SDHCI gpio. + endif
arch/arm/mach-s5pc110/Makefile +2 -0
@@ -21,5 +21,7 @@ obj-$(CONFIG_CPU_S5PC110) += uarts.o obj-$(CONFIG_S5PC110_SETUP_I2C0) += setup-i2c0.o obj-$(CONFIG_S5PC110_SETUP_I2C1) += setup-i2c1.o obj-$(CONFIG_S5PC110_SETUP_I2C2) += setup-i2c2.o +obj-$(CONFIG_S5PC110_SETUP_SDHCI) += setup-sdhci.o +obj-$(CONFIG_S5PC110_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o # machine support
arch/arm/mach-s5pc110/cpu.c +5 -0
@@ -86,6 +86,11 @@ void __init s5pc110_map_io(void)iotable_init (s5pc110_iodesc,ARRAY_SIZE (s5pc110_iodesc));/* initialise device information early */ +s5pc110_default_sdhci0 (); +s5pc110_default_sdhci1 (); +s5pc110_default_sdhci2 (); +s5pc110_default_sdhci3 (); +/* the i2c devices are directly compatible with s3c2440 */ s3c_i2c0_setname ("s3c2440-i2c" );s3c_i2c1_setname ("s3c2440-i2c" );
arch/arm/mach-s5pc110/setup-sdhci-gpio.c new file +123 -0
123 lines not on this page · raw message
arch/arm/mach-s5pc110/setup-sdhci.c new file +59 -0
59 lines not on this page · raw message
arch/arm/plat-s3c/include/plat/sdhci.h +64 -0
74 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 18/20 ARM: S5PC1XX: add framebuffer platform helpers for s5pc110 sub-platform
In reply to Marek SzyprowskiFrom: Pawel Osciak <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds common framebuffer device helpers and register defines for S5PC110 sub-platform.
--- arch/arm/mach-s5pc110/Kconfig | 5 ++ arch/arm/mach-s5pc110/Makefile | 1 + arch/arm/mach-s5pc110/include/mach/regs-fb.h | 91 ++++++++++++++++++++++++++ arch/arm/mach-s5pc110/setup-fb-24bpp.c | 67 +++++++++++++++++++ arch/arm/plat-s3c/include/plat/fb.h | 7 ++ 5 files changed, 171 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/include/mach/regs-fb.h create mode 100644 arch/arm/mach-s5pc110/setup-fb-24bpp.c
arch/arm/mach-s5pc110/Kconfig +5 -0
@@ -14,6 +14,11 @@ config CPU_S5PC110 help Enable S5PC110 CPU support +config S5PC110_SETUP_FB_24BPP + bool + help + Common setup code for S5PC110 with an 24bpp RGB display helper. + config S5PC110_SETUP_I2C0 bool default y
arch/arm/mach-s5pc110/Makefile +1 -0
@@ -18,6 +18,7 @@ obj-$(CONFIG_CPU_S5PC110) += plls.o obj-$(CONFIG_CPU_S5PC110) += uarts.o # Helper and device support +obj-$(CONFIG_S5PC110_SETUP_FB_24BPP) += setup-fb-24bpp.o obj-$(CONFIG_S5PC110_SETUP_I2C0) += setup-i2c0.o obj-$(CONFIG_S5PC110_SETUP_I2C1) += setup-i2c1.o obj-$(CONFIG_S5PC110_SETUP_I2C2) += setup-i2c2.o
arch/arm/mach-s5pc110/include/mach/regs-fb.h new file +91 -0
91 lines not on this page · raw message
arch/arm/mach-s5pc110/setup-fb-24bpp.c new file +67 -0
67 lines not on this page · raw message
arch/arm/plat-s3c/include/plat/fb.h +7 -0
@@ -77,4 +77,11 @@ extern void s3c64xx_fb_gpio_setup_24bpp(void);*/ extern void s5pc100_fb_gpio_setup_24bpp (void ); +/** +* s5pc110_fb_gpio_setup_24bpp() - S5PC110 setup function for 24bpp LCD +* +* Initialise the GPIO for an 24bpp LCD display on the RGB interface. +*/ +extern void s5pc110_fb_gpio_setup_24bpp (void ); +#endif /* __PLAT_S3C_FB_H */
Signature · 1 line
1.6.4
PATCH 19/20 ARM: S5PC1XX: add support for SMDKC110 board
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Samsung S5PC110 SoC are newer Samsung SoCs. Like S5PC100 they are based on CortexA8 ARM CPU, but have much more powerfull integrated periperals. This patch adds support for SMDKC110 evaluation board. The board can be obtained from Meritech (http://www.meritech.co.kr).
--- arch/arm/mach-s5pc110/Kconfig | 6 ++ arch/arm/mach-s5pc110/Makefile | 1 + arch/arm/mach-s5pc110/mach-smdkc110.c | 102 +++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-s5pc110/mach-smdkc110.c
arch/arm/mach-s5pc110/Kconfig +6 -0
@@ -49,4 +49,10 @@ config S5PC110_SETUP_SDHCI_GPIO help Common setup code for SDHCI gpio. +config MACH_SMDKC110 + bool "SMDKC110" + select CPU_S5PC110 + help + Machine support for the SMDKC110 board + endif
arch/arm/mach-s5pc110/Makefile +1 -0
@@ -26,3 +26,4 @@ obj-$(CONFIG_S5PC110_SETUP_SDHCI) += setup-sdhci.o obj-$(CONFIG_S5PC110_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o # machine support +obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o
arch/arm/mach-s5pc110/mach-smdkc110.c new file +102 -0
102 lines not on this page · raw message
Signature · 1 line
1.6.4
PATCH 20/20 MAINTAINERS: add ARM/S5PC100 and ARM/S5PC110 architectures
In reply to Marek SzyprowskiFrom: Kyungmin Park <[email protected]>
Add entries for the ARM S5PC100 and ARM S5PC110 architectures that are currently being maintained by ourself.
--- MAINTAINERS | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)
MAINTAINERS +16 -0
@@ -877,6 +877,22 @@ W: http://www.fluff.org/ben/linux/ S: Maintained F: arch/arm/mach-s3c6410/ +ARM/S5PC100 ARM ARCHITECTURE +M: Kyungmin Park <[email protected]> +M: Marek Szyprowski <[email protected]> +L: linux-arm-kernel at lists.infradead.org (moderated for non-subscribers) +L: linux-samsung-soc at vger.kernel.org (moderated for non-subscribers) +S: Supported +F: arch/arm/mach-s5pc100/ + +ARM/S5PC110 ARM ARCHITECTURE +M: Kyungmin Park <[email protected]> +M: Marek Szyprowski <[email protected]> +L: linux-arm-kernel at lists.infradead.org (moderated for non-subscribers) +L: linux-samsung-soc at vger.kernel.org (moderated for non-subscribers) +S: Supported +F: arch/arm/mach-s5pc110/ + ARM/TECHNOLOGIC SYSTEMS TS7250 MACHINE SUPPORT M: Lennert Buytenhek <[email protected]> L: linux-arm-kernel at lists.infradead.org (moderated for non-subscribers)
Signature · 1 line
1.6.4