Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198488
b: refs/heads/master
c: fac3d35
h: refs/heads/master
v: v3
  • Loading branch information
Ben Dooks committed May 20, 2010
1 parent fbe26a2 commit 3c3b43d
Show file tree
Hide file tree
Showing 44 changed files with 653 additions and 3,270 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 41d8289d161e23e9cff78c914b6f37f30e627ea2
refs/heads/master: fac3d3555568de1755025a9609daf492dd548a59
9 changes: 3 additions & 6 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -699,14 +699,14 @@ config ARCH_S5P6442
help
Samsung S5P6442 CPU based systems

config ARCH_S5PC1XX
bool "Samsung S5PC1XX"
config ARCH_S5PC100
bool "Samsung S5PC100"
select GENERIC_GPIO
select HAVE_CLK
select CPU_V7
select ARM_L1_CACHE_SHIFT_6
help
Samsung S5PC1XX series based systems
Samsung S5PC100 series based systems

config ARCH_S5PV210
bool "Samsung S5PV210/S5PC110"
Expand Down Expand Up @@ -890,7 +890,6 @@ source "arch/arm/mach-sa1100/Kconfig"
source "arch/arm/plat-samsung/Kconfig"
source "arch/arm/plat-s3c24xx/Kconfig"
source "arch/arm/plat-s5p/Kconfig"
source "arch/arm/plat-s5pc1xx/Kconfig"

if ARCH_S3C2410
source "arch/arm/mach-s3c2400/Kconfig"
Expand All @@ -909,9 +908,7 @@ source "arch/arm/mach-s5p6440/Kconfig"

source "arch/arm/mach-s5p6442/Kconfig"

if ARCH_S5PC1XX
source "arch/arm/mach-s5pc100/Kconfig"
endif

source "arch/arm/mach-s5pv210/Kconfig"

Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ machine-$(CONFIG_ARCH_S3C24A0) := s3c24a0
machine-$(CONFIG_ARCH_S3C64XX) := s3c64xx
machine-$(CONFIG_ARCH_S5P6440) := s5p6440
machine-$(CONFIG_ARCH_S5P6442) := s5p6442
machine-$(CONFIG_ARCH_S5PC1XX) := s5pc100
machine-$(CONFIG_ARCH_S5PC100) := s5pc100
machine-$(CONFIG_ARCH_S5PV210) := s5pv210
machine-$(CONFIG_ARCH_SA1100) := sa1100
machine-$(CONFIG_ARCH_SHARK) := shark
Expand All @@ -192,7 +192,6 @@ plat-$(CONFIG_PLAT_NOMADIK) := nomadik
plat-$(CONFIG_PLAT_ORION) := orion
plat-$(CONFIG_PLAT_PXA) := pxa
plat-$(CONFIG_PLAT_S3C24XX) := s3c24xx samsung
plat-$(CONFIG_PLAT_S5PC1XX) := s5pc1xx samsung
plat-$(CONFIG_PLAT_S5P) := s5p samsung

ifeq ($(CONFIG_ARCH_EBSA110),y)
Expand Down
25 changes: 17 additions & 8 deletions trunk/arch/arm/mach-s5pc100/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@

# Configuration options for the S5PC100 CPU

if ARCH_S5PC100

config CPU_S5PC100
bool
select CPU_S5PC100_INIT
select CPU_S5PC100_CLOCK
select PLAT_S5P
select S5P_EXT_INT
help
Enable S5PC100 CPU support

Expand All @@ -17,17 +19,22 @@ config S5PC100_SETUP_FB_24BPP
help
Common setup code for S5PC1XX with an 24bpp RGB display helper.

config S5PC100_SETUP_SDHCI
bool
select S5PC1XX_SETUP_SDHCI_GPIO
help
Internal helper functions for S5PC100 based SDHCI systems

config S5PC100_SETUP_I2C1
bool
help
Common setup code for i2c bus 1.

config S5PC100_SETUP_SDHCI
bool
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
Expand All @@ -41,3 +48,5 @@ config MACH_SMDKC100
select S5PC100_SETUP_SDHCI
help
Machine support for the Samsung SMDKC100

endif
6 changes: 4 additions & 2 deletions trunk/arch/arm/mach-s5pc100/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ obj- :=

# Core support for S5PC100 system

obj-$(CONFIG_CPU_S5PC100) += cpu.o gpiolib.o
obj-$(CONFIG_CPU_S5PC100) += cpu.o init.o clock.o gpiolib.o irq-gpio.o
obj-$(CONFIG_CPU_S5PC100) += setup-i2c0.o

# Helper and device support

obj-$(CONFIG_S5PC100_SETUP_FB_24BPP) += setup-fb-24bpp.o
obj-$(CONFIG_S5PC100_SETUP_I2C1) += setup-i2c1.o
obj-$(CONFIG_S5PC100_SETUP_SDHCI) += setup-sdhci.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
56 changes: 32 additions & 24 deletions trunk/arch/arm/mach-s5pc100/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,53 @@
#include <linux/serial_core.h>
#include <linux/platform_device.h>

