Skip to content

Commit

Permalink
Merge branch 'next/devel-samsung' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/kgene/linux-samsung into next/soc2

From Kukjin Kim:

This includes supporting legacy i2c controller and ARM down clock
support for exynos5 and small changes.

[olof: It contains a dependency on samsung/hdmi for HDMI DT bindings, for some reason.]

* 'next/devel-samsung' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung:
  ARM: EXYNOS: Clock settings for SATA and SATA PHY
  ARM: EXYNOS: Add ARM down clock support
  ARM: EXYNOS: Fix i2c suspend/resume for legacy controller
  ARM: EXYNOS: Add aliases for i2c controller
  ARM: EXYNOS: Setup legacy i2c controller interrupts
  ARM: EXYNOS: removing exynos-drm device registration from non-dt platforms
  ARM: EXYNOS: add clocks for exynos5 hdmi
  ARM: dts: add device tree support for exynos5 hdmiddc
  ARM: dts: add device tree support for exynos5 hdmiphy
  ARM: dts: add device tree support for exynos5 mixer
  ARM: dts: add device tree support for exynos5 hdmi
  ARM: EXYNOS: Add dp clock support for EXYNOS5
  ARM: SAMSUNG: call clk_get_rate for debugfs rate files
  ARM: SAMSUNG: add clock_tree debugfs file in clock

Signed-off-by: Olof Johansson <olof@lixom.net>
  • Loading branch information
Olof Johansson committed Nov 21, 2012
2 parents 97b129b + b8edec0 commit 1f1ba83
Show file tree
Hide file tree
Showing 21 changed files with 329 additions and 63 deletions.
22 changes: 22 additions & 0 deletions Documentation/devicetree/bindings/drm/exynos/hdmi.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Device-Tree bindings for drm hdmi driver

Required properties:
- compatible: value should be "samsung,exynos5-hdmi".
- reg: physical base address of the hdmi and length of memory mapped
region.
- interrupts: interrupt number to the cpu.
- hpd-gpio: following information about the hotplug gpio pin.
a) phandle of the gpio controller node.
b) pin number within the gpio controller.
c) pin function mode.
d) optional flags and pull up/down.
e) drive strength.

Example:

hdmi {
compatible = "samsung,exynos5-hdmi";
reg = <0x14530000 0x100000>;
interrupts = <0 95 0>;
hpd-gpio = <&gpx3 7 0xf 1 3>;
};
12 changes: 12 additions & 0 deletions Documentation/devicetree/bindings/drm/exynos/hdmiddc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Device-Tree bindings for hdmiddc driver

Required properties:
- compatible: value should be "samsung,exynos5-hdmiddc".
- reg: I2C address of the hdmiddc device.

Example:

hdmiddc {
compatible = "samsung,exynos5-hdmiddc";
reg = <0x50>;
};
12 changes: 12 additions & 0 deletions Documentation/devicetree/bindings/drm/exynos/hdmiphy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Device-Tree bindings for hdmiphy driver

Required properties:
- compatible: value should be "samsung,exynos5-hdmiphy".
- reg: I2C address of the hdmiphy device.

Example:

hdmiphy {
compatible = "samsung,exynos5-hdmiphy";
reg = <0x38>;
};
15 changes: 15 additions & 0 deletions Documentation/devicetree/bindings/drm/exynos/mixer.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Device-Tree bindings for mixer driver

Required properties:
- compatible: value should be "samsung,exynos5-mixer".
- reg: physical base address of the mixer and length of memory mapped
region.
- interrupts: interrupt number to the cpu.

Example:

mixer {
compatible = "samsung,exynos5-mixer";
reg = <0x14450000 0x10000>;
interrupts = <0 94 0>;
};
24 changes: 23 additions & 1 deletion arch/arm/boot/dts/exynos5250-smdk5250.dts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,15 @@
};

