* [PATCH] Add support for Aquita board (Samsung S5PC110 based)
@ 2010-03-25 11:15 Marek Szyprowski
2010-03-25 11:15 ` [PATCH 1/8] ARM: S5PV210: fix formating of the debug messages on boot Marek Szyprowski
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: Marek Szyprowski @ 2010-03-25 11:15 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
This patch series add basic support for Samsung Aquila board. The board
is based on Samsung S5PC110 SoC. For the basic support of this board, the
S5PV210/S5PC110 platform core needs to be updated. This patch series
contains patches that add support for gpiolib, software reset and
framebuffer helpers. Please expect further extensions to the s5pv210
platform core soon.
This patch series includes:
[PATCH 1/8] ARM: S5PV210: fix formating of the debug messages on boot
[PATCH 2/8] ARM: S5PV210: add support for software reset
[PATCH 3/8] ARM: S5PV210: add gpiolib support
[PATCH 4/8] ARM: Samsung: move driver strength gpio configuration helper to common dir
[PATCH 5/8] ARM: S5PV210: add Aquila board
[PATCH 6/8] ARM: Samsung: move common framebuffer regs to common platform directory
[PATCH 7/8] ARM: S5PV210: add framebuffer platform helpers for s5pv210 based machines
[PATCH 8/8] ARM: S5PV210: add support for s3c-fb driver on Aquila machine
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/8] ARM: S5PV210: fix formating of the debug messages on boot
2010-03-25 11:15 [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
@ 2010-03-25 11:15 ` Marek Szyprowski
2010-03-25 11:15 ` [PATCH 2/8] ARM: S5PV210: add support for software reset Marek Szyprowski
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Marek Szyprowski @ 2010-03-25 11:15 UTC (permalink / raw)
To: linux-arm-kernel
Fix broken boot messages about all base clocks.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-s5pv210/clock.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-s5pv210/clock.c b/arch/arm/mach-s5pv210/clock.c
index ccccae2..b9749f1 100644
--- a/arch/arm/mach-s5pv210/clock.c
+++ b/arch/arm/mach-s5pv210/clock.c
@@ -369,7 +369,7 @@ void __init_or_cpufreq s5pv210_setup_clocks(void)
mpll = s5p_get_pll45xx(xtal, __raw_readl(S5P_MPLL_CON), pll_4502);
epll = s5p_get_pll45xx(xtal, __raw_readl(S5P_EPLL_CON), pll_4500);
- printk(KERN_INFO "S5PV210: PLL settings, A=%ld, M=%ld, E=%ld",
+ printk(KERN_INFO "S5PV210: PLL settings, A=%ld, M=%ld, E=%ld\n",
apll, mpll, epll);
armclk = apll / GET_DIV(clkdiv0, S5P_CLKDIV0_APLL);
@@ -394,8 +394,8 @@ void __init_or_cpufreq s5pv210_setup_clocks(void)
pclk83 = hclk166 / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK83);
pclk66 = hclk133 / GET_DIV(clkdiv0, S5P_CLKDIV0_PCLK66);
- printk(KERN_INFO "S5PV210: ARMCLK=%ld, HCLKM=%ld, HCLKD=%ld, \
- HCLKP=%ld, PCLKM=%ld, PCLKD=%ld, PCLKP=%ld\n",
+ printk(KERN_INFO "S5PV210: ARMCLK=%ld, HCLKM=%ld, HCLKD=%ld, "
+ "HCLKP=%ld, PCLKM=%ld, PCLKD=%ld, PCLKP=%ld\n",
armclk, hclk200, hclk166, hclk133, pclk100, pclk83, pclk66);
clk_fout_apll.rate = apll;
--
1.6.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/8] ARM: S5PV210: add support for software reset
2010-03-25 11:15 [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
2010-03-25 11:15 ` [PATCH 1/8] ARM: S5PV210: fix formating of the debug messages on boot Marek Szyprowski
@ 2010-03-25 11:15 ` Marek Szyprowski
2010-03-25 11:15 ` [PATCH 3/8] ARM: S5PV210: add gpiolib support Marek Szyprowski
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Marek Szyprowski @ 2010-03-25 11:15 UTC (permalink / raw)
To: linux-arm-kernel
Add missing call for software reset (system reboot).
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-s5pv210/include/mach/regs-clock.h | 2 ++
arch/arm/mach-s5pv210/include/mach/system.h | 7 ++++++-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-clock.h b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
index e56e0e4..40dd24f 100644
--- a/arch/arm/mach-s5pv210/include/mach/regs-clock.h
+++ b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
@@ -91,6 +91,8 @@
#define S5P_CLKDIV0_PCLK66_MASK (0x7 << S5P_CLKDIV0_PCLK66_SHIFT)
/* Registers related to power management */
+#define S5P_SWRESET S5P_CLKREG(0x2000)
+
#define S5P_PWR_CFG S5P_CLKREG(0xC000)
#define S5P_EINT_WAKEUP_MASK S5P_CLKREG(0xC004)
#define S5P_WAKEUP_MASK S5P_CLKREG(0xC008)
diff --git a/arch/arm/mach-s5pv210/include/mach/system.h b/arch/arm/mach-s5pv210/include/mach/system.h
index 1ca04d5..ba39203 100644
--- a/arch/arm/mach-s5pv210/include/mach/system.h
+++ b/arch/arm/mach-s5pv210/include/mach/system.h
@@ -13,6 +13,10 @@
#ifndef __ASM_ARCH_SYSTEM_H
#define __ASM_ARCH_SYSTEM_H __FILE__
+#include <linux/io.h>
+#include <mach/map.h>
+#include <mach/regs-clock.h>
+
static void arch_idle(void)
{
/* nothing here yet */
@@ -20,7 +24,8 @@ static void arch_idle(void)
static void arch_reset(char mode, const char *cmd)
{
- /* nothing here yet */
+ __raw_writel(0x1, S5P_SWRESET);
+ return;
}
#endif /* __ASM_ARCH_SYSTEM_H */
--
1.6.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/8] ARM: S5PV210: add gpiolib support
2010-03-25 11:15 [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
2010-03-25 11:15 ` [PATCH 1/8] ARM: S5PV210: fix formating of the debug messages on boot Marek Szyprowski
2010-03-25 11:15 ` [PATCH 2/8] ARM: S5PV210: add support for software reset Marek Szyprowski
@ 2010-03-25 11:15 ` Marek Szyprowski
2010-03-25 11:15 ` [PATCH 4/8] ARM: Samsung: move driver strength gpio configuration helper to common dir Marek Szyprowski
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Marek Szyprowski @ 2010-03-25 11:15 UTC (permalink / raw)
To: linux-arm-kernel
Add support for gpiolib calls. This is based on the gpiolib implementation
from mach-s5c6440/mach-s3c64xx directories.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-s5pv210/Makefile | 2 +-
arch/arm/mach-s5pv210/gpio.c | 375 ++++++++++++++++++++++++
arch/arm/mach-s5pv210/include/mach/gpio.h | 25 ++-
arch/arm/mach-s5pv210/include/mach/regs-gpio.h | 59 ++++
4 files changed, 458 insertions(+), 3 deletions(-)
create mode 100644 arch/arm/mach-s5pv210/gpio.c
create mode 100644 arch/arm/mach-s5pv210/include/mach/regs-gpio.h
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 8ebf51c..cb1553c 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -12,7 +12,7 @@ obj- :=
# Core support for S5PV210 system
-obj-$(CONFIG_CPU_S5PV210) += cpu.o init.o clock.o
+obj-$(CONFIG_CPU_S5PV210) += cpu.o init.o clock.o gpio.o
# machine support
diff --git a/arch/arm/mach-s5pv210/gpio.c b/arch/arm/mach-s5pv210/gpio.c
new file mode 100644
index 0000000..4bfd21c
--- /dev/null
+++ b/arch/arm/mach-s5pv210/gpio.c
@@ -0,0 +1,375 @@
+/* arch/arm/mach-s5pv210/gpio.c
+ *
+ * Copyright (c) 2009 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * S5PV210/S5PC110 - GPIOlib 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/kernel.h>
+#include <linux/irq.h>
+#include <linux/io.h>
+#include <mach/map.h>
+#include <mach/gpio.h>
+#include <mach/regs-gpio.h>
+#include <plat/gpio-core.h>
+#include <plat/gpio-cfg.h>
+#include <plat/gpio-cfg-helpers.h>
+
+#define OFF_GPCON (0x00)
+#define OFF_GPDAT (0x04)
+
+#define con_4bit_shift(__off) ((__off) * 4)
+
+#if 1
+#define gpio_dbg(x...) do { } while (0)
+#else
+#define gpio_dbg(x...) printk(KERN_DEBUG x)
+#endif
+
+static int s5pv210_gpiolib_input(struct gpio_chip *chip, unsigned offset)
+{
+ struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
+ void __iomem *base = ourchip->base;
+ unsigned long con;
+
+ con = __raw_readl(base + OFF_GPCON);
+ con &= ~(0xf << con_4bit_shift(offset));
+ __raw_writel(con, base + OFF_GPCON);
+
+ gpio_dbg("%s: %p: CON now %08lx\n", __func__, base, con);
+
+ return 0;
+}
+
+static int s5pv210_gpiolib_output(struct gpio_chip *chip,
+ unsigned offset, int value)
+{
+ struct s3c_gpio_chip *ourchip = to_s3c_gpio(chip);
+ void __iomem *base = ourchip->base;
+ unsigned long con;
+ unsigned long dat;
+
+ con = __raw_readl(base + OFF_GPCON);
+ con &= ~(0xf << con_4bit_shift(offset));
+ con |= 0x1 << con_4bit_shift(offset);
+
+ dat = __raw_readl(base + OFF_GPDAT);
+ if (value)
+ dat |= 1 << offset;
+ else
+ dat &= ~(1 << offset);
+
+ __raw_writel(dat, base + OFF_GPDAT);
+ __raw_writel(con, base + OFF_GPCON);
+ __raw_writel(dat, base + OFF_GPDAT);
+
+ gpio_dbg("%s: %p: CON %08lx, DAT %08lx\n", __func__, base, con, dat);
+
+ return 0;
+}
+
+static struct s3c_gpio_cfg s5pv210_gpio_cfgs[] = {
+ {
+ /* standard */
+ .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
+ .set_pull = s3c_gpio_setpull_updown,
+ .get_pull = s3c_gpio_getpull_updown,
+ }, {
+ /* eint */
+ .cfg_eint = 0xf,
+ .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
+ .set_pull = s3c_gpio_setpull_updown,
+ .get_pull = s3c_gpio_getpull_updown,
+ }, {
+ /* noint */
+ .set_config = s3c_gpio_setcfg_s3c64xx_4bit,
+ .set_pull = s3c_gpio_setpull_updown,
+ .get_pull = s3c_gpio_getpull_updown,
+ },
+};
+
+static struct s3c_gpio_chip s5pv210_gpio_4bit[] = {
+ {
+ .base = S5PV210_GPA0_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPA0(0),
+ .ngpio = S5PV210_GPIO_A0_NR,
+ .label = "GPA0",
+ },
+ }, {
+ .base = S5PV210_GPA1_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPA1(0),
+ .ngpio = S5PV210_GPIO_A1_NR,
+ .label = "GPA1",
+ },
+ }, {
+ .base = S5PV210_GPB_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPB(0),
+ .ngpio = S5PV210_GPIO_B_NR,
+ .label = "GPB",
+ },
+ }, {
+ .base = S5PV210_GPC0_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPC0(0),
+ .ngpio = S5PV210_GPIO_C0_NR,
+ .label = "GPC0",
+ },
+ }, {
+ .base = S5PV210_GPC1_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPC1(0),
+ .ngpio = S5PV210_GPIO_C1_NR,
+ .label = "GPC1",
+ },
+ }, {
+ .base = S5PV210_GPD0_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPD0(0),
+ .ngpio = S5PV210_GPIO_D0_NR,
+ .label = "GPD0",
+ },
+ }, {
+ .base = S5PV210_GPD1_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPD1(0),
+ .ngpio = S5PV210_GPIO_D1_NR,
+ .label = "GPD1",
+ },
+ }, {
+ .base = S5PV210_GPE0_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPE0(0),
+ .ngpio = S5PV210_GPIO_E0_NR,
+ .label = "GPE0",
+ },
+ }, {
+ .base = S5PV210_GPE1_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPE1(0),
+ .ngpio = S5PV210_GPIO_E1_NR,
+ .label = "GPE1",
+ },
+ }, {
+ .base = S5PV210_GPF0_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPF0(0),
+ .ngpio = S5PV210_GPIO_F0_NR,
+ .label = "GPF0",
+ },
+ }, {
+ .base = S5PV210_GPF1_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPF1(0),
+ .ngpio = S5PV210_GPIO_F1_NR,
+ .label = "GPF1",
+ },
+ }, {
+ .base = S5PV210_GPF2_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPF2(0),
+ .ngpio = S5PV210_GPIO_F2_NR,
+ .label = "GPF2",
+ },
+ }, {
+ .base = S5PV210_GPF3_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPF3(0),
+ .ngpio = S5PV210_GPIO_F3_NR,
+ .label = "GPF3",
+ },
+ }, {
+ .base = S5PV210_GPG0_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPG0(0),
+ .ngpio = S5PV210_GPIO_G0_NR,
+ .label = "GPG0",
+ },
+ }, {
+ .base = S5PV210_GPG1_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPG1(0),
+ .ngpio = S5PV210_GPIO_G1_NR,
+ .label = "GPG1",
+ },
+ }, {
+ .base = S5PV210_GPG2_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPG2(0),
+ .ngpio = S5PV210_GPIO_G2_NR,
+ .label = "GPG2",
+ },
+ }, {
+ .base = S5PV210_GPG3_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPG3(0),
+ .ngpio = S5PV210_GPIO_G3_NR,
+ .label = "GPG3",
+ },
+ }, {
+ .base = S5PV210_GPH0_BASE,
+ .config = &s5pv210_gpio_cfgs[1],
+ .chip = {
+ .base = S5PV210_GPH0(0),
+ .ngpio = S5PV210_GPIO_H0_NR,
+ .label = "GPH0",
+ },
+ }, {
+ .base = S5PV210_GPH1_BASE,
+ .config = &s5pv210_gpio_cfgs[1],
+ .chip = {
+ .base = S5PV210_GPH1(0),
+ .ngpio = S5PV210_GPIO_H1_NR,
+ .label = "GPH1",
+ },
+ }, {
+ .base = S5PV210_GPH2_BASE,
+ .config = &s5pv210_gpio_cfgs[1],
+ .chip = {
+ .base = S5PV210_GPH2(0),
+ .ngpio = S5PV210_GPIO_H2_NR,
+ .label = "GPH2",
+ },
+ }, {
+ .base = S5PV210_GPH3_BASE,
+ .config = &s5pv210_gpio_cfgs[1],
+ .chip = {
+ .base = S5PV210_GPH3(0),
+ .ngpio = S5PV210_GPIO_H3_NR,
+ .label = "GPH3",
+ },
+ }, {
+ .base = S5PV210_GPI_BASE,
+ .config = &s5pv210_gpio_cfgs[2],
+ .chip = {
+ .base = S5PV210_GPI(0),
+ .ngpio = S5PV210_GPIO_I_NR,
+ .label = "GPI",
+ },
+ }, {
+ .base = S5PV210_GPJ0_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPJ0(0),
+ .ngpio = S5PV210_GPIO_J0_NR,
+ .label = "GPJ0",
+ },
+ }, {
+ .base = S5PV210_GPJ1_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPJ1(0),
+ .ngpio = S5PV210_GPIO_J1_NR,
+ .label = "GPJ1",
+ },
+ }, {
+ .base = S5PV210_GPJ2_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPJ2(0),
+ .ngpio = S5PV210_GPIO_J2_NR,
+ .label = "GPJ2",
+ },
+ }, {
+ .base = S5PV210_GPJ3_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPJ3(0),
+ .ngpio = S5PV210_GPIO_J3_NR,
+ .label = "GPJ3",
+ },
+ }, {
+ .base = S5PV210_GPJ4_BASE,
+ .config = &s5pv210_gpio_cfgs[0],
+ .chip = {
+ .base = S5PV210_GPJ4(0),
+ .ngpio = S5PV210_GPIO_J4_NR,
+ .label = "GPJ4",
+ },
+ }, {
+ .base = S5PV210_MP0_1_BASE,
+ .config = &s5pv210_gpio_cfgs[2],
+ .chip = {
+ .base = S5PV210_MP0_1(0),
+ .ngpio = S5PV210_GPIO_MP0_1_NR,
+ .label = "MP0_1",
+ },
+ }, {
+ .base = S5PV210_MP0_2_BASE,
+ .config = &s5pv210_gpio_cfgs[2],
+ .chip = {
+ .base = S5PV210_MP0_2(0),
+ .ngpio = S5PV210_GPIO_MP0_2_NR,
+ .label = "MP0_2",
+ },
+ }, {
+ .base = S5PV210_MP0_3_BASE,
+ .config = &s5pv210_gpio_cfgs[2],
+ .chip = {
+ .base = S5PV210_MP0_3(0),
+ .ngpio = S5PV210_GPIO_MP0_3_NR,
+ .label = "MP0_3",
+ },
+ }, {
+ .base = S5PV210_MP0_4_BASE,
+ .config = &s5pv210_gpio_cfgs[2],
+ .chip = {
+ .base = S5PV210_MP0_4(0),
+ .ngpio = S5PV210_GPIO_MP0_4_NR,
+ .label = "MP0_4",
+ },
+ }, {
+ .base = S5PV210_MP0_5_BASE,
+ .config = &s5pv210_gpio_cfgs[2],
+ .chip = {
+ .base = S5PV210_MP0_5(0),
+ .ngpio = S5PV210_GPIO_MP0_5_NR,
+ .label = "MP0_5",
+ },
+ },
+};
+
+static void __init s5pv210_gpio_add(struct s3c_gpio_chip *chip, int nr_chips)
+{
+ for (; nr_chips > 0; nr_chips--, chip++) {
+ chip->chip.direction_input = s5pv210_gpiolib_input;
+ chip->chip.direction_output = s5pv210_gpiolib_output;
+ s3c_gpiolib_add(chip);
+ }
+}
+
+
+static int __init s5pv210_gpiolib_init(void)
+{
+ struct s3c_gpio_chip *chips = s5pv210_gpio_4bit;
+ int nr_chips = ARRAY_SIZE(s5pv210_gpio_4bit);
+
+ s5pv210_gpio_add(chips, nr_chips);
+
+ return 0;
+}
+arch_initcall(s5pv210_gpiolib_init);
diff --git a/arch/arm/mach-s5pv210/include/mach/gpio.h b/arch/arm/mach-s5pv210/include/mach/gpio.h
index 533b020..d6046c7 100644
--- a/arch/arm/mach-s5pv210/include/mach/gpio.h
+++ b/arch/arm/mach-s5pv210/include/mach/gpio.h
@@ -46,6 +46,13 @@
#define S5PV210_GPIO_J2_NR (8)
#define S5PV210_GPIO_J3_NR (8)
#define S5PV210_GPIO_J4_NR (5)
+#define S5PV210_GPIO_MP0_1_NR (8)
+#define S5PV210_GPIO_MP0_2_NR (4)
+#define S5PV210_GPIO_MP0_3_NR (8)
+#define S5PV210_GPIO_MP0_4_NR (8)
+#define S5PV210_GPIO_MP0_5_NR (8)
+#define S5PV210_GPIO_MP0_6_NR (8)
+#define S5PV210_GPIO_MP0_7_NR (8)
/* GPIO bank numbers */
@@ -85,6 +92,14 @@ enum s5p_gpio_number {
S5PV210_GPIO_J2_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_J1),
S5PV210_GPIO_J3_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_J2),
S5PV210_GPIO_J4_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_J3),
+ S5PV210_GPIO_MP0_1_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_J4),
+ S5PV210_GPIO_MP0_2_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_MP0_1),
+ S5PV210_GPIO_MP0_3_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_MP0_2),
+ S5PV210_GPIO_MP0_4_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_MP0_3),
+ S5PV210_GPIO_MP0_5_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_MP0_4),
+ S5PV210_GPIO_MP0_6_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_MP0_5),
+ S5PV210_GPIO_MP0_7_START = S5PV210_GPIO_NEXT(S5PV210_GPIO_MP0_6),
+ S5PV210_GPIO_END = S5PV210_GPIO_NEXT(S5PV210_GPIO_MP0_7),
};
/* S5PV210 GPIO number definitions */
@@ -115,13 +130,19 @@ enum s5p_gpio_number {
#define S5PV210_GPJ2(_nr) (S5PV210_GPIO_J2_START + (_nr))
#define S5PV210_GPJ3(_nr) (S5PV210_GPIO_J3_START + (_nr))
#define S5PV210_GPJ4(_nr) (S5PV210_GPIO_J4_START + (_nr))
+#define S5PV210_MP0_1(_nr) (S5PV210_GPIO_MP0_1_START + (_nr))
+#define S5PV210_MP0_2(_nr) (S5PV210_GPIO_MP0_2_START + (_nr))
+#define S5PV210_MP0_3(_nr) (S5PV210_GPIO_MP0_3_START + (_nr))
+#define S5PV210_MP0_4(_nr) (S5PV210_GPIO_MP0_4_START + (_nr))
+#define S5PV210_MP0_5(_nr) (S5PV210_GPIO_MP0_5_START + (_nr))
+#define S5PV210_MP0_6(_nr) (S5PV210_GPIO_MP0_6_START + (_nr))
+#define S5PV210_MP0_7(_nr) (S5PV210_GPIO_MP0_7_START + (_nr))
/* the end of the S5PV210 specific gpios */
-#define S5PV210_GPIO_END (S5PV210_GPJ4(S5PV210_GPIO_J4_NR) + 1)
#define S3C_GPIO_END S5PV210_GPIO_END
/* define the number of gpios we need to the one after the GPJ4() range */
-#define ARCH_NR_GPIOS (S5PV210_GPJ4(S5PV210_GPIO_J4_NR) + \
+#define ARCH_NR_GPIOS (S5PV210_GPIO_END + \
CONFIG_SAMSUNG_GPIO_EXTRA + 1)
#include <asm-generic/gpio.h>
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-gpio.h b/arch/arm/mach-s5pv210/include/mach/regs-gpio.h
new file mode 100644
index 0000000..24e4b7f
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/regs-gpio.h
@@ -0,0 +1,59 @@
+/* linux/arch/arm/plat-s5pc1xx/include/plat/regs-gpio.h
+ *
+ * Copyright 2009 Samsung Electronics Co.
+ * Byungho Min <bhmin@samsung.com>
+ *
+ * S5PC210/S5PC110 - GPIO register definitions
+ */
+
+#ifndef __ASM_PLAT_S5PC1XX_REGS_GPIO_H
+#define __ASM_PLAT_S5PC1XX_REGS_GPIO_H __FILE__
+
+#include <mach/map.h>
+
+#define S5PV210_GPIO_BASE S5P_VA_GPIO
+#define S5PV210_GPA0_BASE (S5PV210_GPIO_BASE + 0x0000)
+#define S5PV210_GPA1_BASE (S5PV210_GPIO_BASE + 0x0020)
+#define S5PV210_GPB_BASE (S5PV210_GPIO_BASE + 0x0040)
+#define S5PV210_GPC0_BASE (S5PV210_GPIO_BASE + 0x0060)
+#define S5PV210_GPC1_BASE (S5PV210_GPIO_BASE + 0x0080)
+#define S5PV210_GPD0_BASE (S5PV210_GPIO_BASE + 0x00A0)
+#define S5PV210_GPD1_BASE (S5PV210_GPIO_BASE + 0x00C0)
+#define S5PV210_GPE0_BASE (S5PV210_GPIO_BASE + 0x00E0)
+#define S5PV210_GPE1_BASE (S5PV210_GPIO_BASE + 0x0100)
+#define S5PV210_GPF0_BASE (S5PV210_GPIO_BASE + 0x0120)
+#define S5PV210_GPF1_BASE (S5PV210_GPIO_BASE + 0x0140)
+#define S5PV210_GPF2_BASE (S5PV210_GPIO_BASE + 0x0160)
+#define S5PV210_GPF3_BASE (S5PV210_GPIO_BASE + 0x0180)
+#define S5PV210_GPG0_BASE (S5PV210_GPIO_BASE + 0x01A0)
+#define S5PV210_GPG1_BASE (S5PV210_GPIO_BASE + 0x01C0)
+#define S5PV210_GPG2_BASE (S5PV210_GPIO_BASE + 0x01E0)
+#define S5PV210_GPG3_BASE (S5PV210_GPIO_BASE + 0x0200)
+#define S5PV210_GPH0_BASE (S5PV210_GPIO_BASE + 0x0C00)
+#define S5PV210_GPH1_BASE (S5PV210_GPIO_BASE + 0x0C20)
+#define S5PV210_GPH2_BASE (S5PV210_GPIO_BASE + 0x0C40)
+#define S5PV210_GPH3_BASE (S5PV210_GPIO_BASE + 0x0C60)
+#define S5PV210_GPI_BASE (S5PV210_GPIO_BASE + 0x0220)
+#define S5PV210_GPJ0_BASE (S5PV210_GPIO_BASE + 0x0240)
+#define S5PV210_GPJ1_BASE (S5PV210_GPIO_BASE + 0x0260)
+#define S5PV210_GPJ2_BASE (S5PV210_GPIO_BASE + 0x0280)
+#define S5PV210_GPJ3_BASE (S5PV210_GPIO_BASE + 0x02A0)
+#define S5PV210_GPJ4_BASE (S5PV210_GPIO_BASE + 0x02C0)
+#define S5PV210_MP0_1_BASE (S5PV210_GPIO_BASE + 0x02E0)
+#define S5PV210_MP0_2_BASE (S5PV210_GPIO_BASE + 0x0300)
+#define S5PV210_MP0_3_BASE (S5PV210_GPIO_BASE + 0x0320)
+#define S5PV210_MP0_4_BASE (S5PV210_GPIO_BASE + 0x0340)
+#define S5PV210_MP0_5_BASE (S5PV210_GPIO_BASE + 0x0360)
+#define S5PV210_MP0_6_BASE (S5PV210_GPIO_BASE + 0x0380)
+#define S5PV210_MP0_7_BASE (S5PV210_GPIO_BASE + 0x03A0)
+#define S5PV210_EXT_INT_BASE (S5PV210_GPIO_BASE + 0x0E00)
+#define S5PV210_PDNEN (S5PV210_GPIO_BASE + 0x0F80)
+#define S5PC100_PDNEN_NORMAL (0 << 0)
+
+#define S5PV210_PDNEN_CFG_PDNEN (1 << 1)
+#define S5PV210_PDNEN_CFG_AUTO (0 << 1)
+#define S5PV210_PDNEN_POWERDOWN (1 << 0)
+#define S5PV210_PDNEN_NORMAL (0 << 0)
+
+#endif /* __ASM_PLAT_S5PC1XX_REGS_GPIO_H */
+
--
1.6.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/8] ARM: Samsung: move driver strength gpio configuration helper to common dir
2010-03-25 11:15 [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
` (2 preceding siblings ...)
2010-03-25 11:15 ` [PATCH 3/8] ARM: S5PV210: add gpiolib support Marek Szyprowski
@ 2010-03-25 11:15 ` Marek Szyprowski
2010-03-25 11:15 ` [PATCH 5/8] ARM: S5PV210: add Aquila board Marek Szyprowski
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Marek Szyprowski @ 2010-03-25 11:15 UTC (permalink / raw)
To: linux-arm-kernel
Driver strength parameter can be changed not only on S5PC100 but also
on S5PV210/S5PC110 platforms, so move the helper functions to the common
plat-samsung directory.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/plat-s5p/Kconfig | 1 +
arch/arm/plat-s5pc1xx/Kconfig | 2 +-
arch/arm/plat-s5pc1xx/Makefile | 1 -
arch/arm/plat-s5pc1xx/gpio-config.c | 62 --------------------
.../plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h | 32 ----------
arch/arm/plat-s5pc1xx/setup-fb-24bpp.c | 1 -
arch/arm/plat-samsung/Kconfig | 12 ++--
arch/arm/plat-samsung/gpio-config.c | 49 +++++++++++++++
arch/arm/plat-samsung/include/plat/gpio-cfg.h | 30 ++++++++++
9 files changed, 87 insertions(+), 103 deletions(-)
delete mode 100644 arch/arm/plat-s5pc1xx/gpio-config.c
delete mode 100644 arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h
diff --git a/arch/arm/plat-s5p/Kconfig b/arch/arm/plat-s5p/Kconfig
index d400a6a..92bd756 100644
--- a/arch/arm/plat-s5p/Kconfig
+++ b/arch/arm/plat-s5p/Kconfig
@@ -13,6 +13,7 @@ config PLAT_S5P
select NO_IOPORT
select ARCH_REQUIRE_GPIOLIB
select S3C_GPIO_TRACK
+ select S5P_GPIO_DRVSTR
select SAMSUNG_GPIOLIB_4BIT
select S3C_GPIO_CFG_S3C64XX
select S3C_GPIO_PULL_UPDOWN
diff --git a/arch/arm/plat-s5pc1xx/Kconfig b/arch/arm/plat-s5pc1xx/Kconfig
index c7ccdf2..79d3be7 100644
--- a/arch/arm/plat-s5pc1xx/Kconfig
+++ b/arch/arm/plat-s5pc1xx/Kconfig
@@ -16,9 +16,9 @@ config PLAT_S5PC1XX
select SAMSUNG_IRQ_VIC_TIMER
select S3C_GPIO_TRACK
select S3C_GPIO_PULL_UPDOWN
+ select S5P_GPIO_DRVSTR
select S3C_GPIO_CFG_S3C24XX
select S3C_GPIO_CFG_S3C64XX
- select S5P_GPIO_CFG_S5PC1XX
help
Base platform code for any Samsung S5PC1XX device
diff --git a/arch/arm/plat-s5pc1xx/Makefile b/arch/arm/plat-s5pc1xx/Makefile
index 278f268..66a8f3e 100644
--- a/arch/arm/plat-s5pc1xx/Makefile
+++ b/arch/arm/plat-s5pc1xx/Makefile
@@ -24,7 +24,6 @@ obj-$(CONFIG_CPU_S5PC100_CLOCK) += s5pc100-clock.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
diff --git a/arch/arm/plat-s5pc1xx/gpio-config.c b/arch/arm/plat-s5pc1xx/gpio-config.c
deleted file mode 100644
index a4f67e8..0000000
--- a/arch/arm/plat-s5pc1xx/gpio-config.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* linux/arch/arm/plat-s5pc1xx/gpio-config.c
- *
- * Copyright 2009 Samsung Electronics
- *
- * S5PC1XX GPIO Configuration.
- *
- * Based on plat-s3c64xx/gpio-config.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/module.h>
-#include <linux/gpio.h>
-#include <linux/io.h>
-
-#include <plat/gpio-core.h>
-#include <plat/gpio-cfg-s5pc1xx.h>
-
-s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin, unsigned int off)
-{
- struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
- void __iomem *reg;
- int shift = off * 2;
- u32 drvstr;
-
- if (!chip)
- return -EINVAL;
-
- reg = chip->base + 0x0C;
-
- drvstr = __raw_readl(reg);
- drvstr = 0xffff & (0x3 << shift);
- drvstr = drvstr >> shift;
-
- return (__force s5p_gpio_drvstr_t)drvstr;
-}
-EXPORT_SYMBOL(s5p_gpio_get_drvstr);
-
-int s5p_gpio_set_drvstr(unsigned int pin, unsigned int off,
- s5p_gpio_drvstr_t drvstr)
-{
- struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
- void __iomem *reg;
- int shift = off * 2;
- u32 tmp;
-
- if (!chip)
- return -EINVAL;
-
- reg = chip->base + 0x0C;
-
- tmp = __raw_readl(reg);
- tmp |= drvstr << shift;
-
- __raw_writel(tmp, reg);
-
- return 0;
-}
-EXPORT_SYMBOL(s5p_gpio_set_drvstr);
diff --git a/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h b/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h
deleted file mode 100644
index 72ad59f..0000000
--- a/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg-s5pc1xx.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* linux/arch/arm/plat-s5pc1xx/include/plat/gpio-cfg.h
- *
- * Copyright 2009 Samsung Electronic
- *
- * S5PC1XX Platform - GPIO pin configuration
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-/* This file contains the necessary definitions to get the basic gpio
- * pin configuration done such as setting a pin to input or output or
- * changing the pull-{up,down} configurations.
- */
-
-#ifndef __GPIO_CFG_S5PC1XX_H
-#define __GPIO_CFG_S5PC1XX_H __FILE__
-
-typedef unsigned int __bitwise__ s5p_gpio_drvstr_t;
-
-#define S5P_GPIO_DRVSTR_LV1 0x00
-#define S5P_GPIO_DRVSTR_LV2 0x01
-#define S5P_GPIO_DRVSTR_LV3 0x10
-#define S5P_GPIO_DRVSTR_LV4 0x11
-
-extern s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin, unsigned int off);
-
-extern int s5p_gpio_set_drvstr(unsigned int pin, unsigned int off,
- s5p_gpio_drvstr_t drvstr);
-
-#endif /* __GPIO_CFG_S5PC1XX_H */
diff --git a/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c b/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c
index 1a63768..b02c36f 100644
--- a/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c
+++ b/arch/arm/plat-s5pc1xx/setup-fb-24bpp.c
@@ -19,7 +19,6 @@
#include <mach/map.h>
#include <plat/fb.h>
#include <plat/gpio-cfg.h>
-#include <plat/gpio-cfg-s5pc1xx.h>
#define DISR_OFFSET 0x7008
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index d552c65..59cae62 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -90,12 +90,6 @@ config S3C_GPIO_CFG_S3C64XX
Internal configuration to enable S3C64XX style GPIO configuration
functions.
-config S5P_GPIO_CFG_S5PC1XX
- bool
- help
- Internal configuration to enable S5PC1XX style GPIO configuration
- functions.
-
config S3C_GPIO_PULL_UPDOWN
bool
help
@@ -111,6 +105,12 @@ config S3C_GPIO_PULL_UP
help
Internal configuration to enable the correct GPIO pull helper
+config S5P_GPIO_DRVSTR
+ bool
+ help
+ Internal configuration to get and set correct GPIO driver strength
+ helper
+
config SAMSUNG_GPIO_EXTRA
int "Number of additional GPIO pins"
default 0
diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
index 44a84e8..e68748e 100644
--- a/arch/arm/plat-samsung/gpio-config.c
+++ b/arch/arm/plat-samsung/gpio-config.c
@@ -164,3 +164,52 @@ s3c_gpio_pull_t s3c_gpio_getpull_updown(struct s3c_gpio_chip *chip,
return (__force s3c_gpio_pull_t)pup;
}
#endif
+
+#ifdef CONFIG_S5P_GPIO_DRVSTR
+s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin)
+{
+ struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
+ unsigned int off;
+ void __iomem *reg;
+ int shift;
+ u32 drvstr;
+
+ if (!chip)
+ return -EINVAL;
+
+ off = chip->chip.base - pin;
+ shift = off * 2;
+ reg = chip->base + 0x0C;
+
+ drvstr = __raw_readl(reg);
+ drvstr = 0xffff & (0x3 << shift);
+ drvstr = drvstr >> shift;
+
+ return (__force s5p_gpio_drvstr_t)drvstr;
+}
+EXPORT_SYMBOL(s5p_gpio_get_drvstr);
+
+int s5p_gpio_set_drvstr(unsigned int pin, s5p_gpio_drvstr_t drvstr)
+{
+ struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin);
+ unsigned int off;
+ void __iomem *reg;
+ int shift;
+ u32 tmp;
+
+ if (!chip)
+ return -EINVAL;
+
+ off = chip->chip.base - pin;
+ shift = off * 2;
+ reg = chip->base + 0x0C;
+
+ tmp = __raw_readl(reg);
+ tmp |= drvstr << shift;
+
+ __raw_writel(tmp, reg);
+
+ return 0;
+}
+EXPORT_SYMBOL(s5p_gpio_set_drvstr);
+#endif /* CONFIG_S5P_GPIO_DRVSTR */
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
index 29cd6a8..2f2bfc8 100644
--- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h
+++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h
@@ -25,6 +25,7 @@
#define __PLAT_GPIO_CFG_H __FILE__
typedef unsigned int __bitwise__ s3c_gpio_pull_t;
+typedef unsigned int __bitwise__ s5p_gpio_drvstr_t;
/* forward declaration if gpio-core.h hasn't been included */
struct s3c_gpio_chip;
@@ -107,4 +108,33 @@ extern int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull);
*/
extern s3c_gpio_pull_t s3c_gpio_getpull(unsigned int pin);
+/* Define values for the drvstr available for each gpio pin.
+ *
+ * These values control the value of the output signal driver strength,
+ * configurable on most pins on the S5C series.
+ */
+#define S5P_GPIO_DRVSTR_LV1 ((__force s5p_gpio_drvstr_t)0x00)
+#define S5P_GPIO_DRVSTR_LV2 ((__force s5p_gpio_drvstr_t)0x01)
+#define S5P_GPIO_DRVSTR_LV3 ((__force s5p_gpio_drvstr_t)0x10)
+#define S5P_GPIO_DRVSTR_LV4 ((__force s5p_gpio_drvstr_t)0x11)
+
+/**
+ * s5c_gpio_get_drvstr() - get the driver streght value of a gpio pin
+ * @pin: The pin number to get the settings for
+ *
+ * Read the driver streght value for the specified pin.
+*/
+extern s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin);
+
+/**
+ * s3c_gpio_set_drvstr() - set the driver streght value of a gpio pin
+ * @pin: The pin number to configure the driver streght value
+ * @drvstr: The new value of the driver strength
+ *
+ * This function sets the driver strength value for the specified pin.
+ * It will return 0 if successfull, or a negative error code if the pin
+ * cannot support the requested setting.
+*/
+extern int s5p_gpio_set_drvstr(unsigned int pin, s5p_gpio_drvstr_t drvstr);
+
#endif /* __PLAT_GPIO_CFG_H */
--
1.6.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/8] ARM: S5PV210: add Aquila board
2010-03-25 11:15 [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
` (3 preceding siblings ...)
2010-03-25 11:15 ` [PATCH 4/8] ARM: Samsung: move driver strength gpio configuration helper to common dir Marek Szyprowski
@ 2010-03-25 11:15 ` Marek Szyprowski
2010-03-25 11:15 ` [PATCH 6/8] ARM: Samsung: move common framebuffer regs to common platform directory Marek Szyprowski
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Marek Szyprowski @ 2010-03-25 11:15 UTC (permalink / raw)
To: linux-arm-kernel
Add basic support for Samsung Aquila board. This board is based
on S5PC110 SoC.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-s5pv210/Kconfig | 12 ++--
arch/arm/mach-s5pv210/Makefile | 1 +
arch/arm/mach-s5pv210/mach-aquila.c | 100 +++++++++++++++++++++++++++++++++++
3 files changed, 107 insertions(+), 6 deletions(-)
create mode 100644 arch/arm/mach-s5pv210/mach-aquila.c
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index af33a1a..c42bcba 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -15,11 +15,6 @@ config CPU_S5PV210
help
Enable S5PV210 CPU support
-choice
- prompt "Select machine type"
- depends on ARCH_S5PV210
- default MACH_SMDKV210
-
config MACH_SMDKV210
bool "SMDKV210"
select CPU_S5PV210
@@ -35,6 +30,11 @@ config MACH_SMDKC110
Machine support for Samsung SMDKC110
S5PC110(MCP) is one of package option of S5PV210
-endchoice
+config MACH_AQUILA
+ bool "Samsung Aquila"
+ select CPU_S5PV210
+ select ARCH_SPARSEMEM_ENABLE
+ help
+ Machine support for the Samsung Aquila target based on S5PC110 SoC
endif
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index cb1553c..67068c4 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -18,3 +18,4 @@ obj-$(CONFIG_CPU_S5PV210) += cpu.o init.o clock.o gpio.o
obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o
obj-$(CONFIG_MACH_SMDKC110) += mach-smdkc110.o
+obj-$(CONFIG_MACH_AQUILA) += mach-aquila.o
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
new file mode 100644
index 0000000..6a1db39
--- /dev/null
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -0,0 +1,100 @@
+/* linux/arch/arm/mach-s5pv210/mach-aquila.c
+ *
+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com/
+ *
+ * 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/serial_core.h>
+
+#include <asm/mach/arch.h>
+#include <asm/mach/map.h>
+#include <asm/setup.h>
+#include <asm/mach-types.h>
+
+#include <mach/map.h>
+#include <mach/regs-clock.h>
+
+#include <plat/regs-serial.h>
+#include <plat/s5pv210.h>
+#include <plat/devs.h>
+#include <plat/cpu.h>
+
+/* Following are default values for UCON, ULCON and UFCON UART registers */
+#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
+ S3C2410_UCON_RXILEVEL | \
+ S3C2410_UCON_TXIRQMODE | \
+ S3C2410_UCON_RXIRQMODE | \
+ S3C2410_UCON_RXFIFO_TOI | \
+ S3C2443_UCON_RXERR_IRQEN)
+
+#define S5PV210_ULCON_DEFAULT S3C2410_LCON_CS8
+
+#define S5PV210_UFCON_DEFAULT (S3C2410_UFCON_FIFOMODE | \
+ S5PV210_UFCON_TXTRIG4 | \
+ S5PV210_UFCON_RXTRIG4)
+
+static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
+ [0] = {
+ .hwport = 0,
+ .flags = 0,
+ .ucon = S5PV210_UCON_DEFAULT,
+ .ulcon = S5PV210_ULCON_DEFAULT,
+ .ufcon = S5PV210_UFCON_DEFAULT,
+ },
+ [1] = {
+ .hwport = 1,
+ .flags = 0,
+ .ucon = S5PV210_UCON_DEFAULT,
+ .ulcon = S5PV210_ULCON_DEFAULT,
+ .ufcon = S5PV210_UFCON_DEFAULT,
+ },
+ [2] = {
+ .hwport = 2,
+ .flags = 0,
+ .ucon = S5PV210_UCON_DEFAULT,
+ .ulcon = S5PV210_ULCON_DEFAULT,
+ .ufcon = S5PV210_UFCON_DEFAULT,
+ },
+ [3] = {
+ .hwport = 3,
+ .flags = 0,
+ .ucon = S5PV210_UCON_DEFAULT,
+ .ulcon = S5PV210_ULCON_DEFAULT,
+ .ufcon = S5PV210_UFCON_DEFAULT,
+ },
+};
+
+static struct platform_device *aquila_devices[] __initdata = {
+};
+
+static void __init aquila_map_io(void)
+{
+ s5p_init_io(NULL, 0, S5P_VA_CHIPID);
+ s3c24xx_init_clocks(24000000);
+ s3c24xx_init_uarts(smdkv210_uartcfgs, ARRAY_SIZE(smdkv210_uartcfgs));
+}
+
+static void __init aquila_machine_init(void)
+{
+ platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices));
+}
+
+MACHINE_START(AQUILA, "Aquila")
+ /* Maintainers:
+ Marek Szyprowski <m.szyprowski@samsung.com>
+ Kyungmin Park <kyungmin.park@samsung.com> */
+ .phys_io = S3C_PA_UART & 0xfff00000,
+ .io_pg_offst = (((u32)S3C_VA_UART) >> 18) & 0xfffc,
+ .boot_params = S5P_PA_SDRAM + 0x100,
+ .init_irq = s5pv210_init_irq,
+ .map_io = aquila_map_io,
+ .init_machine = aquila_machine_init,
+ .timer = &s3c24xx_timer,
+MACHINE_END
--
1.6.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 6/8] ARM: Samsung: move common framebuffer regs to common platform directory
2010-03-25 11:15 [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
` (4 preceding siblings ...)
2010-03-25 11:15 ` [PATCH 5/8] ARM: S5PV210: add Aquila board Marek Szyprowski
@ 2010-03-25 11:15 ` Marek Szyprowski
2010-03-25 11:15 ` [PATCH 7/8] ARM: S5PV210: add framebuffer platform helpers for s5pv210 based machines Marek Szyprowski
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Marek Szyprowski @ 2010-03-25 11:15 UTC (permalink / raw)
To: linux-arm-kernel
From: Pawel Osciak <p.osciak@samsung.com>
The framebuffer register blocks on S5PC100 and S5PV210/S5PC110 differ
only slightly. This patch extracts all register definitions that are
common to S5PC100 and S5PC110 into plat-samsung/plat/regs-fb-v5.h and
adds a new file with C110-specific register definitions to the
mach-s5pv210/include/mach directory.
Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-s5pc100/include/mach/regs-fb.h | 130 +--------------------
arch/arm/mach-s5pv210/include/mach/regs-fb.h | 91 +++++++++++++++
arch/arm/plat-samsung/include/plat/regs-fb-v5.h | 138 +++++++++++++++++++++++
3 files changed, 236 insertions(+), 123 deletions(-)
create mode 100644 arch/arm/mach-s5pv210/include/mach/regs-fb.h
create mode 100644 arch/arm/plat-samsung/include/plat/regs-fb-v5.h
diff --git a/arch/arm/mach-s5pc100/include/mach/regs-fb.h b/arch/arm/mach-s5pc100/include/mach/regs-fb.h
index 1732cd2..c5d75c5 100644
--- a/arch/arm/mach-s5pc100/include/mach/regs-fb.h
+++ b/arch/arm/mach-s5pc100/include/mach/regs-fb.h
@@ -3,137 +3,21 @@
* Copyright 2009 Samsung Electronics Co.
* Pawel Osciak <p.osciak@samsung.com>
*
- * 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 */
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-fb.h b/arch/arm/mach-s5pv210/include/mach/regs-fb.h
new file mode 100644
index 0000000..27fa497
--- /dev/null
+++ b/arch/arm/mach-s5pv210/include/mach/regs-fb.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright 2009 Samsung Electronics Co.
+ * Pawel Osciak <p.osciak@samsung.com>
+ *
+ * Machine-specific framebuffer definitions for Samsung S5PC110.
+ *
+ * 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_MACH_REGS_FB_H
+#define __ASM_ARCH_MACH_REGS_FB_H __FILE__
+
+#include <plat/regs-fb-v5.h>
+
+/* WINCONx */
+#define WINCONx_BUFSTATUS_H (1 << 31)
+#define WINCONx_BUFSEL_H (1 << 30)
+#define WINCONx_LIMIT_ON (1 << 29)
+#define WINCONx_EQ709 (1 << 28)
+
+
+/* VIDCON3 */
+#define VIDCON3 (0x0c)
+#define VIDCON3_VE_ON (1 << 20)
+#define VIDCON3_CG_ON (1 << 18)
+#define VIDCON3_GM_ON (1 << 16)
+#define VIDCON3_HU_CSC_F_NARROW (1 << 14)
+#define VIDCON3_HU_CSC_F_EQ709 (1 << 13)
+#define VIDCON3_HU_CSC_F_EN (1 << 12)
+#define VIDCON3_HU_CSC_B_NARROW (1 << 10)
+#define VIDCON3_HU_CSC_B_EQ709 (1 << 9)
+#define VIDCON3_HU_CSC_B_EN (1 << 8)
+#define VIDCON3_HUE_EN (1 << 7)
+#define VIDCON3_PC_DIR_NEG (1 << 1)
+#define VIDCON3_PC_EN (1 << 0)
+
+
+/* VIDTCON3 */
+#define VIDTCON3 (0x1c)
+#define VIDTCON3_VSYNC_EN (1 << 31)
+#define VIDTCON3_FRM_EN (1 << 29)
+#define VIDTCON3_INVFRM_LOW (1 << 28)
+#define VIDTCON3_FRMVRATE_MASK 0xf
+#define VIDTCON3_FRMVRATE_SHIFT (24)
+#define VIDTCON3_FRMVFPD_MASK 0xff
+#define VIDTCON3_FRMVFPD_SHIFT (8)
+#define VIDTCON3_FRMVSPW_MASK 0xff
+#define VIDTCON3_FRMVSPW_SHIFT (0)
+
+
+#define SHADOWCON (0x34)
+/* Set to disable window 4-0 shadow registers' update */
+#define SHADOWCON_W4_PROTECT (1 << 14)
+#define SHADOWCON_W3_PROTECT (1 << 13)
+#define SHADOWCON_W2_PROTECT (1 << 12)
+#define SHADOWCON_W1_PROTECT (1 << 11)
+#define SHADOWCON_W0_PROTECT (1 << 10)
+
+
+/* Video buffer address shadow registers (read-only) */
+#define VIDW_BUF_START_SHADOW(_buf) (0x20a0 + ((_buf) * 8))
+#define VIDW_BUF_END_SHADOW(_buf) (0x20d0 + ((_buf) * 8))
+
+/* For windows 1-4 */
+#define WxKEY_ALPHA(_win) (0x160 + ((_win) * 4))
+
+#define COLORGAINCON (0x1c0)
+#define VESFRCON0 (0x1c4)
+#define VESFRCON1 (0x1c8)
+#define VESFRCON2 (0x1cc)
+
+/* Hue matrix coefficients */
+#define HUECOEF00 (0x1ec)
+#define HUECOEF01 (0x1f0)
+#define HUECOEF10 (0x1f4)
+#define HUECOEF11 (0x1f8)
+#define HUEOFFSET (0x1fc)
+
+/* RTQOS control for windows 0-4*/
+#define WxRTQOSCON(_win) (0x264 + ((_win) * 4))
+
+/* Gamma LUT data for index I1 and I0, where
+ * I0 = _index, I1 = _index + 1.
+ */
+#define GAMMALUT_BASE (0x37c)
+#define GAMMALUT_I1I0(_index) (GAMMALUT_BASE + ((_index) * 4))
+
+#endif /* __ASM_ARCH_MACH_REGS_FB_H */
+
diff --git a/arch/arm/plat-samsung/include/plat/regs-fb-v5.h b/arch/arm/plat-samsung/include/plat/regs-fb-v5.h
new file mode 100644
index 0000000..0e0686d
--- /dev/null
+++ b/arch/arm/plat-samsung/include/plat/regs-fb-v5.h
@@ -0,0 +1,138 @@
+/*
+ * Copyright 2009 Samsung Electronics Co.
+ * Pawel Osciak <p.osciak@samsung.com>
+ *
+ * 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_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 */
+
--
1.6.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 7/8] ARM: S5PV210: add framebuffer platform helpers for s5pv210 based machines
2010-03-25 11:15 [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
` (5 preceding siblings ...)
2010-03-25 11:15 ` [PATCH 6/8] ARM: Samsung: move common framebuffer regs to common platform directory Marek Szyprowski
@ 2010-03-25 11:15 ` Marek Szyprowski
2010-03-25 11:15 ` [PATCH 8/8] ARM: S5PV210: add support for s3c-fb driver on Aquila machine Marek Szyprowski
2010-05-04 8:33 ` [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
8 siblings, 0 replies; 10+ messages in thread
From: Marek Szyprowski @ 2010-03-25 11:15 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds common framebuffer device helpers and register defines
for S5PV210 based machines.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-s5pv210/Kconfig | 5 ++
arch/arm/mach-s5pv210/Makefile | 4 ++
arch/arm/mach-s5pv210/include/mach/irqs.h | 5 ++
arch/arm/mach-s5pv210/include/mach/map.h | 3 +
arch/arm/mach-s5pv210/include/mach/regs-clock.h | 1 +
arch/arm/mach-s5pv210/setup-fb-24bpp.c | 62 +++++++++++++++++++++++
arch/arm/plat-samsung/include/plat/fb.h | 7 +++
7 files changed, 87 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-s5pv210/setup-fb-24bpp.c
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index c42bcba..3717b52 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -15,6 +15,11 @@ config CPU_S5PV210
help
Enable S5PV210 CPU support
+config S5PV210_SETUP_FB_24BPP
+ bool
+ help
+ Common setup code for S5PV210 with an 24bpp RGB display helper.
+
config MACH_SMDKV210
bool "SMDKV210"
select CPU_S5PV210
diff --git a/arch/arm/mach-s5pv210/Makefile b/arch/arm/mach-s5pv210/Makefile
index 67068c4..9a0af8b 100644
--- a/arch/arm/mach-s5pv210/Makefile
+++ b/arch/arm/mach-s5pv210/Makefile
@@ -14,6 +14,10 @@ obj- :=
obj-$(CONFIG_CPU_S5PV210) += cpu.o init.o clock.o gpio.o
+# Helper and device support
+
+obj-$(CONFIG_S5PV210_SETUP_FB_24BPP) += setup-fb-24bpp.o
+
# machine support
obj-$(CONFIG_MACH_SMDKV210) += mach-smdkv210.o
diff --git a/arch/arm/mach-s5pv210/include/mach/irqs.h b/arch/arm/mach-s5pv210/include/mach/irqs.h
index 62c5175..ee6e07b 100644
--- a/arch/arm/mach-s5pv210/include/mach/irqs.h
+++ b/arch/arm/mach-s5pv210/include/mach/irqs.h
@@ -143,4 +143,9 @@
#define NR_IRQS (IRQ_EINT(31) + 1)
+/* Compatibility */
+#define IRQ_LCD_FIFO IRQ_LCD0
+#define IRQ_LCD_VSYNC IRQ_LCD1
+#define IRQ_LCD_SYSTEM IRQ_LCD2
+
#endif /* ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/map.h b/arch/arm/mach-s5pv210/include/mach/map.h
index c22694c..5903056 100644
--- a/arch/arm/mach-s5pv210/include/mach/map.h
+++ b/arch/arm/mach-s5pv210/include/mach/map.h
@@ -43,6 +43,8 @@
#define S5PV210_PA_SROMC (0xE8000000)
+#define S5PV210_PA_FB (0xF8000000)
+
#define S5PV210_PA_VIC0 (0xF2000000)
#define S5P_PA_VIC0 S5PV210_PA_VIC0
@@ -61,5 +63,6 @@
/* compatibiltiy defines. */
#define S3C_PA_UART S5PV210_PA_UART
#define S3C_PA_IIC S5PV210_PA_IIC0
+#define S3C_PA_FB S5PV210_PA_FB
#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-s5pv210/include/mach/regs-clock.h b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
index 40dd24f..0a3d7ad 100644
--- a/arch/arm/mach-s5pv210/include/mach/regs-clock.h
+++ b/arch/arm/mach-s5pv210/include/mach/regs-clock.h
@@ -128,6 +128,7 @@
#define S5P_RST_STAT S5P_CLKREG(0xA000)
#define S5P_OSC_CON S5P_CLKREG(0x8000)
+#define S5P_MDNIE_SEL S5P_CLKREG(0x7008)
#define S5P_MIPI_PHY_CON0 S5P_CLKREG(0x7200)
#define S5P_MIPI_PHY_CON1 S5P_CLKREG(0x7204)
#define S5P_MIPI_CONTROL S5P_CLKREG(0xE814)
diff --git a/arch/arm/mach-s5pv210/setup-fb-24bpp.c b/arch/arm/mach-s5pv210/setup-fb-24bpp.c
new file mode 100644
index 0000000..b039a55
--- /dev/null
+++ b/arch/arm/mach-s5pv210/setup-fb-24bpp.c
@@ -0,0 +1,62 @@
+/*
+ * linux/arch/arm/plat-s5pv210/setup-fb-24bpp.c
+ *
+ * Copyright 2009 Samsung Electronics
+ *
+ * Base s5pv210 setup information for 24bpp LCD framebuffer
+ *
+ * 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/fb.h>
+
+#include <mach/regs-fb.h>
+#include <mach/gpio.h>
+#include <mach/map.h>
+#include <plat/fb.h>
+#include <mach/regs-clock.h>
+#include <plat/gpio-cfg.h>
+
+void s5pv210_fb_gpio_setup_24bpp(void)
+{
+ unsigned int gpio = 0;
+
+ for (gpio = S5PV210_GPF0(0); gpio <= S5PV210_GPF0(7); gpio++) {
+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
+ }
+
+ for (gpio = S5PV210_GPF1(0); gpio <= S5PV210_GPF1(7); gpio++) {
+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
+ }
+
+ for (gpio = S5PV210_GPF2(0); gpio <= S5PV210_GPF2(7); gpio++) {
+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
+ }
+
+ for (gpio = S5PV210_GPF3(0); gpio <= S5PV210_GPF3(3); gpio++) {
+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);
+ }
+
+ /* Set DISPLAY_CONTROL register for Display path selection.
+ *
+ * ouput | RGB | I80 | ITU
+ * -----------------------------------
+ * 00 | MIE | FIMD | FIMD
+ * 01 | MDNIE | MDNIE | FIMD
+ * 10 | FIMD | FIMD | FIMD
+ * 11 | FIMD | FIMD | FIMD
+ */
+ writel(0x2, S5P_MDNIE_SEL);
+}
diff --git a/arch/arm/plat-samsung/include/plat/fb.h b/arch/arm/plat-samsung/include/plat/fb.h
index ffc01a7..3b30d7b 100644
--- a/arch/arm/plat-samsung/include/plat/fb.h
+++ b/arch/arm/plat-samsung/include/plat/fb.h
@@ -77,4 +77,11 @@ extern void s3c64xx_fb_gpio_setup_24bpp(void);
*/
extern void s5pc100_fb_gpio_setup_24bpp(void);
+/**
+ * s5pv210_fb_gpio_setup_24bpp() - S5PV210/S5PC110 setup function for 24bpp LCD
+ *
+ * Initialise the GPIO for an 24bpp LCD display on the RGB interface.
+ */
+extern void s5pv210_fb_gpio_setup_24bpp(void);
+
#endif /* __PLAT_S3C_FB_H */
--
1.6.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 8/8] ARM: S5PV210: add support for s3c-fb driver on Aquila machine
2010-03-25 11:15 [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
` (6 preceding siblings ...)
2010-03-25 11:15 ` [PATCH 7/8] ARM: S5PV210: add framebuffer platform helpers for s5pv210 based machines Marek Szyprowski
@ 2010-03-25 11:15 ` Marek Szyprowski
2010-05-04 8:33 ` [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
8 siblings, 0 replies; 10+ messages in thread
From: Marek Szyprowski @ 2010-03-25 11:15 UTC (permalink / raw)
To: linux-arm-kernel
This patch adds required platform definitions to enable s3c-fb
driver. Two framebuffer windows in 480x800x16bpp mode are defined.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-s5pv210/Kconfig | 2 +
arch/arm/mach-s5pv210/mach-aquila.c | 49 +++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-s5pv210/Kconfig b/arch/arm/mach-s5pv210/Kconfig
index 3717b52..a7adc24 100644
--- a/arch/arm/mach-s5pv210/Kconfig
+++ b/arch/arm/mach-s5pv210/Kconfig
@@ -39,6 +39,8 @@ config MACH_AQUILA
bool "Samsung Aquila"
select CPU_S5PV210
select ARCH_SPARSEMEM_ENABLE
+ select S5PV210_SETUP_FB_24BPP
+ select S3C_DEV_FB
help
Machine support for the Samsung Aquila target based on S5PC110 SoC
diff --git a/arch/arm/mach-s5pv210/mach-aquila.c b/arch/arm/mach-s5pv210/mach-aquila.c
index 6a1db39..10bc76e 100644
--- a/arch/arm/mach-s5pv210/mach-aquila.c
+++ b/arch/arm/mach-s5pv210/mach-aquila.c
@@ -12,6 +12,7 @@
#include <linux/types.h>
#include <linux/init.h>
#include <linux/serial_core.h>
+#include <linux/fb.h>
#include <asm/mach/arch.h>
#include <asm/mach/map.h>
@@ -20,11 +21,13 @@
#include <mach/map.h>
#include <mach/regs-clock.h>
+#include <mach/regs-fb.h>
#include <plat/regs-serial.h>
#include <plat/s5pv210.h>
#include <plat/devs.h>
#include <plat/cpu.h>
+#include <plat/fb.h>
/* Following are default values for UCON, ULCON and UFCON UART registers */
#define S5PV210_UCON_DEFAULT (S3C2410_UCON_TXILEVEL | \
@@ -71,7 +74,50 @@ static struct s3c2410_uartcfg smdkv210_uartcfgs[] __initdata = {
},
};
+/* Frame Buffer */
+static struct s3c_fb_pd_win aquila_fb_win0 = {
+ .win_mode = {
+ .pixclock = 1000000000000ULL / ((16+16+2+480)*(28+3+2+800)*60),
+ .left_margin = 16,
+ .right_margin = 16,
+ .upper_margin = 3,
+ .lower_margin = 28,
+ .hsync_len = 2,
+ .vsync_len = 2,
+ .xres = 480,
+ .yres = 800,
+ },
+ .max_bpp = 32,
+ .default_bpp = 16,
+};
+
+static struct s3c_fb_pd_win aquila_fb_win1 = {
+ .win_mode = {
+ .pixclock = 1000000000000ULL / ((16+16+2+480)*(28+3+2+800)*60),
+ .left_margin = 16,
+ .right_margin = 16,
+ .upper_margin = 3,
+ .lower_margin = 28,
+ .hsync_len = 2,
+ .vsync_len = 2,
+ .xres = 480,
+ .yres = 800,
+ },
+ .max_bpp = 32,
+ .default_bpp = 16,
+};
+
+static struct s3c_fb_platdata aquila_lcd_pdata __initdata = {
+ .win[0] = &aquila_fb_win0,
+ .win[1] = &aquila_fb_win1,
+ .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
+ .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
+ VIDCON1_INV_VCLK | VIDCON1_INV_VDEN,
+ .setup_gpio = s5pv210_fb_gpio_setup_24bpp,
+};
+
static struct platform_device *aquila_devices[] __initdata = {
+ &s3c_device_fb,
};
static void __init aquila_map_io(void)
@@ -83,6 +129,9 @@ static void __init aquila_map_io(void)
static void __init aquila_machine_init(void)
{
+ /* FB */
+ s3c_fb_set_platdata(&aquila_lcd_pdata);
+
platform_add_devices(aquila_devices, ARRAY_SIZE(aquila_devices));
}
--
1.6.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH] Add support for Aquita board (Samsung S5PC110 based)
2010-03-25 11:15 [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
` (7 preceding siblings ...)
2010-03-25 11:15 ` [PATCH 8/8] ARM: S5PV210: add support for s3c-fb driver on Aquila machine Marek Szyprowski
@ 2010-05-04 8:33 ` Marek Szyprowski
8 siblings, 0 replies; 10+ messages in thread
From: Marek Szyprowski @ 2010-05-04 8:33 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On Thursday, March 25, 2010 12:15 PM Marek Szyprowski wrote:
> This patch series add basic support for Samsung Aquila board. The board
> is based on Samsung S5PC110 SoC. For the basic support of this board, the
> S5PV210/S5PC110 platform core needs to be updated. This patch series
> contains patches that add support for gpiolib, software reset and
> framebuffer helpers. Please expect further extensions to the s5pv210
> platform core soon.
Is there any progress or comments on merging these patches? What about
other s5pv210/s5pc110 patches that were posted here?
Some of them are really important bugfixes:
ARM: S5P6440: Bug fix on PWM Timer
ARM: S5P6442: Bug fix on PWM Timer
ARM: S5PV210: Bug fix on PWM Timer
ARM: Samsung: fix broken timer irq base
The other add really important features to the platform:
ARM: S5P: Add System Timer
ARM: Samsung: S5PC100 platform cleanup
Add S5PV210/S5PC110 platform helpers
ARM: Samsung: Add platform support code for OneNAND controller
How can I help merging new features and drivers to the Samsung SoC platform?
Best regards
--
Marek Szyprowski
Samsung Poland R&D Center
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2010-05-04 8:33 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-25 11:15 [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
2010-03-25 11:15 ` [PATCH 1/8] ARM: S5PV210: fix formating of the debug messages on boot Marek Szyprowski
2010-03-25 11:15 ` [PATCH 2/8] ARM: S5PV210: add support for software reset Marek Szyprowski
2010-03-25 11:15 ` [PATCH 3/8] ARM: S5PV210: add gpiolib support Marek Szyprowski
2010-03-25 11:15 ` [PATCH 4/8] ARM: Samsung: move driver strength gpio configuration helper to common dir Marek Szyprowski
2010-03-25 11:15 ` [PATCH 5/8] ARM: S5PV210: add Aquila board Marek Szyprowski
2010-03-25 11:15 ` [PATCH 6/8] ARM: Samsung: move common framebuffer regs to common platform directory Marek Szyprowski
2010-03-25 11:15 ` [PATCH 7/8] ARM: S5PV210: add framebuffer platform helpers for s5pv210 based machines Marek Szyprowski
2010-03-25 11:15 ` [PATCH 8/8] ARM: S5PV210: add support for s3c-fb driver on Aquila machine Marek Szyprowski
2010-05-04 8:33 ` [PATCH] Add support for Aquita board (Samsung S5PC110 based) Marek Szyprowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).