#include <asm/proc-fns.h>

#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>

#include <asm/proc-fns.h>

#include <mach/hardware.h>
#include <mach/map.h>
#include <asm/irq.h>

#include <plat/cpu-freq.h>
#include <plat/regs-serial.h>
#include <plat/regs-power.h>
#include <mach/regs-clock.h>

#include <plat/cpu.h>
#include <plat/devs.h>
#include <plat/clock.h>
#include <plat/sdhci.h>
#include <plat/iic-core.h>
#include <plat/sdhci.h>
#include <plat/s5pc100.h>

/* Initial IO mappings */

static struct map_desc s5pc100_iodesc[] __initdata = {
{
.virtual = (unsigned long)S5P_VA_SYSTIMER,
.pfn = __phys_to_pfn(S5PC100_PA_SYSTIMER),
.length = SZ_16K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)VA_VIC2,
.pfn = __phys_to_pfn(S5PC100_PA_VIC2),
.length = SZ_16K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)S5PC100_VA_OTHERS,
.pfn = __phys_to_pfn(S5PC100_PA_OTHERS),
.length = SZ_4K,
.type = MT_DEVICE,
}
};

static void s5pc100_idle(void)
{
unsigned long tmp;

tmp = __raw_readl(S5PC100_PWR_CFG);
tmp &= ~S5PC100_PWRCFG_CFG_DEEP_IDLE;
tmp &= ~S5PC100_PWRCFG_CFG_WFI_MASK;
tmp |= S5PC100_PWRCFG_CFG_WFI_DEEP_IDLE;
__raw_writel(tmp, S5PC100_PWR_CFG);
if (!need_resched())
cpu_do_idle();

tmp = __raw_readl(S5PC100_OTHERS);
tmp |= S5PC100_PMU_INT_DISABLE;
__raw_writel(tmp, S5PC100_OTHERS);

cpu_do_idle();
local_irq_enable();
}

/* s5pc100_map_io
Expand All @@ -86,22 +92,23 @@ void __init s5pc100_map_io(void)

void __init s5pc100_init_clocks(int xtal)
{
printk(KERN_DEBUG "%s: initialising clocks\n", __func__);
printk(KERN_DEBUG "%s: initializing clocks\n", __func__);

s3c24xx_register_baseclocks(xtal);
s5pc1xx_register_clocks();
s5p_register_clocks(xtal);
s5pc100_register_clocks();
s5pc100_setup_clocks();
}

void __init s5pc100_init_irq(void)
{
u32 vic_valid[] = {~0, ~0, ~0};
u32 vic[] = {~0, ~0, ~0};

/* VIC0, VIC1, and VIC2 are fully populated. */
s5pc1xx_init_irq(vic_valid, ARRAY_SIZE(vic_valid));
s5p_init_irq(vic, ARRAY_SIZE(vic));
}

struct sysdev_class s5pc100_sysclass = {
static struct sysdev_class s5pc100_sysclass = {
.name = "s5pc100-core",
};

Expand All @@ -118,9 +125,10 @@ core_initcall(s5pc100_core_init);

int __init s5pc100_init(void)
{
printk(KERN_DEBUG "S5PC100: Initialising architecture\n");
printk(KERN_INFO "S5PC100: Initializing architecture\n");

s5pc1xx_idle = s5pc100_idle;
/* set idle function */
pm_idle = s5pc100_idle;

return sysdev_register(&s5pc100_sysdev);
}
36 changes: 17 additions & 19 deletions trunk/arch/arm/mach-s5pc100/gpiolib.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/*
* arch/arm/plat-s5pc1xx/gpiolib.c
* arch/arm/plat-s5pc100/gpiolib.c
*
* Copyright 2009 Samsung Electronics Co
* Kyungmin Park <kyungmin.park@samsung.com>
*
* S5PC1XX - GPIOlib support
* S5PC100 - 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
Expand Down Expand Up @@ -61,13 +61,12 @@
* L3 8 4Bit None
*/

#if 0
static int s5pc1xx_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
static int s5pc100_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset)
{
return S3C_IRQ_GPIO(chip->base + offset);
}

static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset)
static int s5pc100_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset)
{
int base;

Expand All @@ -85,7 +84,7 @@ static int s5pc1xx_gpiolib_to_eint(struct gpio_chip *chip, unsigned int offset)
return IRQ_EINT(24 + offset);
return -EINVAL;
}
#endif

