···8282CONFIG_INPUT_FF_MEMLESS=m8383# CONFIG_INPUT_MOUSEDEV_PSAUX is not set8484CONFIG_INPUT_EVDEV=y8585+CONFIG_KEYBOARD_GPIO=y8586CONFIG_INPUT_EVBUG=m8687CONFIG_MOUSE_PS2=m8788CONFIG_MOUSE_PS2_ELANTECH=y
···7878 local_fiq_disable();7979 setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/8080 flush_cache_all();8181+ outer_flush_all();8282+ outer_disable();8183 cpu_proc_fin();8484+ outer_inv_all();8285 flush_cache_all();8386 cpu_reset(reboot_code_buffer_phys);8487}
···143143config MACH_MX35_3DS144144 bool "Support MX35PDK platform"145145 select ARCH_MX35146146+ select MXC_DEBUG_BOARD146147 select IMX_HAVE_PLATFORM_IMX_UART147148 select IMX_HAVE_PLATFORM_MXC_NAND149149+ select IMX_HAVE_PLATFORM_ESDHC148150 default n149151 help150152 Include support for MX35PDK platform. This includes specific
···3838#include "devices-imx31.h"3939#include "devices.h"40404141-/* Definitions for components on the Debug board */4242-4343-/* Base address of CPLD controller on the Debug board */4444-#define DEBUG_BASE_ADDRESS CS5_IO_ADDRESS(MX3x_CS5_BASE_ADDR)4545-4646-/* LAN9217 ethernet base address */4747-#define LAN9217_BASE_ADDR MX3x_CS5_BASE_ADDR4848-4949-/* CPLD config and interrupt base address */5050-#define CPLD_ADDR (DEBUG_BASE_ADDRESS + 0x20000)5151-5252-/* status, interrupt */5353-#define CPLD_INT_STATUS_REG (CPLD_ADDR + 0x10)5454-#define CPLD_INT_MASK_REG (CPLD_ADDR + 0x38)5555-#define CPLD_INT_RESET_REG (CPLD_ADDR + 0x20)5656-/* magic word for debug CPLD */5757-#define CPLD_MAGIC_NUMBER1_REG (CPLD_ADDR + 0x40)5858-#define CPLD_MAGIC_NUMBER2_REG (CPLD_ADDR + 0x48)5959-/* CPLD code version */6060-#define CPLD_CODE_VER_REG (CPLD_ADDR + 0x50)6161-/* magic word for debug CPLD */6262-#define CPLD_MAGIC_NUMBER3_REG (CPLD_ADDR + 0x58)6363-6441/* CPLD IRQ line for external uart, external ethernet etc */6542#define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_1)6666-6767-#define MXC_EXP_IO_BASE (MXC_BOARD_IRQ_START)6868-#define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE)6969-7070-#define EXPIO_INT_ENET (MXC_EXP_IO_BASE + 0)7171-7272-#define MXC_MAX_EXP_IO_LINES 1673437444/*7545 * This file contains the board-specific initialization routines.···242272 imx31_add_imx_uart0(&uart_pdata);243273 imx31_add_mxc_nand(&mx31_3ds_nand_board_info);244274245245- imx31_add_spi_imx0(&spi1_pdata);275275+ imx31_add_spi_imx1(&spi1_pdata);246276 spi_register_board_info(mx31_3ds_spi_devs,247277 ARRAY_SIZE(mx31_3ds_spi_devs));248278···251281 mx31_3ds_usbotg_init();252282 mxc_register_device(&mxc_otg_udc_device, &usbotg_pdata);253283254254- if (!mxc_expio_init(CS5_BASE_ADDR, EXPIO_PARENT_INT))255255- printk(KERN_WARNING "Init of the debugboard failed, all "256256- "devices on the board are unusable.\n");284284+ if (mxc_expio_init(MX31_CS5_BASE_ADDR, EXPIO_PARENT_INT))285285+ printk(KERN_WARNING "Init of the debug board failed, all "286286+ "devices on the debug board are unusable.\n");257287}258288259289static void __init mx31_3ds_timer_init(void)
+16
arch/arm/mach-mx3/mach-mx35_3ds.c
···3838#include <mach/hardware.h>3939#include <mach/common.h>4040#include <mach/iomux-mx35.h>4141+#include <mach/irqs.h>4242+#include <mach/3ds_debugboard.h>4143#include <mach/mxc_ehci.h>42444345#include "devices-imx35.h"4446#include "devices.h"4747+4848+#define EXPIO_PARENT_INT (MXC_INTERNAL_IRQS + GPIO_PORTA + 1)45494650static const struct imxuart_platform_data uart_pdata __initconst = {4751 .flags = IMXUART_HAVE_RTSCTS,···112108 /* USBH1 */113109 MX35_PAD_I2C2_CLK__USB_TOP_USBH2_PWR,114110 MX35_PAD_I2C2_DAT__USB_TOP_USBH2_OC,111111+ /* SDCARD */112112+ MX35_PAD_SD1_CMD__ESDHC1_CMD,113113+ MX35_PAD_SD1_CLK__ESDHC1_CLK,114114+ MX35_PAD_SD1_DATA0__ESDHC1_DAT0,115115+ MX35_PAD_SD1_DATA1__ESDHC1_DAT1,116116+ MX35_PAD_SD1_DATA2__ESDHC1_DAT2,117117+ MX35_PAD_SD1_DATA3__ESDHC1_DAT3,115118};116119117120/* OTG config */···151140 mxc_register_device(&mxc_usbh1, &usb_host_pdata);152141153142 imx35_add_mxc_nand(&mx35pdk_nand_board_info);143143+ imx35_add_esdhc(0, NULL);144144+145145+ if (mxc_expio_init(MX35_CS5_BASE_ADDR, EXPIO_PARENT_INT))146146+ pr_warn("Init of the debugboard failed, all "147147+ "devices on the debugboard are unusable.\n");154148}155149156150static void __init mx35pdk_timer_init(void)
+2
arch/arm/mach-mx5/Kconfig
···66 select MXC_TZIC77 select ARCH_MXC_IOMUX_V388 select ARCH_MXC_AUDMUX_V299+ select ARCH_HAS_CPUFREQ9101011comment "MX5 platforms:"1112···1413 bool "Support MX51 BABBAGE platforms"1514 select IMX_HAVE_PLATFORM_IMX_I2C1615 select IMX_HAVE_PLATFORM_IMX_UART1616+ select IMX_HAVE_PLATFORM_ESDHC1717 help1818 Include support for MX51 Babbage platform, also known as MX51EVK in1919 u-boot. This includes specific configurations for the board and its
···11+/*22+ * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.33+ */44+55+/*66+ * The code contained herein is licensed under the GNU General Public77+ * License. You may obtain a copy of the GNU General Public License88+ * Version 2 or later at the following locations:99+ *1010+ * http://www.opensource.org/licenses/gpl-license.html1111+ * http://www.gnu.org/copyleft/gpl.html1212+ */1313+1414+#include <linux/types.h>1515+#include <mach/hardware.h>1616+#include <linux/kernel.h>1717+1818+static struct cpu_op mx51_cpu_op[] = {1919+ {2020+ .cpu_rate = 160000000,},2121+ {2222+ .cpu_rate = 800000000,},2323+};2424+2525+struct cpu_op *mx51_get_cpu_op(int *op)2626+{2727+ *op = ARRAY_SIZE(mx51_cpu_op);2828+ return mx51_cpu_op;2929+}
+14
arch/arm/mach-mx5/cpu_op-mx51.h
···11+/*22+ * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.33+ */44+55+/*66+ * The code contained herein is licensed under the GNU General Public77+ * License. You may obtain a copy of the GNU General Public License88+ * Version 2 or later at the following locations:99+ *1010+ * http://www.opensource.org/licenses/gpl-license.html1111+ * http://www.gnu.org/copyleft/gpl.html1212+ */1313+1414+extern struct cpu_op *mx51_get_cpu_op(int *op);
···5151#include <plat/clock.h>5252#include <plat/pm.h>5353#include <plat/pll.h>5454+#include <plat/nand-core.h>54555556#ifndef CONFIG_CPU_S3C2412_ONLY5657void __iomem *s3c24xx_va_gpio2 = S3C24XX_VA_GPIO;···9392 /* rename devices that are s3c2412/s3c2413 specific */9493 s3c_device_sdi.name = "s3c2412-sdi";9594 s3c_device_lcd.name = "s3c2412-lcd";9696- s3c_device_nand.name = "s3c2412-nand";9595+ s3c_nand_setname("s3c2412-nand");97969897 /* alter IRQ of SDI controller */9998
+6
arch/arm/mach-s3c2416/Kconfig
···2525 help2626 Internal config node for S3C2416 DMA support27272828+config S3C2416_PM2929+ bool3030+ help3131+ Internal config node to apply S3C2416 power management3232+2833menu "S3C2416 Machines"29343035config MACH_SMDK2416···3833 select S3C_DEV_FB3934 select S3C_DEV_HSMMC4035 select S3C_DEV_HSMMC13636+ select S3C2416_PM if PM4137 help4238 Say Y here if you are using an SMDK24164339
···11+/* linux/arch/arm/mach-s3c2416/pm.c22+ *33+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.44+ * http://www.samsung.com55+ *66+ * S3C2416 - PM support (Based on Ben Dooks' S3C2412 PM support)77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+*/1212+1313+#include <linux/sysdev.h>1414+#include <linux/io.h>1515+1616+#include <asm/cacheflush.h>1717+1818+#include <mach/regs-power.h>1919+#include <mach/regs-s3c2443-clock.h>2020+2121+#include <plat/cpu.h>2222+#include <plat/pm.h>2323+2424+extern void s3c2412_sleep_enter(void);2525+2626+static void s3c2416_cpu_suspend(void)2727+{2828+ flush_cache_all();2929+3030+ /* enable wakeup sources regardless of battery state */3131+ __raw_writel(S3C2443_PWRCFG_SLEEP, S3C2443_PWRCFG);3232+3333+ /* set the mode as sleep, 2BED represents "Go to BED" */3434+ __raw_writel(0x2BED, S3C2443_PWRMODE);3535+3636+ s3c2412_sleep_enter();3737+}3838+3939+static void s3c2416_pm_prepare(void)4040+{4141+ /*4242+ * write the magic value u-boot uses to check for resume into4343+ * the INFORM0 register, and ensure INFORM1 is set to the4444+ * correct address to resume from.4545+ */4646+ __raw_writel(0x2BED, S3C2412_INFORM0);4747+ __raw_writel(virt_to_phys(s3c_cpu_resume), S3C2412_INFORM1);4848+}4949+5050+static int s3c2416_pm_add(struct sys_device *sysdev)5151+{5252+ pm_cpu_prep = s3c2416_pm_prepare;5353+ pm_cpu_sleep = s3c2416_cpu_suspend;5454+5555+ return 0;5656+}5757+5858+static int s3c2416_pm_suspend(struct sys_device *dev, pm_message_t state)5959+{6060+ return 0;6161+}6262+6363+static int s3c2416_pm_resume(struct sys_device *dev)6464+{6565+ /* unset the return-from-sleep amd inform flags */6666+ __raw_writel(0x0, S3C2443_PWRMODE);6767+ __raw_writel(0x0, S3C2412_INFORM0);6868+ __raw_writel(0x0, S3C2412_INFORM1);6969+7070+ return 0;7171+}7272+7373+static struct sysdev_driver s3c2416_pm_driver = {7474+ .add = s3c2416_pm_add,7575+ .suspend = s3c2416_pm_suspend,7676+ .resume = s3c2416_pm_resume,7777+};7878+7979+static __init int s3c2416_pm_init(void)8080+{8181+ return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_pm_driver);8282+}8383+8484+arch_initcall(s3c2416_pm_init);
···1717#include <mach/map.h>1818#include <mach/regs-clock.h>1919#include <plat/gpio-cfg.h>2020+#include <plat/ata.h>20212122void s3c64xx_ide_setup_gpio(void)2223{2324 u32 reg;2424- u32 gpio = 0;25252626 reg = readl(S3C_MEM_SYS_CFG) & (~0x3f);2727···3232 s3c_gpio_cfgpin(S3C64XX_GPB(4), S3C_GPIO_SFN(4));33333434 /* Set XhiDATA[15:0] pins as CF Data[15:0] */3535- for (gpio = S3C64XX_GPK(0); gpio <= S3C64XX_GPK(15); gpio++)3636- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(5));3535+ s3c_gpio_cfgpin_range(S3C64XX_GPK(0), 16, S3C_GPIO_SFN(5));37363837 /* Set XhiADDR[2:0] pins as CF ADDR[2:0] */3939- for (gpio = S3C64XX_GPL(0); gpio <= S3C64XX_GPL(2); gpio++)4040- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(6));3838+ s3c_gpio_cfgpin_range(S3C64XX_GPL(0), 3, S3C_GPIO_SFN(6));41394240 /* Set Xhi ctrl pins as CF ctrl pins(IORDY, IOWR, IORD, CE[0:1]) */4341 s3c_gpio_cfgpin(S3C64XX_GPM(5), S3C_GPIO_SFN(1));4444- for (gpio = S3C64XX_GPM(0); gpio <= S3C64XX_GPM(4); gpio++)4545- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(6));4242+ s3c_gpio_cfgpin_range(S3C64XX_GPM(0), 5, S3C_GPIO_SFN(6));4643}
+3-13
arch/arm/mach-s3c64xx/setup-keypad.c
···12121313#include <linux/gpio.h>1414#include <plat/gpio-cfg.h>1515+#include <plat/keypad.h>15161617void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)1718{1818- unsigned int gpio;1919- unsigned int end;2020-2119 /* Set all the necessary GPK pins to special-function 3: KP_ROW[x] */2222- end = S3C64XX_GPK(8 + rows);2323- for (gpio = S3C64XX_GPK(8); gpio < end; gpio++) {2424- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));2525- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);2626- }2020+ s3c_gpio_cfgrange_nopull(S3C64XX_GPK(8), 8 + rows, S3C_GPIO_SFN(3));27212822 /* Set all the necessary GPL pins to special-function 3: KP_COL[x] */2929- end = S3C64XX_GPL(0 + cols);3030- for (gpio = S3C64XX_GPL(0); gpio < end; gpio++) {3131- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));3232- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);3333- }2323+ s3c_gpio_cfgrange_nopull(S3C64XX_GPL(0), cols, S3C_GPIO_SFN(3));3424}
+8-33
arch/arm/mach-s3c64xx/setup-sdhci-gpio.c
···2424void s3c64xx_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)2525{2626 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;2727- unsigned int gpio;2828- unsigned int end;29273030- end = S3C64XX_GPG(2 + width);3131-3232- /* Set all the necessary GPG pins to special-function 0 */3333- for (gpio = S3C64XX_GPG(0); gpio < end; gpio++) {3434- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));3535- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);3636- }2828+ /* Set all the necessary GPG pins to special-function 2 */2929+ s3c_gpio_cfgrange_nopull(S3C64XX_GPG(0), 2 + width, S3C_GPIO_SFN(2));37303831 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {3932 s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);···3744void s3c64xx_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)3845{3946 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;4040- unsigned int gpio;4141- unsigned int end;42474343- end = S3C64XX_GPH(2 + width);4444-4545- /* Set all the necessary GPG pins to special-function 0 */4646- for (gpio = S3C64XX_GPH(0); gpio < end; gpio++) {4747- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));4848- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);4949- }4848+ /* Set all the necessary GPH pins to special-function 2 */4949+ s3c_gpio_cfgrange_nopull(S3C64XX_GPH(0), 2 + width, S3C_GPIO_SFN(2));50505151 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {5252 s3c_gpio_setpull(S3C64XX_GPG(6), S3C_GPIO_PULL_UP);···49635064void s3c64xx_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)5165{5252- unsigned int gpio;5353- unsigned int end;6666+ /* Set all the necessary GPH pins to special-function 3 */6767+ s3c_gpio_cfgrange_nopull(S3C64XX_GPH(6), width, S3C_GPIO_SFN(3));54685555- end = S3C64XX_GPH(6 + width);5656-5757- /* Set all the necessary GPH pins to special-function 1 */5858- for (gpio = S3C64XX_GPH(6); gpio < end; gpio++) {5959- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));6060- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);6161- }6262-6363- /* Set all the necessary GPC pins to special-function 1 */6464- for (gpio = S3C64XX_GPC(4); gpio < S3C64XX_GPC(6); gpio++) {6565- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));6666- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);6767- }6969+ /* Set all the necessary GPC pins to special-function 3 */7070+ s3c_gpio_cfgrange_nopull(S3C64XX_GPC(4), 2, S3C_GPIO_SFN(3));6871}
-1
arch/arm/mach-s5p6442/Kconfig
···11111212config CPU_S5P64421313 bool1414- select PLAT_S5P1514 select S3C_PL330_DMA1615 help1716 Enable S5P6442 CPU support
···146146/* define the number of gpios we need to the one after the MP04() range */147147#define ARCH_NR_GPIOS (S5PC100_GPIO_END + 1)148148149149-#define EINT_MODE S3C_GPIO_SFN(0x2)150150-151151-#define EINT_GPIO_0(x) S5PC100_GPH0(x)152152-#define EINT_GPIO_1(x) S5PC100_GPH1(x)153153-#define EINT_GPIO_2(x) S5PC100_GPH2(x)154154-#define EINT_GPIO_3(x) S5PC100_GPH3(x)155155-156149#include <asm-generic/gpio.h>157150158151#endif /* __ASM_ARCH_GPIO_H */
···15151616void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)1717{1818- unsigned int gpio;1919- unsigned int end;2020-2118 /* Set all the necessary GPH3 pins to special-function 3: KP_ROW[x] */2222- end = S5PC100_GPH3(rows);2323- for (gpio = S5PC100_GPH3(0); gpio < end; gpio++) {2424- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));2525- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);2626- }1919+ s3c_gpio_cfgrange_nopull(S5PC100_GPH3(0), rows, S3C_GPIO_SFN(3));27202821 /* Set all the necessary GPH2 pins to special-function 3: KP_COL[x] */2929- end = S5PC100_GPH2(cols);3030- for (gpio = S5PC100_GPH2(0); gpio < end; gpio++) {3131- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));3232- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);3333- }2222+ s3c_gpio_cfgrange_nopull(S5PC100_GPH2(0), cols, S3C_GPIO_SFN(3));3423}
+5-30
arch/arm/mach-s5pc100/setup-sdhci-gpio.c
···2525void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)2626{2727 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;2828- unsigned int gpio;2929- unsigned int end;3028 unsigned int num;31293230 num = width;···3234 if (width == 8)3335 num = width - 2;34363535- end = S5PC100_GPG0(2 + num);3636-3737 /* Set all the necessary GPG0/GPG1 pins to special-function 0 */3838- for (gpio = S5PC100_GPG0(0); gpio < end; gpio++) {3939- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));4040- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);4141- }3838+ s3c_gpio_cfgrange_nopull(S5PC100_GPG0(0), 2 + num, S3C_GPIO_SFN(2));42394343- if (width == 8) {4444- for (gpio = S5PC100_GPG1(0); gpio <= S5PC100_GPG1(1); gpio++) {4545- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));4646- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);4747- }4848- }4040+ if (width == 8)4141+ s3c_gpio_cfgrange_nopull(S5PC100_GPG1(0), 2, S3C_GPIO_SFN(2));49425043 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {5144 s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP);···4758void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)4859{4960 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;5050- unsigned int gpio;5151- unsigned int end;5252-5353- end = S5PC100_GPG2(2 + width);54615562 /* Set all the necessary GPG2 pins to special-function 2 */5656- for (gpio = S5PC100_GPG2(0); gpio < end; gpio++) {5757- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));5858- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);5959- }6363+ s3c_gpio_cfgrange_nopull(S5PC100_GPG2(0), 2 + width, S3C_GPIO_SFN(2));60646165 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {6266 s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);···6078void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)6179{6280 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;6363- unsigned int gpio;6464- unsigned int end;6565-6666- end = S5PC100_GPG3(2 + width);67816882 /* Set all the necessary GPG3 pins to special-function 2 */6969- for (gpio = S5PC100_GPG3(0); gpio < end; gpio++) {7070- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));7171- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);7272- }8383+ s3c_gpio_cfgrange_nopull(S5PC100_GPG3(0), 2 + width, S3C_GPIO_SFN(2));73847485 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {7586 s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
···11+/* linux/arch/arm/mach-s5pv210/include/mach/pm-core.h22+ *33+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.44+ * http://www.samsung.com55+ *66+ * Based on arch/arm/mach-s3c2410/include/mach/pm-core.h,77+ * Copyright 2008 Simtec Electronics88+ * Ben Dooks <ben@simtec.co.uk>99+ * http://armlinux.simtec.co.uk/1010+ *1111+ * S5PV210 - PM core support for arch/arm/plat-s5p/pm.c1212+ *1313+ * This program is free software; you can redistribute it and/or modify1414+ * it under the terms of the GNU General Public License version 2 as1515+ * published by the Free Software Foundation.1616+*/1717+1818+static inline void s3c_pm_debug_init_uart(void)1919+{2020+ /* nothing here yet */2121+}2222+2323+static inline void s3c_pm_arch_prepare_irqs(void)2424+{2525+ __raw_writel(s3c_irqwake_intmask, S5P_WAKEUP_MASK);2626+ __raw_writel(s3c_irqwake_eintmask, S5P_EINT_WAKEUP_MASK);2727+}2828+2929+static inline void s3c_pm_arch_stop_clocks(void)3030+{3131+ /* nothing here yet */3232+}3333+3434+static inline void s3c_pm_arch_show_resume_irqs(void)3535+{3636+ /* nothing here yet */3737+}3838+3939+static inline void s3c_pm_arch_update_uart(void __iomem *regs,4040+ struct pm_uart_save *save)4141+{4242+ /* nothing here yet */4343+}
···11+/* arch/arm/mach-s5pv210/include/mach/regs-sys.h22+ *33+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.44+ * http://www.samsung.com/55+ *66+ * S5PV210 - System registers definitions77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+*/1212+1313+#define S5PV210_USB_PHY_CON (S3C_VA_SYS + 0xE80C)1414+#define S5PV210_USB_PHY0_EN (1 << 0)1515+#define S5PV210_USB_PHY1_EN (1 << 1)1616+1717+/* compatibility defines for s3c-hsotg driver */1818+#define S3C64XX_OTHERS S5PV210_USB_PHY_CON1919+#define S3C64XX_OTHERS_USBMASK S5PV210_USB_PHY0_EN
···16161717void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)1818{1919- unsigned int gpio, end;2020-2119 /* Set all the necessary GPH3 pins to special-function 3: KP_ROW[x] */2222- end = S5PV210_GPH3(rows);2323- for (gpio = S5PV210_GPH3(0); gpio < end; gpio++) {2424- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));2525- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);2626- }2020+ s3c_gpio_cfgrange_nopull(S5PV210_GPH3(0), rows, S3C_GPIO_SFN(3));27212822 /* Set all the necessary GPH2 pins to special-function 3: KP_COL[x] */2929- end = S5PV210_GPH2(cols);3030- for (gpio = S5PV210_GPH2(0); gpio < end; gpio++) {3131- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));3232- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);3333- }2323+ s3c_gpio_cfgrange_nopull(S5PV210_GPH2(0), cols, S3C_GPIO_SFN(3));3424}
+12-45
arch/arm/mach-s5pv210/setup-sdhci-gpio.c
···2626void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)2727{2828 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;2929- unsigned int gpio;30293130 /* Set all the necessary GPG0/GPG1 pins to special-function 2 */3232- for (gpio = S5PV210_GPG0(0); gpio < S5PV210_GPG0(2); gpio++) {3333- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));3434- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);3535- }3131+ s3c_gpio_cfgrange_nopull(S5PV210_GPG0(0), 2, S3C_GPIO_SFN(2));3232+3633 switch (width) {3734 case 8:3835 /* GPG1[3:6] special-funtion 3 */3939- for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) {4040- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));4141- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);4242- }3636+ s3c_gpio_cfgrange_nopull(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(3));4337 case 4:4438 /* GPG0[3:6] special-funtion 2 */4545- for (gpio = S5PV210_GPG0(3); gpio <= S5PV210_GPG0(6); gpio++) {4646- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));4747- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);4848- }3939+ s3c_gpio_cfgrange_nopull(S5PV210_GPG0(3), 4, S3C_GPIO_SFN(2));4940 default:5041 break;5142 }···5059void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)5160{5261 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;5353- unsigned int gpio;54625563 /* Set all the necessary GPG1[0:1] pins to special-function 2 */5656- for (gpio = S5PV210_GPG1(0); gpio < S5PV210_GPG1(2); gpio++) {5757- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));5858- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);5959- }6464+ s3c_gpio_cfgrange_nopull(S5PV210_GPG1(0), 2, S3C_GPIO_SFN(2));60656166 /* Data pin GPG1[3:6] to special-function 2 */6262- for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) {6363- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));6464- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);6565- }6767+ s3c_gpio_cfgrange_nopull(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(2));66686769 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {6870 s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP);···6682void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)6783{6884 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;6969- unsigned int gpio;70857186 /* Set all the necessary GPG2[0:1] pins to special-function 2 */7272- for (gpio = S5PV210_GPG2(0); gpio < S5PV210_GPG2(2); gpio++) {7373- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));7474- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);7575- }8787+ s3c_gpio_cfgrange_nopull(S5PV210_GPG2(0), 2, S3C_GPIO_SFN(2));76887789 switch (width) {7890 case 8:7991 /* Data pin GPG3[3:6] to special-function 3 */8080- for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) {8181- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));8282- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);8383- }9292+ s3c_gpio_cfgrange_nopull(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(3));8493 case 4:8594 /* Data pin GPG2[3:6] to special-function 2 */8686- for (gpio = S5PV210_GPG2(3); gpio <= S5PV210_GPG2(6); gpio++) {8787- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));8888- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);8989- }9595+ s3c_gpio_cfgrange_nopull(S5PV210_GPG2(3), 4, S3C_GPIO_SFN(2));9096 default:9197 break;9298 }···90116void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)91117{92118 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;9393- unsigned int gpio;941199595- /* Set all the necessary GPG3[0:2] pins to special-function 2 */9696- for (gpio = S5PV210_GPG3(0); gpio < S5PV210_GPG3(2); gpio++) {9797- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));9898- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);9999- }120120+ /* Set all the necessary GPG3[0:1] pins to special-function 2 */121121+ s3c_gpio_cfgrange_nopull(S5PV210_GPG3(0), 2, S3C_GPIO_SFN(2));100122101123 /* Data pin GPG3[3:6] to special-function 2 */102102- for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) {103103- s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));104104- s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);105105- }124124+ s3c_gpio_cfgrange_nopull(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(2));106125107126 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {108127 s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP);
+170
arch/arm/mach-s5pv210/sleep.S
···11+/* linux/arch/arm/plat-s5p/sleep.S22+ *33+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.44+ * http://www.samsung.com55+ *66+ * S5PV210 power Manager (Suspend-To-RAM) support77+ * Based on S3C2410 sleep code by:88+ * Ben Dooks, (c) 2004 Simtec Electronics99+ *1010+ * Based on PXA/SA1100 sleep code by:1111+ * Nicolas Pitre, (c) 2002 Monta Vista Software Inc1212+ * Cliff Brake, (c) 20011313+ *1414+ * This program is free software; you can redistribute it and/or modify1515+ * it under the terms of the GNU General Public License as published by1616+ * the Free Software Foundation; either version 2 of the License, or1717+ * (at your option) any later version.1818+ *1919+ * This program is distributed in the hope that it will be useful,2020+ * but WITHOUT ANY WARRANTY; without even the implied warranty of2121+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the2222+ * GNU General Public License for more details.2323+ *2424+ * You should have received a copy of the GNU General Public License2525+ * along with this program; if not, write to the Free Software2626+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA2727+*/2828+2929+#include <linux/linkage.h>3030+#include <asm/assembler.h>3131+#include <asm/memory.h>3232+3333+ .text3434+3535+ /* s3c_cpu_save3636+ *3737+ * entry:3838+ * r0 = save address (virtual addr of s3c_sleep_save_phys)3939+ */4040+4141+ENTRY(s3c_cpu_save)4242+4343+ stmfd sp!, { r3 - r12, lr }4444+4545+ mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID4646+ mrc p15, 0, r5, c3, c0, 0 @ Domain ID4747+ mrc p15, 0, r6, c2, c0, 0 @ Translation Table BASE04848+ mrc p15, 0, r7, c2, c0, 1 @ Translation Table BASE14949+ mrc p15, 0, r8, c2, c0, 2 @ Translation Table Control5050+ mrc p15, 0, r9, c1, c0, 0 @ Control register5151+ mrc p15, 0, r10, c1, c0, 1 @ Auxiliary control register5252+ mrc p15, 0, r11, c1, c0, 2 @ Co-processor access controls5353+ mrc p15, 0, r12, c10, c2, 0 @ Read PRRR5454+ mrc p15, 0, r3, c10, c2, 1 @ READ NMRR5555+5656+ stmia r0, { r3 - r13 }5757+5858+ bl s3c_pm_cb_flushcache5959+6060+ ldr r0, =pm_cpu_sleep6161+ ldr r0, [ r0 ]6262+ mov pc, r06363+6464+resume_with_mmu:6565+ /*6666+ * After MMU is turned on, restore the previous MMU table.6767+ */6868+ ldr r9 , =(PAGE_OFFSET - PHYS_OFFSET)6969+ add r4, r4, r97070+ str r12, [r4]7171+7272+ ldmfd sp!, { r3 - r12, pc }7373+7474+ .ltorg7575+7676+ .data7777+7878+ .global s3c_sleep_save_phys7979+s3c_sleep_save_phys:8080+ .word 08181+8282+ /* sleep magic, to allow the bootloader to check for an valid8383+ * image to resume to. Must be the first word before the8484+ * s3c_cpu_resume entry.8585+ */8686+8787+ .word 0x2bedf00d8888+8989+ /* s3c_cpu_resume9090+ *9191+ * resume code entry for bootloader to call9292+ *9393+ * we must put this code here in the data segment as we have no9494+ * other way of restoring the stack pointer after sleep, and we9595+ * must not write to the code segment (code is read-only)9696+ */9797+9898+ENTRY(s3c_cpu_resume)9999+ mov r0, #PSR_I_BIT | PSR_F_BIT | SVC_MODE100100+ msr cpsr_c, r0101101+102102+ mov r1, #0103103+ mcr p15, 0, r1, c8, c7, 0 @ invalidate TLBs104104+ mcr p15, 0, r1, c7, c5, 0 @ invalidate I Cache105105+106106+ ldr r0, s3c_sleep_save_phys @ address of restore block107107+ ldmia r0, { r3 - r13 }108108+109109+ mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID110110+ mcr p15, 0, r5, c3, c0, 0 @ Domain ID111111+112112+ mcr p15, 0, r8, c2, c0, 2 @ Translation Table Control113113+ mcr p15, 0, r7, c2, c0, 1 @ Translation Table BASE1114114+ mcr p15, 0, r6, c2, c0, 0 @ Translation Table BASE0115115+116116+ mcr p15, 0, r10, c1, c0, 1 @ Auxiliary control register117117+118118+ mov r0, #0119119+ mcr p15, 0, r0, c8, c7, 0 @ Invalidate I & D TLB120120+121121+ mov r0, #0 @ restore copro access122122+ mcr p15, 0, r11, c1, c0, 2 @ Co-processor access123123+ mcr p15, 0, r0, c7, c5, 4124124+125125+ mcr p15, 0, r12, c10, c2, 0 @ write PRRR126126+ mcr p15, 0, r3, c10, c2, 1 @ write NMRR127127+128128+ /*129129+ * In Cortex-A8, when MMU is turned on, the pipeline is flushed.130130+ * And there are no valid entries in the MMU table at this point.131131+ * So before turning on the MMU, the MMU entry for the DRAM address132132+ * range is added. After the MMU is turned on, the other entries133133+ * in the MMU table will be restored.134134+ */135135+136136+ /* r6 = Translation Table BASE0 */137137+ mov r4, r6138138+ mov r4, r4, LSR #14139139+ mov r4, r4, LSL #14140140+141141+ /* Load address for adding to MMU table list */142142+ ldr r11, =0xE010F000 @ INFORM0 reg.143143+ ldr r10, [r11, #0]144144+ mov r10, r10, LSR #18145145+ bic r10, r10, #0x3146146+ orr r4, r4, r10147147+148148+ /* Calculate MMU table entry */149149+ mov r10, r10, LSL #18150150+ ldr r5, =0x40E151151+ orr r10, r10, r5152152+153153+ /* Back up originally data */154154+ ldr r12, [r4]155155+156156+ /* Add calculated MMU table entry into MMU table list */157157+ str r10, [r4]158158+159159+ ldr r2, =resume_with_mmu160160+ mcr p15, 0, r9, c1, c0, 0 @ turn on MMU, etc161161+162162+ nop163163+ nop164164+ nop165165+ nop166166+ nop @ second-to-last before mmu167167+168168+ mov pc, r2 @ go back to virtual address169169+170170+ .ltorg
+89-6
arch/arm/mach-s5pv310/Kconfig
···11111212config CPU_S5PV3101313 bool1414- select PLAT_S5P1514 help1615 Enable S5PV310 CPU support1716···2425 help2526 Common setup code for i2c bus 2.26272828+config S5PV310_SETUP_I2C32929+ bool3030+ help3131+ Common setup code for i2c bus 3.3232+3333+config S5PV310_SETUP_I2C43434+ bool3535+ help3636+ Common setup code for i2c bus 4.3737+3838+config S5PV310_SETUP_I2C53939+ bool4040+ help4141+ Common setup code for i2c bus 5.4242+4343+config S5PV310_SETUP_I2C64444+ bool4545+ help4646+ Common setup code for i2c bus 6.4747+4848+config S5PV310_SETUP_I2C74949+ bool5050+ help5151+ Common setup code for i2c bus 7.5252+5353+config S5PV310_SETUP_SDHCI5454+ bool5555+ select S5PV310_SETUP_SDHCI_GPIO5656+ help5757+ Internal helper functions for S5PV310 based SDHCI systems.5858+5959+config S5PV310_SETUP_SDHCI_GPIO6060+ bool6161+ help6262+ Common setup code for SDHCI gpio.6363+2764# machine support28652929-config MACH_SMDKV3103030- bool "SMDKV310"6666+menu "S5PC210 Machines"6767+6868+config MACH_SMDKC2106969+ bool "SMDKC210"3170 select CPU_S5PV3103232- select ARCH_SPARSEMEM_ENABLE7171+ select S3C_DEV_RTC7272+ select S3C_DEV_WDT7373+ select S3C_DEV_HSMMC7474+ select S3C_DEV_HSMMC17575+ select S3C_DEV_HSMMC27676+ select S3C_DEV_HSMMC37777+ select S5PV310_SETUP_SDHCI3378 help3434- Machine support for Samsung SMDKV3107979+ Machine support for Samsung SMDKC2108080+ S5PC210(MCP) is one of package option of S5PV31035813682config MACH_UNIVERSAL_C2103783 bool "Mobile UNIVERSAL_C210 Board"3884 select CPU_S5PV3103939- select ARCH_SPARSEMEM_ENABLE8585+ select S5P_DEV_ONENAND8686+ select S3C_DEV_I2C18787+ select S5PV310_SETUP_I2C14088 help4189 Machine support for Samsung Mobile Universal S5PC210 Reference4290 Board. S5PC210(MCP) is one of package option of S5PV3109191+9292+endmenu9393+9494+menu "S5PV310 Machines"9595+9696+config MACH_SMDKV3109797+ bool "SMDKV310"9898+ select CPU_S5PV3109999+ select S3C_DEV_RTC100100+ select S3C_DEV_WDT101101+ select S3C_DEV_HSMMC102102+ select S3C_DEV_HSMMC1103103+ select S3C_DEV_HSMMC2104104+ select S3C_DEV_HSMMC3105105+ select S5PV310_SETUP_SDHCI106106+ help107107+ Machine support for Samsung SMDKV310108108+109109+endmenu110110+111111+comment "Configuration for HSMMC bus width"112112+113113+menu "Use 8-bit bus width"114114+115115+config S5PV310_SDHCI_CH0_8BIT116116+ bool "Channel 0 with 8-bit bus"117117+ help118118+ Support HSMMC Channel 0 8-bit bus.119119+ If selected, Channel 1 is disabled.120120+121121+config S5PV310_SDHCI_CH2_8BIT122122+ bool "Channel 2 with 8-bit bus"123123+ help124124+ Support HSMMC Channel 2 8-bit bus.125125+ If selected, Channel 3 is disabled.126126+127127+endmenu4312844129endif
···11+/* linux arch/arm/mach-s5pv310/hotplug.c22+ *33+ * Cloned from linux/arch/arm/mach-realview/hotplug.c44+ *55+ * Copyright (C) 2002 ARM Ltd.66+ * All Rights Reserved77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+*/1212+1313+#include <linux/kernel.h>1414+#include <linux/errno.h>1515+#include <linux/smp.h>1616+#include <linux/completion.h>1717+1818+#include <asm/cacheflush.h>1919+2020+extern volatile int pen_release;2121+2222+static DECLARE_COMPLETION(cpu_killed);2323+2424+static inline void cpu_enter_lowpower(void)2525+{2626+ unsigned int v;2727+2828+ flush_cache_all();2929+ asm volatile(3030+ " mcr p15, 0, %1, c7, c5, 0\n"3131+ " mcr p15, 0, %1, c7, c10, 4\n"3232+ /*3333+ * Turn off coherency3434+ */3535+ " mrc p15, 0, %0, c1, c0, 1\n"3636+ " bic %0, %0, #0x20\n"3737+ " mcr p15, 0, %0, c1, c0, 1\n"3838+ " mrc p15, 0, %0, c1, c0, 0\n"3939+ " bic %0, %0, #0x04\n"4040+ " mcr p15, 0, %0, c1, c0, 0\n"4141+ : "=&r" (v)4242+ : "r" (0)4343+ : "cc");4444+}4545+4646+static inline void cpu_leave_lowpower(void)4747+{4848+ unsigned int v;4949+5050+ asm volatile(5151+ "mrc p15, 0, %0, c1, c0, 0\n"5252+ " orr %0, %0, #0x04\n"5353+ " mcr p15, 0, %0, c1, c0, 0\n"5454+ " mrc p15, 0, %0, c1, c0, 1\n"5555+ " orr %0, %0, #0x20\n"5656+ " mcr p15, 0, %0, c1, c0, 1\n"5757+ : "=&r" (v)5858+ :5959+ : "cc");6060+}6161+6262+static inline void platform_do_lowpower(unsigned int cpu)6363+{6464+ /*6565+ * there is no power-control hardware on this platform, so all6666+ * we can do is put the core into WFI; this is safe as the calling6767+ * code will have already disabled interrupts6868+ */6969+ for (;;) {7070+ /*7171+ * here's the WFI7272+ */7373+ asm(".word 0xe320f003\n"7474+ :7575+ :7676+ : "memory", "cc");7777+7878+ if (pen_release == cpu) {7979+ /*8080+ * OK, proper wakeup, we're done8181+ */8282+ break;8383+ }8484+8585+ /*8686+ * getting here, means that we have come out of WFI without8787+ * having been woken up - this shouldn't happen8888+ *8989+ * The trouble is, letting people know about this is not really9090+ * possible, since we are currently running incoherently, and9191+ * therefore cannot safely call printk() or anything else9292+ */9393+#ifdef DEBUG9494+ printk(KERN_WARN "CPU%u: spurious wakeup call\n", cpu);9595+#endif9696+ }9797+}9898+9999+int platform_cpu_kill(unsigned int cpu)100100+{101101+ return wait_for_completion_timeout(&cpu_killed, 5000);102102+}103103+104104+/*105105+ * platform-specific code to shutdown a CPU106106+ *107107+ * Called with IRQs disabled108108+ */109109+void platform_cpu_die(unsigned int cpu)110110+{111111+#ifdef DEBUG112112+ unsigned int this_cpu = hard_smp_processor_id();113113+114114+ if (cpu != this_cpu) {115115+ printk(KERN_CRIT "Eek! platform_cpu_die running on %u, should be %u\n",116116+ this_cpu, cpu);117117+ BUG();118118+ }119119+#endif120120+121121+ printk(KERN_NOTICE "CPU%u: shutdown\n", cpu);122122+ complete(&cpu_killed);123123+124124+ /*125125+ * we're ready for shutdown now, so do it126126+ */127127+ cpu_enter_lowpower();128128+ platform_do_lowpower(cpu);129129+130130+ /*131131+ * bring this CPU back into the world of cache132132+ * coherency, and then restore interrupts133133+ */134134+ cpu_leave_lowpower();135135+}136136+137137+int platform_cpu_disable(unsigned int cpu)138138+{139139+ /*140140+ * we don't allow CPU 0 to be shutdown (it is still too special141141+ * e.g. clock tick interrupts)142142+ */143143+ return cpu == 0 ? -EPERM : 0;144144+}
···11+/*22+ * linux/arch/arm/mach-s5pv310/setup-i2c3.c33+ *44+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.55+ *66+ * I2C3 GPIO configuration.77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+*/1212+1313+struct platform_device; /* don't need the contents */1414+1515+#include <linux/gpio.h>1616+#include <plat/iic.h>1717+#include <plat/gpio-cfg.h>1818+1919+void s3c_i2c3_cfg_gpio(struct platform_device *dev)2020+{2121+ s3c_gpio_cfgall_range(S5PV310_GPA1(2), 2,2222+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);2323+}
+23
arch/arm/mach-s5pv310/setup-i2c4.c
···11+/*22+ * linux/arch/arm/mach-s5pv310/setup-i2c4.c33+ *44+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.55+ *66+ * I2C4 GPIO configuration.77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+*/1212+1313+struct platform_device; /* don't need the contents */1414+1515+#include <linux/gpio.h>1616+#include <plat/iic.h>1717+#include <plat/gpio-cfg.h>1818+1919+void s3c_i2c4_cfg_gpio(struct platform_device *dev)2020+{2121+ s3c_gpio_cfgall_range(S5PV310_GPB(2), 2,2222+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);2323+}
+23
arch/arm/mach-s5pv310/setup-i2c5.c
···11+/*22+ * linux/arch/arm/mach-s5pv310/setup-i2c5.c33+ *44+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.55+ *66+ * I2C5 GPIO configuration.77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+*/1212+1313+struct platform_device; /* don't need the contents */1414+1515+#include <linux/gpio.h>1616+#include <plat/iic.h>1717+#include <plat/gpio-cfg.h>1818+1919+void s3c_i2c5_cfg_gpio(struct platform_device *dev)2020+{2121+ s3c_gpio_cfgall_range(S5PV310_GPB(6), 2,2222+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);2323+}
+23
arch/arm/mach-s5pv310/setup-i2c6.c
···11+/*22+ * linux/arch/arm/mach-s5pv310/setup-i2c6.c33+ *44+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.55+ *66+ * I2C6 GPIO configuration.77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+*/1212+1313+struct platform_device; /* don't need the contents */1414+1515+#include <linux/gpio.h>1616+#include <plat/iic.h>1717+#include <plat/gpio-cfg.h>1818+1919+void s3c_i2c6_cfg_gpio(struct platform_device *dev)2020+{2121+ s3c_gpio_cfgall_range(S5PV310_GPC1(3), 2,2222+ S3C_GPIO_SFN(4), S3C_GPIO_PULL_UP);2323+}
+23
arch/arm/mach-s5pv310/setup-i2c7.c
···11+/*22+ * linux/arch/arm/mach-s5pv310/setup-i2c7.c33+ *44+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.55+ *66+ * I2C7 GPIO configuration.77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+*/1212+1313+struct platform_device; /* don't need the contents */1414+1515+#include <linux/gpio.h>1616+#include <plat/iic.h>1717+#include <plat/gpio-cfg.h>1818+1919+void s3c_i2c7_cfg_gpio(struct platform_device *dev)2020+{2121+ s3c_gpio_cfgall_range(S5PV310_GPD0(2), 2,2222+ S3C_GPIO_SFN(3), S3C_GPIO_PULL_UP);2323+}
+152
arch/arm/mach-s5pv310/setup-sdhci-gpio.c
···11+/* linux/arch/arm/mach-s5pv310/setup-sdhci-gpio.c22+ *33+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.44+ * http://www.samsung.com/55+ *66+ * S5PV310 - Helper functions for setting up SDHCI device(s) GPIO (HSMMC)77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+*/1212+1313+#include <linux/kernel.h>1414+#include <linux/types.h>1515+#include <linux/interrupt.h>1616+#include <linux/platform_device.h>1717+#include <linux/io.h>1818+#include <linux/gpio.h>1919+#include <linux/mmc/host.h>2020+#include <linux/mmc/card.h>2121+2222+#include <plat/gpio-cfg.h>2323+#include <plat/regs-sdhci.h>2424+#include <plat/sdhci.h>2525+2626+void s5pv310_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)2727+{2828+ struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;2929+ unsigned int gpio;3030+3131+ /* Set all the necessary GPK0[0:1] pins to special-function 2 */3232+ for (gpio = S5PV310_GPK0(0); gpio < S5PV310_GPK0(2); gpio++) {3333+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));3434+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);3535+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);3636+ }3737+3838+ switch (width) {3939+ case 8:4040+ for (gpio = S5PV310_GPK1(3); gpio <= S5PV310_GPK1(6); gpio++) {4141+ /* Data pin GPK1[3:6] to special-funtion 3 */4242+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));4343+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);4444+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);4545+ }4646+ case 4:4747+ for (gpio = S5PV310_GPK0(3); gpio <= S5PV310_GPK0(6); gpio++) {4848+ /* Data pin GPK0[3:6] to special-funtion 2 */4949+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));5050+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);5151+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);5252+ }5353+ default:5454+ break;5555+ }5656+5757+ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {5858+ s3c_gpio_cfgpin(S5PV310_GPK0(2), S3C_GPIO_SFN(2));5959+ s3c_gpio_setpull(S5PV310_GPK0(2), S3C_GPIO_PULL_UP);6060+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);6161+ }6262+}6363+6464+void s5pv310_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)6565+{6666+ struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;6767+ unsigned int gpio;6868+6969+ /* Set all the necessary GPK1[0:1] pins to special-function 2 */7070+ for (gpio = S5PV310_GPK1(0); gpio < S5PV310_GPK1(2); gpio++) {7171+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));7272+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);7373+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);7474+ }7575+7676+ for (gpio = S5PV310_GPK1(3); gpio <= S5PV310_GPK1(6); gpio++) {7777+ /* Data pin GPK1[3:6] to special-function 2 */7878+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));7979+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);8080+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);8181+ }8282+8383+ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {8484+ s3c_gpio_cfgpin(S5PV310_GPK1(2), S3C_GPIO_SFN(2));8585+ s3c_gpio_setpull(S5PV310_GPK1(2), S3C_GPIO_PULL_UP);8686+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);8787+ }8888+}8989+9090+void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)9191+{9292+ struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;9393+ unsigned int gpio;9494+9595+ /* Set all the necessary GPK2[0:1] pins to special-function 2 */9696+ for (gpio = S5PV310_GPK2(0); gpio < S5PV310_GPK2(2); gpio++) {9797+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));9898+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);9999+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);100100+ }101101+102102+ switch (width) {103103+ case 8:104104+ for (gpio = S5PV310_GPK3(3); gpio <= S5PV310_GPK3(6); gpio++) {105105+ /* Data pin GPK3[3:6] to special-function 3 */106106+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));107107+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);108108+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);109109+ }110110+ case 4:111111+ for (gpio = S5PV310_GPK2(3); gpio <= S5PV310_GPK2(6); gpio++) {112112+ /* Data pin GPK2[3:6] to special-function 2 */113113+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));114114+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);115115+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);116116+ }117117+ default:118118+ break;119119+ }120120+121121+ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {122122+ s3c_gpio_cfgpin(S5PV310_GPK2(2), S3C_GPIO_SFN(2));123123+ s3c_gpio_setpull(S5PV310_GPK2(2), S3C_GPIO_PULL_UP);124124+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);125125+ }126126+}127127+128128+void s5pv310_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)129129+{130130+ struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;131131+ unsigned int gpio;132132+133133+ /* Set all the necessary GPK3[0:1] pins to special-function 2 */134134+ for (gpio = S5PV310_GPK3(0); gpio < S5PV310_GPK3(2); gpio++) {135135+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));136136+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);137137+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);138138+ }139139+140140+ for (gpio = S5PV310_GPK3(3); gpio <= S5PV310_GPK3(6); gpio++) {141141+ /* Data pin GPK3[3:6] to special-function 2 */142142+ s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));143143+ s3c_gpio_setpull(gpio, S3C_GPIO_PULL_UP);144144+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);145145+ }146146+147147+ if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {148148+ s3c_gpio_cfgpin(S5PV310_GPK3(2), S3C_GPIO_SFN(2));149149+ s3c_gpio_setpull(S5PV310_GPK3(2), S3C_GPIO_PULL_UP);150150+ s5p_gpio_set_drvstr(gpio, S5P_GPIO_DRVSTR_LV4);151151+ }152152+}
+69
arch/arm/mach-s5pv310/setup-sdhci.c
···11+/* linux/arch/arm/mach-s5pv310/setup-sdhci.c22+ *33+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.44+ * http://www.samsung.com/55+ *66+ * S5PV310 - Helper functions for settign up SDHCI device(s) (HSMMC)77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+*/1212+1313+#include <linux/kernel.h>1414+#include <linux/types.h>1515+#include <linux/interrupt.h>1616+#include <linux/platform_device.h>1717+#include <linux/io.h>1818+1919+#include <linux/mmc/card.h>2020+#include <linux/mmc/host.h>2121+2222+#include <plat/regs-sdhci.h>2323+2424+/* clock sources for the mmc bus clock, order as for the ctrl2[5..4] */2525+2626+char *s5pv310_hsmmc_clksrcs[4] = {2727+ [0] = NULL,2828+ [1] = NULL,2929+ [2] = "sclk_mmc", /* mmc_bus */3030+ [3] = NULL,3131+};3232+3333+void s5pv310_setup_sdhci_cfg_card(struct platform_device *dev, void __iomem *r,3434+ struct mmc_ios *ios, struct mmc_card *card)3535+{3636+ u32 ctrl2, ctrl3;3737+3838+ /* don't need to alter anything acording to card-type */3939+4040+ ctrl2 = readl(r + S3C_SDHCI_CONTROL2);4141+4242+ /* select base clock source to HCLK */4343+4444+ ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;4545+4646+ /*4747+ * clear async mode, enable conflict mask, rx feedback ctrl, SD4848+ * clk hold and no use debounce count4949+ */5050+5151+ ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |5252+ S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |5353+ S3C_SDHCI_CTRL2_ENFBCLKRX |5454+ S3C_SDHCI_CTRL2_DFCNT_NONE |5555+ S3C_SDHCI_CTRL2_ENCLKOUTHOLD);5656+5757+ /* Tx and Rx feedback clock delay control */5858+5959+ if (ios->clock < 25 * 1000000)6060+ ctrl3 = (S3C_SDHCI_CTRL3_FCSEL3 |6161+ S3C_SDHCI_CTRL3_FCSEL2 |6262+ S3C_SDHCI_CTRL3_FCSEL1 |6363+ S3C_SDHCI_CTRL3_FCSEL0);6464+ else6565+ ctrl3 = (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0);6666+6767+ writel(ctrl2, r + S3C_SDHCI_CONTROL2);6868+ writel(ctrl3, r + S3C_SDHCI_CONTROL3);6969+}
···1010#include <linux/io.h>1111#include <linux/clk.h>12121313+#include <asm/cacheflush.h>1314#include <asm/hardware/cache-l2x0.h>1415#include <asm/hardware/gic.h>1516#include <asm/mach/map.h>···7271}73727473#ifdef CONFIG_CACHE_L2X07474+static inline void ux500_cache_wait(void __iomem *reg, unsigned long mask)7575+{7676+ /* wait for the operation to complete */7777+ while (readl(reg) & mask)7878+ ;7979+}8080+8181+static inline void ux500_cache_sync(void)8282+{8383+ void __iomem *base = __io_address(UX500_L2CC_BASE);8484+ writel(0, base + L2X0_CACHE_SYNC);8585+ ux500_cache_wait(base + L2X0_CACHE_SYNC, 1);8686+}8787+8888+/*8989+ * The L2 cache cannot be turned off in the non-secure world.9090+ * Dummy until a secure service is in place.9191+ */9292+static void ux500_l2x0_disable(void)9393+{9494+}9595+9696+/*9797+ * This is only called when doing a kexec, just after turning off the L29898+ * and L1 cache, and it is surrounded by a spinlock in the generic version.9999+ * However, we're not really turning off the L2 cache right now and the100100+ * PL310 does not support exclusive accesses (used to implement the spinlock).101101+ * So, the invalidation needs to be done without the spinlock.102102+ */103103+static void ux500_l2x0_inv_all(void)104104+{105105+ void __iomem *l2x0_base = __io_address(UX500_L2CC_BASE);106106+ uint32_t l2x0_way_mask = (1<<16) - 1; /* Bitmask of active ways */107107+108108+ /* invalidate all ways */109109+ writel(l2x0_way_mask, l2x0_base + L2X0_INV_WAY);110110+ ux500_cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask);111111+ ux500_cache_sync();112112+}113113+75114static int ux500_l2x0_init(void)76115{77116 void __iomem *l2x0_base;···1207912180 /* 64KB way size, 8 way associativity, force WA */12281 l2x0_init(l2x0_base, 0x3e060000, 0xc0000fff);8282+8383+ /* Override invalidate function */8484+ outer_cache.disable = ux500_l2x0_disable;8585+ outer_cache.inv_all = ux500_l2x0_inv_all;1238612487 return 0;12588}
+8
arch/arm/mm/Kconfig
···779779 help780780 This option enables the L2x0 PrimeCell.781781782782+config CACHE_PL310783783+ bool784784+ depends on CACHE_L2X0785785+ default y if CPU_V7 && !CPU_V6786786+ help787787+ This option enables optimisations for the PL310 cache788788+ controller.789789+782790config CACHE_TAUROS2783791 bool "Enable the Tauros2 L2 cache controller"784792 depends on (ARCH_DOVE || ARCH_MMP)
+72-6
arch/arm/mm/cache-l2x0.c
···2828static void __iomem *l2x0_base;2929static DEFINE_SPINLOCK(l2x0_lock);3030static uint32_t l2x0_way_mask; /* Bitmask of active ways */3131+static uint32_t l2x0_size;31323232-static inline void cache_wait(void __iomem *reg, unsigned long mask)3333+static inline void cache_wait_way(void __iomem *reg, unsigned long mask)3334{3434- /* wait for the operation to complete */3535+ /* wait for cache operation by line or way to complete */3536 while (readl_relaxed(reg) & mask)3637 ;3738}3939+4040+#ifdef CONFIG_CACHE_PL3104141+static inline void cache_wait(void __iomem *reg, unsigned long mask)4242+{4343+ /* cache operations by line are atomic on PL310 */4444+}4545+#else4646+#define cache_wait cache_wait_way4747+#endif38483949static inline void cache_sync(void)4050{···113103 spin_unlock_irqrestore(&l2x0_lock, flags);114104}115105116116-static inline void l2x0_inv_all(void)106106+static void l2x0_flush_all(void)107107+{108108+ unsigned long flags;109109+110110+ /* clean all ways */111111+ spin_lock_irqsave(&l2x0_lock, flags);112112+ writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_INV_WAY);113113+ cache_wait_way(l2x0_base + L2X0_CLEAN_INV_WAY, l2x0_way_mask);114114+ cache_sync();115115+ spin_unlock_irqrestore(&l2x0_lock, flags);116116+}117117+118118+static void l2x0_clean_all(void)119119+{120120+ unsigned long flags;121121+122122+ /* clean all ways */123123+ spin_lock_irqsave(&l2x0_lock, flags);124124+ writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_CLEAN_WAY);125125+ cache_wait_way(l2x0_base + L2X0_CLEAN_WAY, l2x0_way_mask);126126+ cache_sync();127127+ spin_unlock_irqrestore(&l2x0_lock, flags);128128+}129129+130130+static void l2x0_inv_all(void)117131{118132 unsigned long flags;119133120134 /* invalidate all ways */121135 spin_lock_irqsave(&l2x0_lock, flags);136136+ /* Invalidating when L2 is enabled is a nono */137137+ BUG_ON(readl(l2x0_base + L2X0_CTRL) & 1);122138 writel_relaxed(l2x0_way_mask, l2x0_base + L2X0_INV_WAY);123123- cache_wait(l2x0_base + L2X0_INV_WAY, l2x0_way_mask);139139+ cache_wait_way(l2x0_base + L2X0_INV_WAY, l2x0_way_mask);124140 cache_sync();125141 spin_unlock_irqrestore(&l2x0_lock, flags);126142}···195159 void __iomem *base = l2x0_base;196160 unsigned long flags;197161162162+ if ((end - start) >= l2x0_size) {163163+ l2x0_clean_all();164164+ return;165165+ }166166+198167 spin_lock_irqsave(&l2x0_lock, flags);199168 start &= ~(CACHE_LINE_SIZE - 1);200169 while (start < end) {···225184 void __iomem *base = l2x0_base;226185 unsigned long flags;227186187187+ if ((end - start) >= l2x0_size) {188188+ l2x0_flush_all();189189+ return;190190+ }191191+228192 spin_lock_irqsave(&l2x0_lock, flags);229193 start &= ~(CACHE_LINE_SIZE - 1);230194 while (start < end) {···252206 spin_unlock_irqrestore(&l2x0_lock, flags);253207}254208209209+static void l2x0_disable(void)210210+{211211+ unsigned long flags;212212+213213+ spin_lock_irqsave(&l2x0_lock, flags);214214+ writel(0, l2x0_base + L2X0_CTRL);215215+ spin_unlock_irqrestore(&l2x0_lock, flags);216216+}217217+255218void __init l2x0_init(void __iomem *base, __u32 aux_val, __u32 aux_mask)256219{257220 __u32 aux;258221 __u32 cache_id;222222+ __u32 way_size = 0;259223 int ways;260224 const char *type;261225···300244 l2x0_way_mask = (1 << ways) - 1;301245302246 /*247247+ * L2 cache Size = Way size * Number of ways248248+ */249249+ way_size = (aux & L2X0_AUX_CTRL_WAY_SIZE_MASK) >> 17;250250+ way_size = 1 << (way_size + 3);251251+ l2x0_size = ways * way_size * SZ_1K;252252+253253+ /*303254 * Check if l2x0 controller is already enabled.304255 * If you are booting from non-secure mode305256 * accessing the below registers will fault.···326263 outer_cache.clean_range = l2x0_clean_range;327264 outer_cache.flush_range = l2x0_flush_range;328265 outer_cache.sync = l2x0_cache_sync;266266+ outer_cache.flush_all = l2x0_flush_all;267267+ outer_cache.inv_all = l2x0_inv_all;268268+ outer_cache.disable = l2x0_disable;329269330270 printk(KERN_INFO "%s cache controller enabled\n", type);331331- printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x\n",332332- ways, cache_id, aux);271271+ printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n",272272+ ways, cache_id, aux, l2x0_size);333273}
···11+/*22+ * Copyright (C) 2010 Freescale Semiconductor, Inc. All Rights Reserved.33+ *44+ * This program is free software; you can redistribute it and/or55+ * modify it under the terms of the GNU General Public License66+ * as published by the Free Software Foundation; either version 277+ * of the License, or (at your option) any later version.88+ * This program is distributed in the hope that it will be useful,99+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1010+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1111+ * GNU General Public License for more details.1212+ *1313+ * You should have received a copy of the GNU General Public License1414+ * along with this program; if not, write to the Free Software1515+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,1616+ * Boston, MA 02110-1301, USA.1717+ */1818+#include <asm/sizes.h>1919+#include <mach/hardware.h>2020+#include <mach/devices-common.h>2121+2222+struct platform_device *__init imx_add_gpio_keys(2323+ const struct gpio_keys_platform_data *pdata)2424+{2525+ return imx_add_platform_device("gpio-keys", -1, NULL,2626+ 0, pdata, sizeof(*pdata));2727+}
+32
arch/arm/plat-mxc/gpio.c
···2020 */21212222#include <linux/init.h>2323+#include <linux/interrupt.h>2324#include <linux/io.h>2425#include <linux/irq.h>2526#include <linux/gpio.h>···202201 }203202}204203204204+/*205205+ * Set interrupt number "irq" in the GPIO as a wake-up source.206206+ * While system is running, all registered GPIO interrupts need to have207207+ * wake-up enabled. When system is suspended, only selected GPIO interrupts208208+ * need to have wake-up enabled.209209+ * @param irq interrupt source number210210+ * @param enable enable as wake-up if equal to non-zero211211+ * @return This function returns 0 on success.212212+ */213213+static int gpio_set_wake_irq(u32 irq, u32 enable)214214+{215215+ u32 gpio = irq_to_gpio(irq);216216+ u32 gpio_idx = gpio & 0x1F;217217+ struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32];218218+219219+ if (enable) {220220+ if (port->irq_high && (gpio_idx >= 16))221221+ enable_irq_wake(port->irq_high);222222+ else223223+ enable_irq_wake(port->irq);224224+ } else {225225+ if (port->irq_high && (gpio_idx >= 16))226226+ disable_irq_wake(port->irq_high);227227+ else228228+ disable_irq_wake(port->irq);229229+ }230230+231231+ return 0;232232+}233233+205234static struct irq_chip gpio_irq_chip = {206235 .ack = gpio_ack_irq,207236 .mask = gpio_mask_irq,208237 .unmask = gpio_unmask_irq,209238 .set_type = gpio_set_irq_type,239239+ .set_wake = gpio_set_wake_irq,210240};211241212242static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset,
···197197/* these should go away */198198#define MXC_FEC_BASE_ADDR MX35_FEC_BASE_ADDR199199#define MXC_INT_OWIRE MX35_INT_OWIRE200200-#define MXC_INT_MMC_SDHC2 MX35_INT_MMC_SDHC2201201-#define MXC_INT_MMC_SDHC3 MX35_INT_MMC_SDHC3202200#define MXC_INT_GPU2D MX35_INT_GPU2D203201#define MXC_INT_ASRC MX35_INT_ASRC204202#define MXC_INT_USBHS MX35_INT_USBHS
+12-1
arch/arm/plat-mxc/include/mach/mxc.h
···11/*22- * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.22+ * Copyright 2004-2007, 2010 Freescale Semiconductor, Inc. All Rights Reserved.33 * Copyright (C) 2008 Juergen Beisert (kernel@pengutronix.de)44 *55 * This program is free software; you can redistribute it and/or···19192020#ifndef __ASM_ARCH_MXC_H__2121#define __ASM_ARCH_MXC_H__2222+2323+#include <linux/types.h>22242325#ifndef __ASM_ARCH_MXC_HARDWARE_H__2426#error "Do not include directly."···133131# define cpu_is_mxc91231() (mxc_cpu_type == MXC_CPU_MXC91231)134132#else135133# define cpu_is_mxc91231() (0)134134+#endif135135+136136+#ifndef __ASSEMBLY__137137+138138+struct cpu_op {139139+ u32 cpu_rate;140140+};141141+142142+extern struct cpu_op *(*get_cpu_op)(int *op);136143#endif137144138145#if defined(CONFIG_ARCH_MX3) || defined(CONFIG_ARCH_MX2)
···3232 Use the external interrupts (other than GPIO interrupts.)3333 Note: Do not choose this for S5P6440 and S5P6450.34343535+config S5P_GPIO_INT3636+ bool3737+ help3838+ Common code for the GPIO interrupts (other than external interrupts.)3939+3540config S5P_DEV_FIMC03641 bool3742 help
···9494 ((irq) - S5P_EINT_BASE1) : \9595 ((irq) + 16 - S5P_EINT_BASE2))96969797+#define IRQ_EINT_BIT(x) EINT_OFFSET(x)9898+9999+/* Typically only a few gpio chips require gpio interrupt support.100100+ To avoid memory waste irq descriptors are allocated only for101101+ S5P_GPIOINT_GROUP_COUNT chips, each with total number of102102+ S5P_GPIOINT_GROUP_SIZE pins/irqs. Each GPIOINT group can be assiged103103+ to any gpio chip with the s5p_register_gpio_interrupt() function */104104+#define S5P_GPIOINT_GROUP_COUNT 4105105+#define S5P_GPIOINT_GROUP_SIZE 8106106+#define S5P_GPIOINT_COUNT (S5P_GPIOINT_GROUP_COUNT * S5P_GPIOINT_GROUP_SIZE)107107+108108+/* IRQ types common for all s5p platforms */109109+#define S5P_IRQ_TYPE_LEVEL_LOW (0x00)110110+#define S5P_IRQ_TYPE_LEVEL_HIGH (0x01)111111+#define S5P_IRQ_TYPE_EDGE_FALLING (0x02)112112+#define S5P_IRQ_TYPE_EDGE_RISING (0x03)113113+#define S5P_IRQ_TYPE_EDGE_BOTH (0x04)114114+97115#endif /* __ASM_PLAT_S5P_IRQS_H */
···43434444extern int s5p_gatectrl(void __iomem *reg, struct clk *clk, int enable);45454646+/* Common EPLL operations for S5P platform */4747+extern int s5p_epll_enable(struct clk *clk, int enable);4848+extern unsigned long s5p_epll_get_rate(struct clk *clk);4949+4650#endif /* __ASM_PLAT_S5P_CLOCK_H */
+5-5
arch/arm/plat-s5p/irq-eint.c
···67676868 switch (type) {6969 case IRQ_TYPE_EDGE_RISING:7070- newvalue = S5P_EXTINT_RISEEDGE;7070+ newvalue = S5P_IRQ_TYPE_EDGE_RISING;7171 break;72727373 case IRQ_TYPE_EDGE_FALLING:7474- newvalue = S5P_EXTINT_FALLEDGE;7474+ newvalue = S5P_IRQ_TYPE_EDGE_FALLING;7575 break;76767777 case IRQ_TYPE_EDGE_BOTH:7878- newvalue = S5P_EXTINT_BOTHEDGE;7878+ newvalue = S5P_IRQ_TYPE_EDGE_BOTH;7979 break;80808181 case IRQ_TYPE_LEVEL_LOW:8282- newvalue = S5P_EXTINT_LOWLEV;8282+ newvalue = S5P_IRQ_TYPE_LEVEL_LOW;8383 break;84848585 case IRQ_TYPE_LEVEL_HIGH:8686- newvalue = S5P_EXTINT_HILEV;8686+ newvalue = S5P_IRQ_TYPE_LEVEL_HIGH;8787 break;88888989 default:
+237
arch/arm/plat-s5p/irq-gpioint.c
···11+/* linux/arch/arm/plat-s5p/irq-gpioint.c22+ *33+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.44+ * Author: Kyungmin Park <kyungmin.park@samsung.com>55+ * Author: Joonyoung Shim <jy0922.shim@samsung.com>66+ * Author: Marek Szyprowski <m.szyprowski@samsung.com>77+ *88+ * This program is free software; you can redistribute it and/or modify it99+ * under the terms of the GNU General Public License as published by the1010+ * Free Software Foundation; either version 2 of the License, or (at your1111+ * option) any later version.1212+ *1313+ */1414+1515+#include <linux/kernel.h>1616+#include <linux/interrupt.h>1717+#include <linux/irq.h>1818+#include <linux/io.h>1919+#include <linux/gpio.h>2020+2121+#include <mach/map.h>2222+#include <plat/gpio-core.h>2323+#include <plat/gpio-cfg.h>2424+2525+#define S5P_GPIOREG(x) (S5P_VA_GPIO + (x))2626+2727+#define GPIOINT_CON_OFFSET 0x7002828+#define GPIOINT_MASK_OFFSET 0x9002929+#define GPIOINT_PEND_OFFSET 0xA003030+3131+static struct s3c_gpio_chip *irq_chips[S5P_GPIOINT_GROUP_MAXNR];3232+3333+static int s5p_gpioint_get_group(unsigned int irq)3434+{3535+ struct gpio_chip *chip = get_irq_data(irq);3636+ struct s3c_gpio_chip *s3c_chip = container_of(chip,3737+ struct s3c_gpio_chip, chip);3838+ int group;3939+4040+ for (group = 0; group < S5P_GPIOINT_GROUP_MAXNR; group++)4141+ if (s3c_chip == irq_chips[group])4242+ break;4343+4444+ return group;4545+}4646+4747+static int s5p_gpioint_get_offset(unsigned int irq)4848+{4949+ struct gpio_chip *chip = get_irq_data(irq);5050+ struct s3c_gpio_chip *s3c_chip = container_of(chip,5151+ struct s3c_gpio_chip, chip);5252+5353+ return irq - s3c_chip->irq_base;5454+}5555+5656+static void s5p_gpioint_ack(unsigned int irq)5757+{5858+ int group, offset, pend_offset;5959+ unsigned int value;6060+6161+ group = s5p_gpioint_get_group(irq);6262+ offset = s5p_gpioint_get_offset(irq);6363+ pend_offset = group << 2;6464+6565+ value = __raw_readl(S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset);6666+ value |= 1 << offset;6767+ __raw_writel(value, S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset);6868+}6969+7070+static void s5p_gpioint_mask(unsigned int irq)7171+{7272+ int group, offset, mask_offset;7373+ unsigned int value;7474+7575+ group = s5p_gpioint_get_group(irq);7676+ offset = s5p_gpioint_get_offset(irq);7777+ mask_offset = group << 2;7878+7979+ value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset);8080+ value |= 1 << offset;8181+ __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset);8282+}8383+8484+static void s5p_gpioint_unmask(unsigned int irq)8585+{8686+ int group, offset, mask_offset;8787+ unsigned int value;8888+8989+ group = s5p_gpioint_get_group(irq);9090+ offset = s5p_gpioint_get_offset(irq);9191+ mask_offset = group << 2;9292+9393+ value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset);9494+ value &= ~(1 << offset);9595+ __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset);9696+}9797+9898+static void s5p_gpioint_mask_ack(unsigned int irq)9999+{100100+ s5p_gpioint_mask(irq);101101+ s5p_gpioint_ack(irq);102102+}103103+104104+static int s5p_gpioint_set_type(unsigned int irq, unsigned int type)105105+{106106+ int group, offset, con_offset;107107+ unsigned int value;108108+109109+ group = s5p_gpioint_get_group(irq);110110+ offset = s5p_gpioint_get_offset(irq);111111+ con_offset = group << 2;112112+113113+ switch (type) {114114+ case IRQ_TYPE_EDGE_RISING:115115+ type = S5P_IRQ_TYPE_EDGE_RISING;116116+ break;117117+ case IRQ_TYPE_EDGE_FALLING:118118+ type = S5P_IRQ_TYPE_EDGE_FALLING;119119+ break;120120+ case IRQ_TYPE_EDGE_BOTH:121121+ type = S5P_IRQ_TYPE_EDGE_BOTH;122122+ break;123123+ case IRQ_TYPE_LEVEL_HIGH:124124+ type = S5P_IRQ_TYPE_LEVEL_HIGH;125125+ break;126126+ case IRQ_TYPE_LEVEL_LOW:127127+ type = S5P_IRQ_TYPE_LEVEL_LOW;128128+ break;129129+ case IRQ_TYPE_NONE:130130+ default:131131+ printk(KERN_WARNING "No irq type\n");132132+ return -EINVAL;133133+ }134134+135135+ value = __raw_readl(S5P_GPIOREG(GPIOINT_CON_OFFSET) + con_offset);136136+ value &= ~(0x7 << (offset * 0x4));137137+ value |= (type << (offset * 0x4));138138+ __raw_writel(value, S5P_GPIOREG(GPIOINT_CON_OFFSET) + con_offset);139139+140140+ return 0;141141+}142142+143143+struct irq_chip s5p_gpioint = {144144+ .name = "s5p_gpioint",145145+ .ack = s5p_gpioint_ack,146146+ .mask = s5p_gpioint_mask,147147+ .mask_ack = s5p_gpioint_mask_ack,148148+ .unmask = s5p_gpioint_unmask,149149+ .set_type = s5p_gpioint_set_type,150150+};151151+152152+static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc)153153+{154154+ int group, offset, pend_offset, mask_offset;155155+ int real_irq;156156+ unsigned int pend, mask;157157+158158+ for (group = 0; group < S5P_GPIOINT_GROUP_MAXNR; group++) {159159+ pend_offset = group << 2;160160+ pend = __raw_readl(S5P_GPIOREG(GPIOINT_PEND_OFFSET) +161161+ pend_offset);162162+ if (!pend)163163+ continue;164164+165165+ mask_offset = group << 2;166166+ mask = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) +167167+ mask_offset);168168+ pend &= ~mask;169169+170170+ for (offset = 0; offset < 8; offset++) {171171+ if (pend & (1 << offset)) {172172+ struct s3c_gpio_chip *chip = irq_chips[group];173173+ if (chip) {174174+ real_irq = chip->irq_base + offset;175175+ generic_handle_irq(real_irq);176176+ }177177+ }178178+ }179179+ }180180+}181181+182182+static __init int s5p_gpioint_add(struct s3c_gpio_chip *chip)183183+{184184+ static int used_gpioint_groups = 0;185185+ static bool handler_registered = 0;186186+ int irq, group = chip->group;187187+ int i;188188+189189+ if (used_gpioint_groups >= S5P_GPIOINT_GROUP_COUNT)190190+ return -ENOMEM;191191+192192+ chip->irq_base = S5P_GPIOINT_BASE +193193+ used_gpioint_groups * S5P_GPIOINT_GROUP_SIZE;194194+ used_gpioint_groups++;195195+196196+ if (!handler_registered) {197197+ set_irq_chained_handler(IRQ_GPIOINT, s5p_gpioint_handler);198198+ handler_registered = 1;199199+ }200200+201201+ irq_chips[group] = chip;202202+ for (i = 0; i < chip->chip.ngpio; i++) {203203+ irq = chip->irq_base + i;204204+ set_irq_chip(irq, &s5p_gpioint);205205+ set_irq_data(irq, &chip->chip);206206+ set_irq_handler(irq, handle_level_irq);207207+ set_irq_flags(irq, IRQF_VALID);208208+ }209209+ return 0;210210+}211211+212212+int __init s5p_register_gpio_interrupt(int pin)213213+{214214+ struct s3c_gpio_chip *my_chip = s3c_gpiolib_getchip(pin);215215+ int offset, group;216216+ int ret;217217+218218+ if (!my_chip)219219+ return -EINVAL;220220+221221+ offset = pin - my_chip->chip.base;222222+ group = my_chip->group;223223+224224+ /* check if the group has been already registered */225225+ if (my_chip->irq_base)226226+ return my_chip->irq_base + offset;227227+228228+ /* register gpio group */229229+ ret = s5p_gpioint_add(my_chip);230230+ if (ret == 0) {231231+ my_chip->chip.to_irq = samsung_gpiolib_to_irq;232232+ printk(KERN_INFO "Registered interrupt support for gpio group %d.\n",233233+ group);234234+ return my_chip->irq_base + offset;235235+ }236236+ return ret;237237+}
+93
arch/arm/plat-s5p/irq-pm.c
···11+/* linux/arch/arm/plat-s5p/irq-pm.c22+ *33+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.44+ * http://www.samsung.com55+ *66+ * Based on arch/arm/plat-s3c24xx/irq-pm.c,77+ * Copyright (c) 2003,2004 Simtec Electronics88+ * Ben Dooks <ben@simtec.co.uk>99+ * http://armlinux.simtec.co.uk/1010+ *1111+ * This program is free software; you can redistribute it and/or modify1212+ * it under the terms of the GNU General Public License version 2 as1313+ * published by the Free Software Foundation.1414+*/1515+1616+#include <linux/init.h>1717+#include <linux/module.h>1818+#include <linux/interrupt.h>1919+#include <linux/sysdev.h>2020+2121+#include <plat/cpu.h>2222+#include <plat/irqs.h>2323+#include <plat/pm.h>2424+#include <mach/map.h>2525+2626+#include <mach/regs-gpio.h>2727+#include <mach/regs-irq.h>2828+2929+/* state for IRQs over sleep */3030+3131+/* default is to allow for EINT0..EINT31, and IRQ_RTC_TIC, IRQ_RTC_ALARM,3232+ * as wakeup sources3333+ *3434+ * set bit to 1 in allow bitfield to enable the wakeup settings on it3535+*/3636+3737+unsigned long s3c_irqwake_intallow = 0x00000006L;3838+unsigned long s3c_irqwake_eintallow = 0xffffffffL;3939+4040+int s3c_irq_wake(unsigned int irqno, unsigned int state)4141+{4242+ unsigned long irqbit;4343+4444+ switch (irqno) {4545+ case IRQ_RTC_TIC:4646+ case IRQ_RTC_ALARM:4747+ irqbit = 1 << (irqno + 1 - IRQ_RTC_ALARM);4848+ if (!state)4949+ s3c_irqwake_intmask |= irqbit;5050+ else5151+ s3c_irqwake_intmask &= ~irqbit;5252+ break;5353+ default:5454+ return -ENOENT;5555+ }5656+ return 0;5757+}5858+5959+static struct sleep_save eint_save[] = {6060+ SAVE_ITEM(S5P_EINT_CON(0)),6161+ SAVE_ITEM(S5P_EINT_CON(1)),6262+ SAVE_ITEM(S5P_EINT_CON(2)),6363+ SAVE_ITEM(S5P_EINT_CON(3)),6464+6565+ SAVE_ITEM(S5P_EINT_FLTCON(0)),6666+ SAVE_ITEM(S5P_EINT_FLTCON(1)),6767+ SAVE_ITEM(S5P_EINT_FLTCON(2)),6868+ SAVE_ITEM(S5P_EINT_FLTCON(3)),6969+ SAVE_ITEM(S5P_EINT_FLTCON(4)),7070+ SAVE_ITEM(S5P_EINT_FLTCON(5)),7171+ SAVE_ITEM(S5P_EINT_FLTCON(6)),7272+ SAVE_ITEM(S5P_EINT_FLTCON(7)),7373+7474+ SAVE_ITEM(S5P_EINT_MASK(0)),7575+ SAVE_ITEM(S5P_EINT_MASK(1)),7676+ SAVE_ITEM(S5P_EINT_MASK(2)),7777+ SAVE_ITEM(S5P_EINT_MASK(3)),7878+};7979+8080+int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state)8181+{8282+ s3c_pm_do_save(eint_save, ARRAY_SIZE(eint_save));8383+8484+ return 0;8585+}8686+8787+int s3c24xx_irq_resume(struct sys_device *dev)8888+{8989+ s3c_pm_do_restore(eint_save, ARRAY_SIZE(eint_save));9090+9191+ return 0;9292+}9393+
+52
arch/arm/plat-s5p/pm.c
···11+/* linux/arch/arm/plat-s5p/pm.c22+ *33+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.44+ * http://www.samsung.com55+ *66+ * S5P Power Manager (Suspend-To-RAM) support77+ *88+ * Based on arch/arm/plat-s3c24xx/pm.c99+ * Copyright (c) 2004,2006 Simtec Electronics1010+ * Ben Dooks <ben@simtec.co.uk>1111+ *1212+ * This program is free software; you can redistribute it and/or modify1313+ * it under the terms of the GNU General Public License version 2 as1414+ * published by the Free Software Foundation.1515+*/1616+1717+#include <linux/suspend.h>1818+#include <plat/pm.h>1919+2020+#define PFX "s5p pm: "2121+2222+/* s3c_pm_check_resume_pin2323+ *2424+ * check to see if the pin is configured correctly for sleep mode, and2525+ * make any necessary adjustments if it is not2626+*/2727+2828+static void s3c_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs)2929+{3030+ /* nothing here yet */3131+}3232+3333+/* s3c_pm_configure_extint3434+ *3535+ * configure all external interrupt pins3636+*/3737+3838+void s3c_pm_configure_extint(void)3939+{4040+ /* nothing here yet */4141+}4242+4343+void s3c_pm_restore_core(void)4444+{4545+ /* nothing here yet */4646+}4747+4848+void s3c_pm_save_core(void)4949+{5050+ /* nothing here yet */5151+}5252+
+25
arch/arm/plat-samsung/Kconfig
···180180 help181181 Compile in platform device definitions for I2C channel 2182182183183+config S3C_DEV_I2C3184184+ bool185185+ help186186+ Compile in platform device definition for I2C controller 3187187+188188+config S3C_DEV_I2C4189189+ bool190190+ help191191+ Compile in platform device definition for I2C controller 4192192+193193+config S3C_DEV_I2C5194194+ bool195195+ help196196+ Compile in platform device definition for I2C controller 5197197+198198+config S3C_DEV_I2C6199199+ bool200200+ help201201+ Compile in platform device definition for I2C controller 6202202+203203+config S3C_DEV_I2C7204204+ bool205205+ help206206+ Compile in platform device definition for I2C controller 7207207+183208config S3C_DEV_FB184209 bool185210 help
···1616#define S3C64XX_AC97_GPE 11717extern void s3c64xx_ac97_setup_gpio(int);18181919+/*2020+ * The machine init code calls s5p*_spdif_setup_gpio with2121+ * one of these defines in order to select appropriate bank2222+ * of GPIO for S/PDIF pins2323+ */2424+#define S5PC100_SPDIF_GPD 02525+#define S5PC100_SPDIF_GPG3 12626+extern void s5pc100_spdif_setup_gpio(int);2727+1928/**2029 * struct s3c_audio_pdata - common platform data for audio device drivers2130 * @cfg_gpio: Callback function to setup mux'ed pins in I2S/PCM/AC97 mode
···4242 return (chip->config->set_pull)(chip, off, pull);4343}44444545+static inline s3c_gpio_pull_t s3c_gpio_do_getpull(struct s3c_gpio_chip *chip,4646+ unsigned int off)4747+{4848+ return chip->config->get_pull(chip, off);4949+}5050+4551/**4652 * s3c_gpio_setcfg_s3c24xx - S3C24XX style GPIO configuration.4753 * @chip: The gpio chip that is being configured.
+56
arch/arm/plat-samsung/include/plat/gpio-cfg.h
···108108 */109109extern unsigned s3c_gpio_getcfg(unsigned int pin);110110111111+/**112112+ * s3c_gpio_cfgpin_range() - Change the GPIO function for configuring pin range113113+ * @start: The pin number to start at114114+ * @nr: The number of pins to configure from @start.115115+ * @cfg: The configuration for the pin's function116116+ *117117+ * Call s3c_gpio_cfgpin() for the @nr pins starting at @start.118118+ *119119+ * @sa s3c_gpio_cfgpin.120120+ */121121+extern int s3c_gpio_cfgpin_range(unsigned int start, unsigned int nr,122122+ unsigned int cfg);123123+111124/* Define values for the pull-{up,down} available for each gpio pin.112125 *113126 * These values control the state of the weak pull-{up,down} resistors···153140*/154141extern s3c_gpio_pull_t s3c_gpio_getpull(unsigned int pin);155142143143+/* configure `all` aspects of an gpio */144144+145145+/**146146+ * s3c_gpio_cfgall_range() - configure range of gpio functtion and pull.147147+ * @start: The gpio number to start at.148148+ * @nr: The number of gpio to configure from @start.149149+ * @cfg: The configuration to use150150+ * @pull: The pull setting to use.151151+ *152152+ * Run s3c_gpio_cfgpin() and s3c_gpio_setpull() over the gpio range starting153153+ * @gpio and running for @size.154154+ *155155+ * @sa s3c_gpio_cfgpin156156+ * @sa s3c_gpio_setpull157157+ * @sa s3c_gpio_cfgpin_range158158+ */159159+extern int s3c_gpio_cfgall_range(unsigned int start, unsigned int nr,160160+ unsigned int cfg, s3c_gpio_pull_t pull);161161+162162+static inline int s3c_gpio_cfgrange_nopull(unsigned int pin, unsigned int size,163163+ unsigned int cfg)164164+{165165+ return s3c_gpio_cfgall_range(pin, size, cfg, S3C_GPIO_PULL_NONE);166166+}167167+156168/* Define values for the drvstr available for each gpio pin.157169 *158170 * These values control the value of the output signal driver strength,···206168 * cannot support the requested setting.207169*/208170extern int s5p_gpio_set_drvstr(unsigned int pin, s5p_gpio_drvstr_t drvstr);171171+172172+/**173173+ * s5p_register_gpio_interrupt() - register interrupt support for a gpio group174174+ * @pin: The pin number from the group to be registered175175+ *176176+ * This function registers gpio interrupt support for the group that the177177+ * specified pin belongs to.178178+ *179179+ * The total number of gpio pins is quite large ob s5p series. Registering180180+ * irq support for all of them would be a resource waste. Because of that the181181+ * interrupt support for standard gpio pins is registered dynamically.182182+ *183183+ * It will return the irq number of the interrupt that has been registered184184+ * or -ENOMEM if no more gpio interrupts can be registered. It is allowed185185+ * to call this function more than once for the same gpio group (the group186186+ * will be registered only once).187187+ */188188+extern int s5p_register_gpio_interrupt(int pin);209189210190#endif /* __PLAT_GPIO_CFG_H */
+15
arch/arm/plat-samsung/include/plat/gpio-core.h
···4343 * struct s3c_gpio_chip - wrapper for specific implementation of gpio4444 * @chip: The chip structure to be exported via gpiolib.4545 * @base: The base pointer to the gpio configuration registers.4646+ * @group: The group register number for gpio interrupt support.4747+ * @irq_base: The base irq number.4648 * @config: special function and pull-resistor control information.4749 * @lock: Lock for exclusive access to this gpio bank.4850 * @pm_save: Save information for suspend/resume support.···6563 struct s3c_gpio_cfg *config;6664 struct s3c_gpio_pm *pm;6765 void __iomem *base;6666+ int irq_base;6767+ int group;6868 spinlock_t lock;6969#ifdef CONFIG_PM7070 u32 pm_save[4];···121117122118extern void samsung_gpiolib_add_4bit(struct s3c_gpio_chip *chip);123119extern void samsung_gpiolib_add_4bit2(struct s3c_gpio_chip *chip);120120+121121+122122+/**123123+ * samsung_gpiolib_to_irq - convert gpio pin to irq number124124+ * @chip: The gpio chip that the pin belongs to.125125+ * @offset: The offset of the pin in the chip.126126+ *127127+ * This helper returns the irq number calculated from the chip->irq_base and128128+ * the provided offset.129129+ */130130+extern int samsung_gpiolib_to_irq(struct gpio_chip *chip, unsigned int offset);124131125132/* exported for core SoC support to change */126133extern struct s3c_gpio_cfg s3c24xx_gpiocfg_default;
···1414#ifndef __ASM_PLAT_MAP_H1515#define __ASM_PLAT_MAP_H __FILE__16161717-/* Fit all our registers in at 0xF4000000 upwards, trying to use as1717+/* Fit all our registers in at 0xF6000000 upwards, trying to use as1818 * little of the VA space as possible so vmalloc and friends have a1919 * better chance of getting memory.2020 *···2222 * an single MOVS instruction (ie, only 8 bits of set data)2323 */24242525-#define S3C_ADDR_BASE (0xF4000000)2525+#define S3C_ADDR_BASE 0xF600000026262727#ifndef __ASSEMBLY__2828#define S3C_ADDR(x) ((void __iomem __force *)S3C_ADDR_BASE + (x))
+28
arch/arm/plat-samsung/include/plat/nand-core.h
···11+/* arch/arm/plat-samsung/include/plat/nand-core.h22+ *33+ * Copyright (c) 2010 Samsung Electronics Co., Ltd.44+ * http://www.samsung.com/55+ *66+ * S3C - Nand Controller core functions77+ *88+ * This program is free software; you can redistribute it and/or modify99+ * it under the terms of the GNU General Public License version 2 as1010+ * published by the Free Software Foundation.1111+*/1212+1313+#ifndef __ASM_ARCH_NAND_CORE_H1414+#define __ASM_ARCH_NAND_CORE_H __FILE__1515+1616+/* These functions are only for use with the core support code, such as1717+ * the cpu specific initialisation code1818+ */1919+2020+/* re-define device name depending on support. */2121+static inline void s3c_nand_setname(char *name)2222+{2323+#ifdef CONFIG_S3C_DEV_NAND2424+ s3c_device_nand.name = name;2525+#endif2626+}2727+2828+#endif /* __ASM_ARCH_NAND_CORE_H */
+64
arch/arm/plat-samsung/include/plat/sdhci.h
···2828 S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */2929};30303131+enum clk_types {3232+ S3C_SDHCI_CLK_DIV_INTERNAL, /* use mmc internal clock divider */3333+ S3C_SDHCI_CLK_DIV_EXTERNAL, /* use external clock divider */3434+};3535+3136/**3237 * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI3338 * @max_width: The maximum number of data bits supported.3439 * @host_caps: Standard MMC host capabilities bit field.3540 * @cd_type: Type of Card Detection method (see cd_types enum above)4141+ * @clk_type: Type of clock divider method (see clk_types enum above)3642 * @ext_cd_init: Initialize external card detect subsystem. Called on3743 * sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL.3844 * notify_func argument is a callback to the sdhci-s3c driver···6559 unsigned int max_width;6660 unsigned int host_caps;6761 enum cd_types cd_type;6262+ enum clk_types clk_type;68636964 char **clocks; /* set of clock sources */7065···117110extern void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *, int w);118111extern void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *, int w);119112extern void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *, int w);113113+extern void s5pv310_setup_sdhci0_cfg_gpio(struct platform_device *, int w);114114+extern void s5pv310_setup_sdhci1_cfg_gpio(struct platform_device *, int w);115115+extern void s5pv310_setup_sdhci2_cfg_gpio(struct platform_device *, int w);116116+extern void s5pv310_setup_sdhci3_cfg_gpio(struct platform_device *, int w);120117121118/* S3C64XX SDHCI setup */122119···298287static inline void s5pv210_default_sdhci3(void) { }299288300289#endif /* CONFIG_S5PV210_SETUP_SDHCI */290290+291291+/* S5PV310 SDHCI setup */292292+#ifdef CONFIG_S5PV310_SETUP_SDHCI293293+extern char *s5pv310_hsmmc_clksrcs[4];294294+295295+extern void s5pv310_setup_sdhci_cfg_card(struct platform_device *dev,296296+ void __iomem *r,297297+ struct mmc_ios *ios,298298+ struct mmc_card *card);299299+300300+static inline void s5pv310_default_sdhci0(void)301301+{302302+#ifdef CONFIG_S3C_DEV_HSMMC303303+ s3c_hsmmc0_def_platdata.clocks = s5pv310_hsmmc_clksrcs;304304+ s3c_hsmmc0_def_platdata.cfg_gpio = s5pv310_setup_sdhci0_cfg_gpio;305305+ s3c_hsmmc0_def_platdata.cfg_card = s5pv310_setup_sdhci_cfg_card;306306+#endif307307+}308308+309309+static inline void s5pv310_default_sdhci1(void)310310+{311311+#ifdef CONFIG_S3C_DEV_HSMMC1312312+ s3c_hsmmc1_def_platdata.clocks = s5pv310_hsmmc_clksrcs;313313+ s3c_hsmmc1_def_platdata.cfg_gpio = s5pv310_setup_sdhci1_cfg_gpio;314314+ s3c_hsmmc1_def_platdata.cfg_card = s5pv310_setup_sdhci_cfg_card;315315+#endif316316+}317317+318318+static inline void s5pv310_default_sdhci2(void)319319+{320320+#ifdef CONFIG_S3C_DEV_HSMMC2321321+ s3c_hsmmc2_def_platdata.clocks = s5pv310_hsmmc_clksrcs;322322+ s3c_hsmmc2_def_platdata.cfg_gpio = s5pv310_setup_sdhci2_cfg_gpio;323323+ s3c_hsmmc2_def_platdata.cfg_card = s5pv310_setup_sdhci_cfg_card;324324+#endif325325+}326326+327327+static inline void s5pv310_default_sdhci3(void)328328+{329329+#ifdef CONFIG_S3C_DEV_HSMMC3330330+ s3c_hsmmc3_def_platdata.clocks = s5pv310_hsmmc_clksrcs;331331+ s3c_hsmmc3_def_platdata.cfg_gpio = s5pv310_setup_sdhci3_cfg_gpio;332332+ s3c_hsmmc3_def_platdata.cfg_card = s5pv310_setup_sdhci_cfg_card;333333+#endif334334+}335335+336336+#else337337+static inline void s5pv310_default_sdhci0(void) { }338338+static inline void s5pv310_default_sdhci1(void) { }339339+static inline void s5pv310_default_sdhci2(void) { }340340+static inline void s5pv310_default_sdhci3(void) { }341341+342342+#endif /* CONFIG_S5PV310_SETUP_SDHCI */301343302344#endif /* __PLAT_S3C_SDHCI_H */
···1515#include <linux/io.h>1616#include <linux/slab.h>1717#include <linux/platform_device.h>1818+#include <linux/clk.h>1919+#include <linux/err.h>18201921#include <asm/hardware/pl330.h>2022···2927 * @node: To attach to the global list of DMACs.3028 * @pi: PL330 configuration info for the DMAC.3129 * @kmcache: Pool to quickly allocate xfers for all channels in the dmac.3030+ * @clk: Pointer of DMAC operation clock.3231 */3332struct s3c_pl330_dmac {3433 unsigned busy_chan;···3734 struct list_head node;3835 struct pl330_info *pi;3936 struct kmem_cache *kmcache;3737+ struct clk *clk;4038};41394240/**···10761072 if (ret)10771073 goto probe_err4;1078107410791079- ret = pl330_add(pl330_info);10801080- if (ret)10811081- goto probe_err5;10821082-10831075 /* Allocate a new DMAC */10841076 s3c_pl330_dmac = kmalloc(sizeof(*s3c_pl330_dmac), GFP_KERNEL);10851077 if (!s3c_pl330_dmac) {10861078 ret = -ENOMEM;10791079+ goto probe_err5;10801080+ }10811081+10821082+ /* Get operation clock and enable it */10831083+ s3c_pl330_dmac->clk = clk_get(&pdev->dev, "pdma");10841084+ if (IS_ERR(s3c_pl330_dmac->clk)) {10851085+ dev_err(&pdev->dev, "Cannot get operation clock.\n");10861086+ ret = -EINVAL;10871087 goto probe_err6;10881088 }10891089+ clk_enable(s3c_pl330_dmac->clk);10901090+10911091+ ret = pl330_add(pl330_info);10921092+ if (ret)10931093+ goto probe_err7;1089109410901095 /* Hook the info */10911096 s3c_pl330_dmac->pi = pl330_info;···1107109411081095 if (!s3c_pl330_dmac->kmcache) {11091096 ret = -ENOMEM;11101110- goto probe_err7;10971097+ goto probe_err8;11111098 }1112109911131100 /* Get the list of peripherals */···1133112011341121 return 0;1135112211361136-probe_err7:11371137- kfree(s3c_pl330_dmac);11381138-probe_err6:11231123+probe_err8:11391124 pl330_del(pl330_info);11251125+probe_err7:11261126+ clk_disable(s3c_pl330_dmac->clk);11271127+ clk_put(s3c_pl330_dmac->clk);11281128+probe_err6:11291129+ kfree(s3c_pl330_dmac);11401130probe_err5:11411131 free_irq(irq, pl330_info);11421132probe_err4:···12031187 kfree(ch);12041188 }12051189 }11901190+11911191+ /* Disable operation clock */11921192+ clk_disable(dmac->clk);11931193+ clk_put(dmac->clk);1206119412071195 /* Remove the DMAC */12081196 list_del(&dmac->node);