Add SPI Support on Exynos4
Subsystems (3)
PATCH v4 1/1 Add SPI Support on Exynos4
This patch adds SPI support and register the SPI bus clock with clkdev using generic connection ID on EXYNOS4. This patch is dependent on
[PATCH 1/6] ARM: SAMSUNG: Consolidation of SPI platform devices to plat-samsung
V2 Changes:
Reworked the patches as per the following link. Patch series in the following link removed & and , from the macro declaration and added in the macro defination.
http://www.spinics.net/lists/arm-kernel/msg143663.html
V4 Changes:
Rebased on latest for-next branch. Reworked the patche based on SPI platform device consolidation.This patchset is dependent on the following patch. [PATCH 1/5] ARM: SAMSUNG: Consolidation of SPI platform devices to plat-samsung.
Padmavathi Venna (1):
ARM: EXYNOS4: Add SPI support
arch/arm/mach-exynos4/Kconfig | 5 ++ arch/arm/mach-exynos4/Makefile | 1 + arch/arm/mach-exynos4/clock.c | 72 +++++++++++++--------- arch/arm/mach-exynos4/include/mach/irqs.h | 3 + arch/arm/mach-exynos4/include/mach/map.h | 6 ++ arch/arm/mach-exynos4/include/mach/spi-clocks.h | 16 +++++ arch/arm/mach-exynos4/mach-smdkv310.c | 35 +++++++++++ arch/arm/mach-exynos4/setup-spi.c | 47 +++++++++++++++ 8 files changed, 155 insertions(+), 30 deletions(-) create mode 100644 arch/arm/mach-exynos4/include/mach/spi-clocks.h create mode 100644 arch/arm/mach-exynos4/setup-spi.c
PATCH 1/1 ARM: EXYNOS4: Add SPI support
Add SPI setup files for GPIO configurations.
Add SPI clkdev support.
Initialize SPI platform specific code in the machine file.
--- arch/arm/mach-exynos4/Kconfig | 5 ++ arch/arm/mach-exynos4/Makefile | 1 + arch/arm/mach-exynos4/clock.c | 72 +++++++++++++--------- arch/arm/mach-exynos4/include/mach/irqs.h | 3 + arch/arm/mach-exynos4/include/mach/map.h | 6 ++ arch/arm/mach-exynos4/include/mach/spi-clocks.h | 16 +++++ arch/arm/mach-exynos4/mach-smdkv310.c | 35 +++++++++++ arch/arm/mach-exynos4/setup-spi.c | 47 +++++++++++++++ 8 files changed, 155 insertions(+), 30 deletions(-) create mode 100644 arch/arm/mach-exynos4/include/mach/spi-clocks.h create mode 100644 arch/arm/mach-exynos4/setup-spi.c
arch/arm/mach-exynos4/Kconfig +5 -0
@@ -127,6 +127,11 @@ config EXYNOS4_SETUP_USB_PHY help Common setup code for USB PHY controller +config EXYNOS4_SETUP_SPI + bool + help + Common setup code for SPI GPIO configurations. + # machine support menu "EXYNOS4 Machines"
arch/arm/mach-exynos4/Makefile +1 -0
@@ -59,5 +59,6 @@ obj-$(CONFIG_EXYNOS4_SETUP_I2C6) += setup-i2c6.o obj-$(CONFIG_EXYNOS4_SETUP_I2C7) += setup-i2c7.o obj-$(CONFIG_EXYNOS4_SETUP_KEYPAD) += setup-keypad.o obj-$(CONFIG_EXYNOS4_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o +obj-$(CONFIG_EXYNOS4_SETUP_SPI) += setup-spi.o obj-$(CONFIG_EXYNOS4_SETUP_USB_PHY) += setup-usb-phy.o
arch/arm/mach-exynos4/clock.c +42 -30
96 lines not on this page · raw message
arch/arm/mach-exynos4/include/mach/irqs.h +3 -0
@@ -72,6 +72,9 @@#define IRQ_IIC5 IRQ_SPI(63)#define IRQ_IIC6 IRQ_SPI(64)#define IRQ_IIC7 IRQ_SPI(65) +#define IRQ_SPI0 IRQ_SPI(66) +#define IRQ_SPI1 IRQ_SPI(67) +#define IRQ_SPI2 IRQ_SPI(68)#define IRQ_USB_HOST IRQ_SPI(70)#define IRQ_USB_HSOTG IRQ_SPI(71)
arch/arm/mach-exynos4/include/mach/map.h +6 -0
@@ -87,6 +87,9 @@#define EXYNOS4_PA_SYSMMU_TV 0x12E20000#define EXYNOS4_PA_SYSMMU_MFC_L 0x13620000#define EXYNOS4_PA_SYSMMU_MFC_R 0x13630000 +#define EXYNOS4_PA_SPI0 0x13920000 +#define EXYNOS4_PA_SPI1 0x13930000 +#define EXYNOS4_PA_SPI2 0x13940000#define EXYNOS4_PA_GPIO1 0x11400000#define EXYNOS4_PA_GPIO2 0x11000000
@@ -149,6 +152,9 @@#define SAMSUNG_PA_ADC1 EXYNOS4_PA_ADC1#define S3C_PA_RTC EXYNOS4_PA_RTC#define S3C_PA_WDT EXYNOS4_PA_WATCHDOG +#define S3C_PA_SPI0 EXYNOS4_PA_SPI0 +#define S3C_PA_SPI1 EXYNOS4_PA_SPI1 +#define S3C_PA_SPI2 EXYNOS4_PA_SPI2#define S5P_PA_CHIPID EXYNOS4_PA_CHIPID#define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0
arch/arm/mach-exynos4/include/mach/spi-clocks.h new file +16 -0
@@ -0,0 +1,16 @@ +/* linux/arch/arm/mach-exynos4/include/mach/spi-clocks.h +* +* Copyright (C) 2011 Samsung Electronics Co. Ltd. +* +* 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_SPI_CLKS_H +#define __ASM_ARCH_SPI_CLKS_H __FILE__ + +/* Must source from SCLK_SPI */ +#define EXYNOS4_SPI_SRCCLK_SCLK 0 + +#endif /* __ASM_ARCH_SPI_CLKS_H */
arch/arm/mach-exynos4/mach-smdkv310.c +35 -0
@@ -40,6 +40,7 @@#include <plat/mfc.h> #include <plat/ehci.h> #include <plat/clock.h> +#include <plat/s3c64xx-spi.h> #include <mach/map.h>
@@ -235,6 +236,40 @@ static struct i2c_board_info i2c_devs1[] __initdata = { {I2C_BOARD_INFO("wm8994", 0x1a),}, }; +#ifdef CONFIG_S3C64XX_DEV_SPI0 +static struct s3c64xx_spi_info smdkv310_spi0_pdata__initdata = { + .cfg_gpio = s3c64xx_spi0_cfg_gpio, + .fifo_lvl_mask =0x1ff , + .rx_lvl_offset =15 , + .high_speed =1 , + .clk_from_cmu = true, + .tx_st_done =25 , +}; +#endif + +#ifdef CONFIG_S3C64XX_DEV_SPI1 +static struct s3c64xx_spi_info smdkv310_spi1_pdata__initdata = { + .cfg_gpio = s3c64xx_spi1_cfg_gpio, + .fifo_lvl_mask =0x7f , + .rx_lvl_offset =15 , + .high_speed =1 , + .clk_from_cmu = true, + .tx_st_done =25 , +}; +#endif + +#ifdef CONFIG_S3C64XX_DEV_SPI2 +static struct s3c64xx_spi_info smdkv310_spi2_pdata__initdata = { + .cfg_gpio = s3c64xx_spi2_cfg_gpio, + .fifo_lvl_mask =0x7f , + .rx_lvl_offset =15 , + .high_speed =1 , + .clk_from_cmu = true, + .tx_st_done =25 , +}; +#endif + +/* USB EHCI */ static struct s5p_ehci_platdata smdkv310_ehci_pdata;
arch/arm/mach-exynos4/setup-spi.c new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 1/1 ARM: EXYNOS4: Add SPI support
Quoted 6 lines · Padmavathi Venna
Add SPI setup files for GPIO configurations.
Add SPI clkdev support.
Initialize SPI platform specific code in the machine file.Signed-off-by Padmavathi Venna <[email protected]>
Quoted 14 lines
--- arch/arm/mach-exynos4/Kconfig | 5 ++ arch/arm/mach-exynos4/Makefile | 1 + arch/arm/mach-exynos4/clock.c | 72 +++++++++++++----- ---- arch/arm/mach-exynos4/include/mach/irqs.h | 3 + arch/arm/mach-exynos4/include/mach/map.h | 6 ++ arch/arm/mach-exynos4/include/mach/spi-clocks.h | 16 +++++ arch/arm/mach-exynos4/mach-smdkv310.c | 35 +++++++++++ arch/arm/mach-exynos4/setup-spi.c | 47 +++++++++++++++ 8 files changed, 155 insertions(+), 30 deletions(-) create mode 100644 arch/arm/mach-exynos4/include/mach/spi-clocks.h create mode 100644 arch/arm/mach-exynos4/setup-spi.c
The mach-exynos4 directory will be re-organized in this merge window. So maybe you need to wait for v3.2-rc1.
And I will be on this after that :)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.