static struct s3c_gpio_cfg gpio_cfg = {
.set_config = s3c_gpio_setcfg_s3c64xx_4bit,
.set_pull = s3c_gpio_setpull_updown,
Expand Down Expand Up @@ -382,31 +381,30 @@ static struct s3c_gpio_chip s5pc100_gpio_chips[] = {
};

/* 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);
extern struct irq_chip s5pc100_gpioint;
extern void s5pc100_irq_gpioint_handler(unsigned int irq, struct irq_desc *desc);

static __init void s5pc100_gpiolib_link(struct s3c_gpio_chip *chip)
{
#if 0
/* Interrupt */
if (chip->config == &gpio_cfg) {
int i, irq;

chip->chip.to_irq = s5pc1xx_gpiolib_to_irq;
chip->chip.to_irq = s5pc100_gpiolib_to_irq;

for (i = 0; i < chip->chip.ngpio; i++) {
irq = S3C_IRQ_GPIO_BASE + chip->chip.base + i;
set_irq_chip(irq, &s5pc1xx_gpioint);
set_irq_chip(irq, &s5pc100_gpioint);
set_irq_data(irq, &chip->chip);
set_irq_handler(irq, handle_level_irq);
set_irq_flags(irq, IRQF_VALID);
}
} else if (chip->config == &gpio_cfg_eint)
chip->chip.to_irq = s5pc1xx_gpiolib_to_eint;
#endif
} else if (chip->config == &gpio_cfg_eint) {
chip->chip.to_irq = s5pc100_gpiolib_to_eint;
}
}

static __init int s5pc1xx_gpiolib_init(void)
static __init int s5pc100_gpiolib_init(void)
{
struct s3c_gpio_chip *chip;
int nr_chips;
Expand All @@ -419,10 +417,10 @@ static __init int s5pc1xx_gpiolib_init(void)

samsung_gpiolib_add_4bit_chips(s5pc100_gpio_chips,
ARRAY_SIZE(s5pc100_gpio_chips));
#if 0

/* Interrupt */
set_irq_chained_handler(IRQ_GPIOINT, s5pc1xx_irq_gpioint_handler);
#endif
set_irq_chained_handler(IRQ_GPIOINT, s5pc100_irq_gpioint_handler);

return 0;
}
core_initcall(s5pc1xx_gpiolib_init);
core_initcall(s5pc100_gpiolib_init);
6 changes: 4 additions & 2 deletions trunk/arch/arm/mach-s5pc100/include/mach/debug-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@
* aligned and add in the offset when we load the value here.
*/

.macro addruart, rx, tmp
.macro addruart, rx, rtmp
mrc p15, 0, \rx, c1, c0
tst \rx, #1
ldreq \rx, = S3C_PA_UART
ldrne \rx, = (S3C_VA_UART + S3C_PA_UART & 0xfffff)
ldrne \rx, = S3C_VA_UART
#if CONFIG_DEBUG_S3C_UART != 0
add \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
#endif
.endm

/* include the reset of the code which will do the work, we're only
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/arm/mach-s5pc100/include/mach/entry-macro.S
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
.endm

.macro get_irqnr_preamble, base, tmp
ldr \base, =S3C_VA_VIC0
ldr \base, =VA_VIC0
.endm

.macro arch_ret_to_user, tmp1, tmp2
Expand All @@ -29,18 +29,18 @@
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp

@ check the vic0
mov \irqnr, # S3C_IRQ_OFFSET + 31
mov \irqnr, # S5P_IRQ_OFFSET + 31
ldr \irqstat, [ \base, # VIC_IRQ_STATUS ]
teq \irqstat, #0

@ otherwise try vic1
addeq \tmp, \base, #(S3C_VA_VIC1 - S3C_VA_VIC0)
addeq \tmp, \base, #(VA_VIC1 - VA_VIC0)
addeq \irqnr, \irqnr, #32
ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
teqeq \irqstat, #0

@ otherwise try vic2
addeq \tmp, \base, #(S3C_VA_VIC2 - S3C_VA_VIC0)
addeq \tmp, \base, #(VA_VIC2 - VA_VIC0)
addeq \irqnr, \irqnr, #32
ldreq \irqstat, [ \tmp, # VIC_IRQ_STATUS ]
teqeq \irqstat, #0
Expand Down
7 changes: 7 additions & 0 deletions trunk/arch/arm/mach-s5pc100/include/mach/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ enum s5p_gpio_number {
/* define the number of gpios we need to the one after the MP04() range */
#define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1)

#define EINT_MODE S3C_GPIO_SFN(0x2)

#define EINT_GPIO_0(x) S5PC100_GPH0(x)
#define EINT_GPIO_1(x) S5PC100_GPH1(x)
#define EINT_GPIO_2(x) S5PC100_GPH2(x)
#define EINT_GPIO_3(x) S5PC100_GPH3(x)

#include <asm-generic/gpio.h>

#endif /* __ASM_ARCH_GPIO_H */
Loading

0 comments on commit 3c3b43d

Please sign in to comment.