i2c@12C80000 {
status = "disabled";
samsung,i2c-sda-delay = <100>;
samsung,i2c-max-bus-freq = <66000>;
gpios = <&gpa0 6 3 3 0>,
<&gpa0 7 3 3 0>;

hdmiddc@50 {
compatible = "samsung,exynos5-hdmiddc";
reg = <0x50>;
};
};

i2c@12C90000 {
Expand All @@ -79,6 +87,16 @@
status = "disabled";
};

i2c@12CE0000 {
samsung,i2c-sda-delay = <100>;
samsung,i2c-max-bus-freq = <66000>;

hdmiphy@38 {
compatible = "samsung,exynos5-hdmiphy";
reg = <0x38>;
};
};

dwmmc_0: dwmmc0@12200000 {
num-slots = <1>;
supports-highspeed;
Expand Down Expand Up @@ -166,4 +184,8 @@
spi_2: spi@12d40000 {
status = "disabled";
};

hdmi {
hpd-gpio = <&gpx3 7 0xf 1 3>;
};
};
45 changes: 37 additions & 8 deletions arch/arm/boot/dts/exynos5250.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
gsc1 = &gsc_1;
gsc2 = &gsc_2;
gsc3 = &gsc_3;
i2c0 = &i2c_0;
i2c1 = &i2c_1;
i2c2 = &i2c_2;
i2c3 = &i2c_3;
i2c4 = &i2c_4;
i2c5 = &i2c_5;
i2c6 = &i2c_6;
i2c7 = &i2c_7;
i2c8 = &i2c_8;
};

gic:interrupt-controller@10481000 {
Expand Down Expand Up @@ -92,70 +101,78 @@
interrupts = <0 54 0>;
};

