Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 187383
b: refs/heads/master
c: 668dfc7
h: refs/heads/master
i:
  187381: 78622ca
  187379: 656011d
  187375: f937b12
v: v3
  • Loading branch information
Ben Dooks committed Jan 19, 2010
1 parent a3ec079 commit 58b3785
Show file tree
Hide file tree
Showing 23 changed files with 630 additions and 20 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: 22c810ab3e25d16e6f128384d107b933b6fd8fff
refs/heads/master: 668dfc7527eb755e1bf194bf19c0c281e9df6deb
2 changes: 1 addition & 1 deletion trunk/arch/arm/configs/mini2440_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ CONFIG_S3C24XX_PWM=y
CONFIG_S3C24XX_GPIO_EXTRA=0
CONFIG_S3C2410_DMA=y
# CONFIG_S3C2410_DMA_DEBUG is not set
CONFIG_S3C24XX_ADC=y
CONFIG_S3C_ADC=y
CONFIG_PLAT_S3C=y
CONFIG_CPU_LLSERIAL_S3C2440_ONLY=y
CONFIG_CPU_LLSERIAL_S3C2440=y
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/arm/configs/s3c2410_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ CONFIG_S3C24XX_GPIO_EXTRA128=y
CONFIG_PM_SIMTEC=y
CONFIG_S3C2410_DMA=y
# CONFIG_S3C2410_DMA_DEBUG is not set
CONFIG_S3C24XX_ADC=y
CONFIG_S3C_ADC=y
CONFIG_MACH_SMDK=y
CONFIG_PLAT_S3C=y
CONFIG_CPU_LLSERIAL_S3C2410=y
Expand Down
18 changes: 18 additions & 0 deletions trunk/arch/arm/mach-s3c6400/include/mach/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@

#include <plat/map-base.h>

/*
* Post-mux Chip Select Regions Xm0CSn_
* These may be used by SROM, NAND or CF depending on settings
*/

#define S3C64XX_PA_XM0CSN0 (0x10000000)
#define S3C64XX_PA_XM0CSN1 (0x18000000)
#define S3C64XX_PA_XM0CSN2 (0x20000000)
#define S3C64XX_PA_XM0CSN3 (0x28000000)
#define S3C64XX_PA_XM0CSN4 (0x30000000)
#define S3C64XX_PA_XM0CSN5 (0x38000000)

/* HSMMC units */
#define S3C64XX_PA_HSMMC(x) (0x7C200000 + ((x) * 0x100000))
#define S3C64XX_PA_HSMMC0 S3C64XX_PA_HSMMC(0)
Expand All @@ -38,16 +50,22 @@
#define S3C_VA_UART2 S3C_VA_UARTx(2)
#define S3C_VA_UART3 S3C_VA_UARTx(3)

#define S3C64XX_PA_SROM (0x70000000)

#define S3C64XX_PA_NAND (0x70200000)
#define S3C64XX_PA_FB (0x77100000)
#define S3C64XX_PA_USB_HSOTG (0x7C000000)
#define S3C64XX_PA_WATCHDOG (0x7E004000)
#define S3C64XX_PA_RTC (0x7E005000)
#define S3C64XX_PA_ADC (0x7E00B000)
#define S3C64XX_PA_SYSCON (0x7E00F000)
#define S3C64XX_PA_AC97 (0x7F001000)
#define S3C64XX_PA_IIS0 (0x7F002000)
#define S3C64XX_PA_IIS1 (0x7F003000)
#define S3C64XX_PA_TIMER (0x7F006000)
#define S3C64XX_PA_IIC0 (0x7F004000)
#define S3C64XX_PA_SPI0 (0x7F00B000)
#define S3C64XX_PA_SPI1 (0x7F00C000)
#define S3C64XX_PA_PCM0 (0x7F009000)
#define S3C64XX_PA_PCM1 (0x7F00A000)
#define S3C64XX_PA_IISV4 (0x7F00D000)
Expand Down
37 changes: 35 additions & 2 deletions trunk/arch/arm/mach-s3c6410/mach-smdk6410.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <plat/regs-modem.h>
#include <plat/regs-gpio.h>
#include <plat/regs-sys.h>
#include <plat/regs-srom.h>
#include <plat/iic.h>
#include <plat/fb.h>
#include <plat/gpio-cfg.h>
Expand Down Expand Up @@ -154,10 +155,20 @@ static struct s3c_fb_platdata smdk6410_lcd_pdata __initdata = {
.vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
};

/*
* Configuring Ethernet on SMDK6410
*
* Both CS8900A and LAN9115 chips share one chip select mediated by CFG6.
* The constant address below corresponds to nCS1
*
* 1) Set CFGB2 p3 ON others off, no other CFGB selects "ethernet"
* 2) CFG6 needs to be switched to "LAN9115" side
*/

static struct resource smdk6410_smsc911x_resources[] = {
[0] = {
.start = 0x18000000,
.end = 0x18000000 + SZ_64K - 1,
.start = S3C64XX_PA_XM0CSN1,
.end = S3C64XX_PA_XM0CSN1 + SZ_64K - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
Expand Down Expand Up @@ -430,10 +441,32 @@ static void __init smdk6410_map_io(void)

static void __init smdk6410_machine_init(void)
{
u32 cs1;

s3c_i2c0_set_platdata(NULL);
s3c_i2c1_set_platdata(NULL);
s3c_fb_set_platdata(&smdk6410_lcd_pdata);

/* configure nCS1 width to 16 bits */

cs1 = __raw_readl(S3C64XX_SROM_BW) &
~(S3C64XX_SROM_BW__CS_MASK << S3C64XX_SROM_BW__NCS1__SHIFT);
cs1 |= ((1 << S3C64XX_SROM_BW__DATAWIDTH__SHIFT) |
(1 << S3C64XX_SROM_BW__WAITENABLE__SHIFT) |
(1 << S3C64XX_SROM_BW__BYTEENABLE__SHIFT)) <<
S3C64XX_SROM_BW__NCS1__SHIFT;
__raw_writel(cs1, S3C64XX_SROM_BW);

/* set timing for nCS1 suitable for ethernet chip */

__raw_writel((0 << S3C64XX_SROM_BCX__PMC__SHIFT) |
(6 << S3C64XX_SROM_BCX__TACP__SHIFT) |
(4 << S3C64XX_SROM_BCX__TCAH__SHIFT) |
(1 << S3C64XX_SROM_BCX__TCOH__SHIFT) |
(0xe << S3C64XX_SROM_BCX__TACC__SHIFT) |
(4 << S3C64XX_SROM_BCX__TCOS__SHIFT) |
(0 << S3C64XX_SROM_BCX__TACS__SHIFT), S3C64XX_SROM_BC1);

gpio_request(S3C64XX_GPN(5), "LCD power");
gpio_request(S3C64XX_GPF(13), "LCD power");
gpio_request(S3C64XX_GPF(15), "LCD power");
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/arm/plat-s3c/include/plat/devs.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ extern struct platform_device s3c64xx_device_iis0;
extern struct platform_device s3c64xx_device_iis1;
extern struct platform_device s3c64xx_device_iisv4;

extern struct platform_device s3c64xx_device_spi0;
extern struct platform_device s3c64xx_device_spi1;

extern struct platform_device s3c64xx_device_pcm0;
extern struct platform_device s3c64xx_device_pcm1;

Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/arm/plat-s3c/include/plat/regs-adc.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
#define S3C2410_ADCDLY S3C2410_ADCREG(0x08)
#define S3C2410_ADCDAT0 S3C2410_ADCREG(0x0C)
#define S3C2410_ADCDAT1 S3C2410_ADCREG(0x10)
#define S3C64XX_ADCUPDN S3C2410_ADCREG(0x14)
#define S3C64XX_ADCCLRINT S3C2410_ADCREG(0x18)
#define S3C64XX_ADCCLRINTPNDNUP S3C2410_ADCREG(0x20)


/* ADCCON Register Bits */
Expand Down
7 changes: 0 additions & 7 deletions trunk/arch/arm/plat-s3c24xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ config S3C2410_DMA_DEBUG
Enable debugging output for the DMA code. This option sends info
to the kernel log, at priority KERN_DEBUG.

config S3C24XX_ADC
bool "ADC common driver support"
help
Core support for the ADC block found in the S3C24XX SoC systems
for drivers such as the touchscreen and hwmon to use to share
this resource.

# SPI default pin configuration code

config S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13
Expand Down
1 change: 0 additions & 1 deletion trunk/arch/arm/plat-s3c24xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ obj-$(CONFIG_PM) += irq-pm.o
obj-$(CONFIG_PM) += sleep.o
obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o
obj-$(CONFIG_S3C2410_DMA) += dma.o
obj-$(CONFIG_S3C24XX_ADC) += adc.o
obj-$(CONFIG_S3C2410_IOTIMING) += s3c2410-iotiming.o
obj-$(CONFIG_S3C2412_IOTIMING) += s3c2412-iotiming.o
obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += s3c2410-cpufreq-utils.o
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/arm/plat-s3c64xx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ obj- :=
# Core files

obj-y += dev-uart.o
obj-y += dev-rtc.o
obj-y += cpu.o
obj-y += irq.o
obj-y += irq-eint.o
Expand All @@ -35,10 +36,15 @@ obj-$(CONFIG_PM) += irq-pm.o

obj-$(CONFIG_S3C64XX_DMA) += dma.o

# ADC support

obj-$(CONFIG_S3C_ADC) += dev-adc.o

# Device setup

obj-$(CONFIG_S3C64XX_SETUP_I2C0) += setup-i2c0.o
obj-$(CONFIG_S3C64XX_SETUP_I2C1) += setup-i2c1.o
obj-$(CONFIG_S3C64XX_SETUP_FB_24BPP) += setup-fb-24bpp.o
obj-$(CONFIG_S3C64XX_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
obj-$(CONFIG_SND_S3C24XX_SOC) += dev-audio.o
obj-$(CONFIG_SPI_S3C64XX) += dev-spi.o
12 changes: 12 additions & 0 deletions trunk/arch/arm/plat-s3c64xx/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ static struct clk init_clocks_disable[] = {
.parent = &clk_p,
.enable = s3c64xx_pclk_ctrl,
.ctrlbit = S3C_CLKCON_PCLK_SPI1,
}, {
.name = "spi_48m",
.id = 0,
.parent = &clk_48m,
.enable = s3c64xx_sclk_ctrl,
.ctrlbit = S3C_CLKCON_SCLK_SPI0_48,
}, {
.name = "spi_48m",
.id = 1,
.parent = &clk_48m,
.enable = s3c64xx_sclk_ctrl,
.ctrlbit = S3C_CLKCON_SCLK_SPI1_48,
}, {
.name = "48m",
.id = 0,
Expand Down
5 changes: 5 additions & 0 deletions trunk/arch/arm/plat-s3c64xx/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ static struct map_desc s3c_iodesc[] __initdata = {
.pfn = __phys_to_pfn(S3C64XX_PA_SYSCON),
.length = SZ_4K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)S3C_VA_MEM,
.pfn = __phys_to_pfn(S3C64XX_PA_SROM),
.length = SZ_4K,
.type = MT_DEVICE,
}, {
.virtual = (unsigned long)(S3C_VA_UART + UART_OFFS),
.pfn = __phys_to_pfn(S3C_PA_UART),
Expand Down
46 changes: 46 additions & 0 deletions trunk/arch/arm/plat-s3c64xx/dev-adc.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* linux/arch/arm/plat-s3c64xx/dev-adc.c
*
* Copyright 2010 Maurus Cuelenaere
*
* S3C64xx series device definition for ADC device
*
* 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/string.h>
#include <linux/platform_device.h>

#include <mach/irqs.h>
#include <mach/map.h>

#include <plat/adc.h>
#include <plat/devs.h>
#include <plat/cpu.h>

static struct resource s3c_adc_resource[] = {
[0] = {
.start = S3C64XX_PA_ADC,
.end = S3C64XX_PA_ADC + SZ_256 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = IRQ_TC,
.end = IRQ_TC,
.flags = IORESOURCE_IRQ,
},
[2] = {
.start = IRQ_ADC,
.end = IRQ_ADC,
.flags = IORESOURCE_IRQ,
},
};

struct platform_device s3c_device_adc = {
.name = "s3c64xx-adc",
.id = -1,
.num_resources = ARRAY_SIZE(s3c_adc_resource),
.resource = s3c_adc_resource,
};
Loading

0 comments on commit 58b3785

Please sign in to comment.