i2c@12C60000 {
i2c_0: i2c@12C60000 {
compatible = "samsung,s3c2440-i2c";
reg = <0x12C60000 0x100>;
interrupts = <0 56 0>;
#address-cells = <1>;
#size-cells = <0>;
};

i2c@12C70000 {
i2c_1: i2c@12C70000 {
compatible = "samsung,s3c2440-i2c";
reg = <0x12C70000 0x100>;
interrupts = <0 57 0>;
#address-cells = <1>;
#size-cells = <0>;
};

i2c@12C80000 {
i2c_2: i2c@12C80000 {
compatible = "samsung,s3c2440-i2c";
reg = <0x12C80000 0x100>;
interrupts = <0 58 0>;
#address-cells = <1>;
#size-cells = <0>;
};

i2c@12C90000 {
i2c_3: i2c@12C90000 {
compatible = "samsung,s3c2440-i2c";
reg = <0x12C90000 0x100>;
interrupts = <0 59 0>;
#address-cells = <1>;
#size-cells = <0>;
};

i2c@12CA0000 {
i2c_4: i2c@12CA0000 {
compatible = "samsung,s3c2440-i2c";
reg = <0x12CA0000 0x100>;
interrupts = <0 60 0>;
#address-cells = <1>;
#size-cells = <0>;
};

i2c@12CB0000 {
i2c_5: i2c@12CB0000 {
compatible = "samsung,s3c2440-i2c";
reg = <0x12CB0000 0x100>;
interrupts = <0 61 0>;
#address-cells = <1>;
#size-cells = <0>;
};

i2c@12CC0000 {
i2c_6: i2c@12CC0000 {
compatible = "samsung,s3c2440-i2c";
reg = <0x12CC0000 0x100>;
interrupts = <0 62 0>;
#address-cells = <1>;
#size-cells = <0>;
};

i2c@12CD0000 {
i2c_7: i2c@12CD0000 {
compatible = "samsung,s3c2440-i2c";
reg = <0x12CD0000 0x100>;
interrupts = <0 63 0>;
#address-cells = <1>;
#size-cells = <0>;
};

i2c_8: i2c@12CE0000 {
compatible = "samsung,s3c2440-hdmiphy-i2c";
reg = <0x12CE0000 0x1000>;
interrupts = <0 64 0>;
#address-cells = <1>;
#size-cells = <0>;
};

spi_0: spi@12d20000 {
compatible = "samsung,exynos4210-spi";
reg = <0x12d20000 0x100>;
Expand Down Expand Up @@ -520,4 +537,16 @@
reg = <0x13e30000 0x1000>;
interrupts = <0 88 0>;
};

hdmi {
compatible = "samsung,exynos5-hdmi";
reg = <0x14530000 0x100000>;
interrupts = <0 95 0>;
};

mixer {
compatible = "samsung,exynos5-mixer";
reg = <0x14450000 0x10000>;
interrupts = <0 94 0>;
};
};
1 change: 0 additions & 1 deletion arch/arm/mach-exynos/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ obj-$(CONFIG_EXYNOS4_DEV_AHCI) += dev-ahci.o
obj-$(CONFIG_EXYNOS4_DEV_DWMCI) += dev-dwmci.o
obj-$(CONFIG_EXYNOS_DEV_DMA) += dma.o
obj-$(CONFIG_EXYNOS4_DEV_USB_OHCI) += dev-ohci.o
obj-$(CONFIG_EXYNOS_DEV_DRM) += dev-drm.o
obj-$(CONFIG_EXYNOS_DEV_SYSMMU) += dev-sysmmu.o

obj-$(CONFIG_ARCH_EXYNOS) += setup-i2c0.o
Expand Down
42 changes: 37 additions & 5 deletions arch/arm/mach-exynos/clock-exynos5.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ static struct sleep_save exynos5_clock_save[] = {
SAVE_ITEM(EXYNOS5_VPLL_CON0),
SAVE_ITEM(EXYNOS5_VPLL_CON1),
SAVE_ITEM(EXYNOS5_VPLL_CON2),
SAVE_ITEM(EXYNOS5_PWR_CTRL1),
SAVE_ITEM(EXYNOS5_PWR_CTRL2),
};
#endif

Expand Down Expand Up @@ -196,6 +198,11 @@ static int exynos5_clk_ip_isp1_ctrl(struct clk *clk, int enable)
return s5p_gatectrl(EXYNOS5_CLKGATE_IP_ISP1, clk, enable);
}

static int exynos5_clk_hdmiphy_ctrl(struct clk *clk, int enable)
{
return s5p_gatectrl(S5P_HDMI_PHY_CONTROL, clk, enable);
}

/* Core list of CMU_CPU side */

static struct clksrc_clk exynos5_clk_mout_apll = {
Expand Down Expand Up @@ -651,15 +658,20 @@ static struct clk exynos5_init_clocks_off[] = {
.ctrlbit = (1 << 15),
}, {
.name = "sata",
.devname = "ahci",
.devname = "exynos5-sata",
.parent = &exynos5_clk_aclk_200.clk,
.enable = exynos5_clk_ip_fsys_ctrl,
.ctrlbit = (1 << 6),
}, {
.name = "sata_phy",
.name = "sata-phy",
.devname = "exynos5-sata-phy",
.parent = &exynos5_clk_aclk_200.clk,
.enable = exynos5_clk_ip_fsys_ctrl,
.ctrlbit = (1 << 24),
}, {
.name = "sata_phy_i2c",
.name = "i2c",
.devname = "exynos5-sata-phy-i2c",
.parent = &exynos5_clk_aclk_200.clk,
.enable = exynos5_clk_ip_fsys_ctrl,
.ctrlbit = (1 << 25),
}, {
Expand All @@ -669,14 +681,24 @@ static struct clk exynos5_init_clocks_off[] = {
.ctrlbit = (1 << 0),
}, {
.name = "hdmi",
.devname = "exynos4-hdmi",
.devname = "exynos5-hdmi",
.enable = exynos5_clk_ip_disp1_ctrl,
.ctrlbit = (1 << 6),
}, {
.name = "hdmiphy",
.devname = "exynos5-hdmi",
.enable = exynos5_clk_hdmiphy_ctrl,
.ctrlbit = (1 << 0),
}, {
.name = "mixer",
.devname = "s5p-mixer",
.devname = "exynos5-mixer",
.enable = exynos5_clk_ip_disp1_ctrl,
.ctrlbit = (1 << 5),
}, {
.name = "dp",
.devname = "exynos-dp",
.enable = exynos5_clk_ip_disp1_ctrl,
.ctrlbit = (1 << 4),
}, {
.name = "jpeg",
.enable = exynos5_clk_ip_gen_ctrl,
Expand Down Expand Up @@ -1224,6 +1246,16 @@ static struct clksrc_clk exynos5_clksrcs[] = {
.sources = &exynos5_clkset_aclk,
.reg_src = { .reg = EXYNOS5_CLKSRC_TOP0, .shift = 20, .size = 1 },
.reg_div = { .reg = EXYNOS5_CLKDIV_TOP0, .shift = 24, .size = 3 },
}, {
.clk = {
.name = "sclk_sata",
.devname = "exynos5-sata",
.enable = exynos5_clksrc_mask_fsys_ctrl,
.ctrlbit = (1 << 24),
},
.sources = &exynos5_clkset_aclk,
.reg_src = { .reg = EXYNOS5_CLKSRC_FSYS, .shift = 24, .size = 1 },
.reg_div = { .reg = EXYNOS5_CLKDIV_FSYS0, .shift = 20, .size = 4 },
}, {
.clk = {
.name = "sclk_gscl_wrap",
Expand Down
36 changes: 36 additions & 0 deletions arch/arm/mach-exynos/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <asm/suspend.h>
#include <asm/unified.h>
#include <asm/cpuidle.h>
#include <mach/regs-clock.h>
#include <mach/regs-pmu.h>
#include <mach/pmu.h>

Expand Down Expand Up @@ -156,12 +157,47 @@ static int exynos4_enter_lowpower(struct cpuidle_device *dev,
return exynos4_enter_core0_aftr(dev, drv, new_index);
}

static void __init exynos5_core_down_clk(void)
{
unsigned int tmp;

/*
* Enable arm clock down (in idle) and set arm divider
* ratios in WFI/WFE state.
*/
tmp = PWR_CTRL1_CORE2_DOWN_RATIO | \
PWR_CTRL1_CORE1_DOWN_RATIO | \
PWR_CTRL1_DIV2_DOWN_EN | \
PWR_CTRL1_DIV1_DOWN_EN | \
PWR_CTRL1_USE_CORE1_WFE | \
PWR_CTRL1_USE_CORE0_WFE | \
PWR_CTRL1_USE_CORE1_WFI | \
PWR_CTRL1_USE_CORE0_WFI;
__raw_writel(tmp, EXYNOS5_PWR_CTRL1);

/*
* Enable arm clock up (on exiting idle). Set arm divider
* ratios when not in idle along with the standby duration
* ratios.
*/
tmp = PWR_CTRL2_DIV2_UP_EN | \
PWR_CTRL2_DIV1_UP_EN | \
PWR_CTRL2_DUR_STANDBY2_VAL | \
PWR_CTRL2_DUR_STANDBY1_VAL | \
PWR_CTRL2_CORE2_UP_RATIO | \
PWR_CTRL2_CORE1_UP_RATIO;
__raw_writel(tmp, EXYNOS5_PWR_CTRL2);
}

static int __init exynos4_init_cpuidle(void)
{
int i, max_cpuidle_state, cpu_id;
struct cpuidle_device *device;
struct cpuidle_driver *drv = &exynos4_idle_driver;

if (soc_is_exynos5250())
exynos5_core_down_clk();

/* Setup cpuidle driver */
drv->state_count = (sizeof(exynos4_cpuidle_set) /
sizeof(struct cpuidle_state));
Expand Down
Loading

0 comments on commit 1f1ba83

Please sign in to comment.