Loading MAINTAINERS +2 −2 Original line number Diff line number Diff line Loading @@ -5303,8 +5303,8 @@ F: drivers/*/*s3c2410* F: drivers/*/*/*s3c2410* TI DAVINCI MACHINE SUPPORT P: Kevin Hilman M: davinci-linux-open-source@linux.davincidsp.com M: Kevin Hilman <khilman@deeprootsystems.com> L: davinci-linux-open-source@linux.davincidsp.com (subscribers-only) Q: http://patchwork.kernel.org/project/linux-davinci/list/ S: Supported F: arch/arm/mach-davinci Loading arch/arm/configs/da8xx_omapl_defconfig +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ CONFIG_MODVERSIONS=y CONFIG_ARCH_DAVINCI=y CONFIG_ARCH_DAVINCI_DA830=y CONFIG_ARCH_DAVINCI_DA850=y CONFIG_MACH_MITYOMAPL138=y CONFIG_MACH_OMAPL138_HAWKBOARD=y CONFIG_DAVINCI_RESET_CLOCKS=y CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y Loading Loading @@ -79,6 +81,7 @@ CONFIG_I2C_DAVINCI=y # CONFIG_HWMON is not set CONFIG_WATCHDOG=y CONFIG_REGULATOR=y CONFIG_REGULATOR_DUMMY=y CONFIG_REGULATOR_TPS6507X=y CONFIG_FB=y CONFIG_FB_DA8XX=y Loading arch/arm/mach-davinci/Kconfig +46 −30 Original line number Diff line number Diff line Loading @@ -30,13 +30,13 @@ config ARCH_DAVINCI_DM646x select ARCH_DAVINCI_DMx config ARCH_DAVINCI_DA830 bool "DA830/OMAP-L137 based system" bool "DA830/OMAP-L137/AM17x based system" select CP_INTC select ARCH_DAVINCI_DA8XX select CPU_DCACHE_WRITETHROUGH # needed on silicon revs 1.0, 1.1 config ARCH_DAVINCI_DA850 bool "DA850/OMAP-L138 based system" bool "DA850/OMAP-L138/AM18x based system" select CP_INTC select ARCH_DAVINCI_DA8XX select ARCH_HAS_CPUFREQ Loading Loading @@ -115,21 +115,21 @@ config MACH_DAVINCI_DM365_EVM for development is a DM365 EVM config MACH_DAVINCI_DA830_EVM bool "TI DA830/OMAP-L137 Reference Platform" bool "TI DA830/OMAP-L137/AM17x Reference Platform" default ARCH_DAVINCI_DA830 depends on ARCH_DAVINCI_DA830 select GPIO_PCF857X help Say Y here to select the TI DA830/OMAP-L137 Evaluation Module. Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module. choice prompt "Select DA830/OMAP-L137 UI board peripheral" prompt "Select DA830/OMAP-L137/AM17x UI board peripheral" depends on MACH_DAVINCI_DA830_EVM help The presence of UI card on the DA830/OMAP-L137 EVM is detected automatically based on successful probe of the I2C based GPIO expander on that board. This option selected in this menu has an effect only in case of a successful UI card detection. The presence of UI card on the DA830/OMAP-L137/AM17x EVM is detected automatically based on successful probe of the I2C based GPIO expander on that board. This option selected in this menu has an effect only in case of a successful UI card detection. config DA830_UI_LCD bool "LCD" Loading @@ -145,18 +145,18 @@ config DA830_UI_NAND endchoice config MACH_DAVINCI_DA850_EVM bool "TI DA850/OMAP-L138 Reference Platform" bool "TI DA850/OMAP-L138/AM18x Reference Platform" default ARCH_DAVINCI_DA850 depends on ARCH_DAVINCI_DA850 select GPIO_PCA953X help Say Y here to select the TI DA850/OMAP-L138 Evaluation Module. Say Y here to select the TI DA850/OMAP-L138/AM18x Evaluation Module. choice prompt "Select peripherals connected to expander on UI board" depends on MACH_DAVINCI_DA850_EVM help The presence of User Interface (UI) card on the DA850/OMAP-L138 The presence of User Interface (UI) card on the DA850/OMAP-L138/AM18x EVM is detected automatically based on successful probe of the I2C based GPIO expander on that card. This option selected in this menu has an effect only in case of a successful UI card detection. Loading @@ -165,13 +165,13 @@ config DA850_UI_NONE bool "No peripheral is enabled" help Say Y if you do not want to enable any of the peripherals connected to TCA6416 expander on DA850/OMAP-L138 EVM UI card to TCA6416 expander on DA850/OMAP-L138/AM18x EVM UI card config DA850_UI_RMII bool "RMII Ethernet PHY" help Say Y if you want to use the RMII PHY on the DA850/OMAP-L138 EVM. This PHY is found on the UI daughter card that is supplied with Say Y if you want to use the RMII PHY on the DA850/OMAP-L138/AM18x EVM. This PHY is found on the UI daughter card that is supplied with the EVM. NOTE: Please take care while choosing this option, MII PHY will not be functional if RMII mode is selected. Loading @@ -185,6 +185,22 @@ config MACH_TNETV107X help Say Y here to select the TI TNETV107X Evaluation Module. config MACH_MITYOMAPL138 bool "Critical Link MityDSP-L138/MityARM-1808 SoM" depends on ARCH_DAVINCI_DA850 help Say Y here to select the Critical Link MityDSP-L138/MityARM-1808 System on Module. Information on this SoM may be found at http://www.mitydsp.com config MACH_OMAPL138_HAWKBOARD bool "TI AM1808 / OMAPL-138 Hawkboard platform" depends on ARCH_DAVINCI_DA850 help Say Y here to select the TI AM1808 / OMAPL-138 Hawkboard platform . Information of this board may be found at http://www.hawkboard.org/ config DAVINCI_MUX bool "DAVINCI multiplexing support" depends on ARCH_DAVINCI Loading arch/arm/mach-davinci/Makefile +3 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ # Common objects obj-y := time.o clock.o serial.o io.o psc.o \ gpio.o dma.o usb.o common.o sram.o gpio.o dma.o usb.o common.o sram.o aemif.o obj-$(CONFIG_DAVINCI_MUX) += mux.o Loading Loading @@ -33,6 +33,8 @@ obj-$(CONFIG_MACH_DAVINCI_DM365_EVM) += board-dm365-evm.o obj-$(CONFIG_MACH_DAVINCI_DA830_EVM) += board-da830-evm.o obj-$(CONFIG_MACH_DAVINCI_DA850_EVM) += board-da850-evm.o obj-$(CONFIG_MACH_TNETV107X) += board-tnetv107x-evm.o obj-$(CONFIG_MACH_MITYOMAPL138) += board-mityomapl138.o obj-$(CONFIG_MACH_OMAPL138_HAWKBOARD) += board-omapl138-hawk.o # Power Management obj-$(CONFIG_CPU_FREQ) += cpufreq.o Loading arch/arm/mach-davinci/aemif.c 0 → 100644 +133 −0 Original line number Diff line number Diff line /* * AEMIF support for DaVinci SoCs * * Copyright (C) 2010 Texas Instruments Incorporated. http://www.ti.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/kernel.h> #include <linux/io.h> #include <linux/err.h> #include <linux/clk.h> #include <linux/module.h> #include <linux/time.h> #include <mach/aemif.h> /* Timing value configuration */ #define TA(x) ((x) << 2) #define RHOLD(x) ((x) << 4) #define RSTROBE(x) ((x) << 7) #define RSETUP(x) ((x) << 13) #define WHOLD(x) ((x) << 17) #define WSTROBE(x) ((x) << 20) #define WSETUP(x) ((x) << 26) #define TA_MAX 0x3 #define RHOLD_MAX 0x7 #define RSTROBE_MAX 0x3f #define RSETUP_MAX 0xf #define WHOLD_MAX 0x7 #define WSTROBE_MAX 0x3f #define WSETUP_MAX 0xf #define TIMING_MASK (TA(TA_MAX) | \ RHOLD(RHOLD_MAX) | \ RSTROBE(RSTROBE_MAX) | \ RSETUP(RSETUP_MAX) | \ WHOLD(WHOLD_MAX) | \ WSTROBE(WSTROBE_MAX) | \ WSETUP(WSETUP_MAX)) /* * aemif_calc_rate - calculate timing data. * @wanted: The cycle time needed in nanoseconds. * @clk: The input clock rate in kHz. * @max: The maximum divider value that can be programmed. * * On success, returns the calculated timing value minus 1 for easy * programming into AEMIF timing registers, else negative errno. */ static int aemif_calc_rate(int wanted, unsigned long clk, int max) { int result; result = DIV_ROUND_UP((wanted * clk), NSEC_PER_MSEC) - 1; pr_debug("%s: result %d from %ld, %d\n", __func__, result, clk, wanted); /* It is generally OK to have a more relaxed timing than requested... */ if (result < 0) result = 0; /* ... But configuring tighter timings is not an option. */ else if (result > max) result = -EINVAL; return result; } /** * davinci_aemif_setup_timing - setup timing values for a given AEMIF interface * @t: timing values to be progammed * @base: The virtual base address of the AEMIF interface * @cs: chip-select to program the timing values for * * This function programs the given timing values (in real clock) into the * AEMIF registers taking the AEMIF clock into account. * * This function does not use any locking while programming the AEMIF * because it is expected that there is only one user of a given * chip-select. * * Returns 0 on success, else negative errno. */ int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, void __iomem *base, unsigned cs) { unsigned set, val; unsigned ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup; unsigned offset = A1CR_OFFSET + cs * 4; struct clk *aemif_clk; unsigned long clkrate; if (!t) return 0; /* Nothing to do */ aemif_clk = clk_get(NULL, "aemif"); if (IS_ERR(aemif_clk)) return PTR_ERR(aemif_clk); clkrate = clk_get_rate(aemif_clk); clkrate /= 1000; /* turn clock into kHz for ease of use */ ta = aemif_calc_rate(t->ta, clkrate, TA_MAX); rhold = aemif_calc_rate(t->rhold, clkrate, RHOLD_MAX); rstrobe = aemif_calc_rate(t->rstrobe, clkrate, RSTROBE_MAX); rsetup = aemif_calc_rate(t->rsetup, clkrate, RSETUP_MAX); whold = aemif_calc_rate(t->whold, clkrate, WHOLD_MAX); wstrobe = aemif_calc_rate(t->wstrobe, clkrate, WSTROBE_MAX); wsetup = aemif_calc_rate(t->wsetup, clkrate, WSETUP_MAX); if (ta < 0 || rhold < 0 || rstrobe < 0 || rsetup < 0 || whold < 0 || wstrobe < 0 || wsetup < 0) { pr_err("%s: cannot get suitable timings\n", __func__); return -EINVAL; } set = TA(ta) | RHOLD(rhold) | RSTROBE(rstrobe) | RSETUP(rsetup) | WHOLD(whold) | WSTROBE(wstrobe) | WSETUP(wsetup); val = __raw_readl(base + offset); val &= ~TIMING_MASK; val |= set; __raw_writel(val, base + offset); return 0; } EXPORT_SYMBOL(davinci_aemif_setup_timing); Loading
MAINTAINERS +2 −2 Original line number Diff line number Diff line Loading @@ -5303,8 +5303,8 @@ F: drivers/*/*s3c2410* F: drivers/*/*/*s3c2410* TI DAVINCI MACHINE SUPPORT P: Kevin Hilman M: davinci-linux-open-source@linux.davincidsp.com M: Kevin Hilman <khilman@deeprootsystems.com> L: davinci-linux-open-source@linux.davincidsp.com (subscribers-only) Q: http://patchwork.kernel.org/project/linux-davinci/list/ S: Supported F: arch/arm/mach-davinci Loading
arch/arm/configs/da8xx_omapl_defconfig +3 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,8 @@ CONFIG_MODVERSIONS=y CONFIG_ARCH_DAVINCI=y CONFIG_ARCH_DAVINCI_DA830=y CONFIG_ARCH_DAVINCI_DA850=y CONFIG_MACH_MITYOMAPL138=y CONFIG_MACH_OMAPL138_HAWKBOARD=y CONFIG_DAVINCI_RESET_CLOCKS=y CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y Loading Loading @@ -79,6 +81,7 @@ CONFIG_I2C_DAVINCI=y # CONFIG_HWMON is not set CONFIG_WATCHDOG=y CONFIG_REGULATOR=y CONFIG_REGULATOR_DUMMY=y CONFIG_REGULATOR_TPS6507X=y CONFIG_FB=y CONFIG_FB_DA8XX=y Loading
arch/arm/mach-davinci/Kconfig +46 −30 Original line number Diff line number Diff line Loading @@ -30,13 +30,13 @@ config ARCH_DAVINCI_DM646x select ARCH_DAVINCI_DMx config ARCH_DAVINCI_DA830 bool "DA830/OMAP-L137 based system" bool "DA830/OMAP-L137/AM17x based system" select CP_INTC select ARCH_DAVINCI_DA8XX select CPU_DCACHE_WRITETHROUGH # needed on silicon revs 1.0, 1.1 config ARCH_DAVINCI_DA850 bool "DA850/OMAP-L138 based system" bool "DA850/OMAP-L138/AM18x based system" select CP_INTC select ARCH_DAVINCI_DA8XX select ARCH_HAS_CPUFREQ Loading Loading @@ -115,21 +115,21 @@ config MACH_DAVINCI_DM365_EVM for development is a DM365 EVM config MACH_DAVINCI_DA830_EVM bool "TI DA830/OMAP-L137 Reference Platform" bool "TI DA830/OMAP-L137/AM17x Reference Platform" default ARCH_DAVINCI_DA830 depends on ARCH_DAVINCI_DA830 select GPIO_PCF857X help Say Y here to select the TI DA830/OMAP-L137 Evaluation Module. Say Y here to select the TI DA830/OMAP-L137/AM17x Evaluation Module. choice prompt "Select DA830/OMAP-L137 UI board peripheral" prompt "Select DA830/OMAP-L137/AM17x UI board peripheral" depends on MACH_DAVINCI_DA830_EVM help The presence of UI card on the DA830/OMAP-L137 EVM is detected automatically based on successful probe of the I2C based GPIO expander on that board. This option selected in this menu has an effect only in case of a successful UI card detection. The presence of UI card on the DA830/OMAP-L137/AM17x EVM is detected automatically based on successful probe of the I2C based GPIO expander on that board. This option selected in this menu has an effect only in case of a successful UI card detection. config DA830_UI_LCD bool "LCD" Loading @@ -145,18 +145,18 @@ config DA830_UI_NAND endchoice config MACH_DAVINCI_DA850_EVM bool "TI DA850/OMAP-L138 Reference Platform" bool "TI DA850/OMAP-L138/AM18x Reference Platform" default ARCH_DAVINCI_DA850 depends on ARCH_DAVINCI_DA850 select GPIO_PCA953X help Say Y here to select the TI DA850/OMAP-L138 Evaluation Module. Say Y here to select the TI DA850/OMAP-L138/AM18x Evaluation Module. choice prompt "Select peripherals connected to expander on UI board" depends on MACH_DAVINCI_DA850_EVM help The presence of User Interface (UI) card on the DA850/OMAP-L138 The presence of User Interface (UI) card on the DA850/OMAP-L138/AM18x EVM is detected automatically based on successful probe of the I2C based GPIO expander on that card. This option selected in this menu has an effect only in case of a successful UI card detection. Loading @@ -165,13 +165,13 @@ config DA850_UI_NONE bool "No peripheral is enabled" help Say Y if you do not want to enable any of the peripherals connected to TCA6416 expander on DA850/OMAP-L138 EVM UI card to TCA6416 expander on DA850/OMAP-L138/AM18x EVM UI card config DA850_UI_RMII bool "RMII Ethernet PHY" help Say Y if you want to use the RMII PHY on the DA850/OMAP-L138 EVM. This PHY is found on the UI daughter card that is supplied with Say Y if you want to use the RMII PHY on the DA850/OMAP-L138/AM18x EVM. This PHY is found on the UI daughter card that is supplied with the EVM. NOTE: Please take care while choosing this option, MII PHY will not be functional if RMII mode is selected. Loading @@ -185,6 +185,22 @@ config MACH_TNETV107X help Say Y here to select the TI TNETV107X Evaluation Module. config MACH_MITYOMAPL138 bool "Critical Link MityDSP-L138/MityARM-1808 SoM" depends on ARCH_DAVINCI_DA850 help Say Y here to select the Critical Link MityDSP-L138/MityARM-1808 System on Module. Information on this SoM may be found at http://www.mitydsp.com config MACH_OMAPL138_HAWKBOARD bool "TI AM1808 / OMAPL-138 Hawkboard platform" depends on ARCH_DAVINCI_DA850 help Say Y here to select the TI AM1808 / OMAPL-138 Hawkboard platform . Information of this board may be found at http://www.hawkboard.org/ config DAVINCI_MUX bool "DAVINCI multiplexing support" depends on ARCH_DAVINCI Loading
arch/arm/mach-davinci/Makefile +3 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ # Common objects obj-y := time.o clock.o serial.o io.o psc.o \ gpio.o dma.o usb.o common.o sram.o gpio.o dma.o usb.o common.o sram.o aemif.o obj-$(CONFIG_DAVINCI_MUX) += mux.o Loading Loading @@ -33,6 +33,8 @@ obj-$(CONFIG_MACH_DAVINCI_DM365_EVM) += board-dm365-evm.o obj-$(CONFIG_MACH_DAVINCI_DA830_EVM) += board-da830-evm.o obj-$(CONFIG_MACH_DAVINCI_DA850_EVM) += board-da850-evm.o obj-$(CONFIG_MACH_TNETV107X) += board-tnetv107x-evm.o obj-$(CONFIG_MACH_MITYOMAPL138) += board-mityomapl138.o obj-$(CONFIG_MACH_OMAPL138_HAWKBOARD) += board-omapl138-hawk.o # Power Management obj-$(CONFIG_CPU_FREQ) += cpufreq.o Loading
arch/arm/mach-davinci/aemif.c 0 → 100644 +133 −0 Original line number Diff line number Diff line /* * AEMIF support for DaVinci SoCs * * Copyright (C) 2010 Texas Instruments Incorporated. http://www.ti.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/kernel.h> #include <linux/io.h> #include <linux/err.h> #include <linux/clk.h> #include <linux/module.h> #include <linux/time.h> #include <mach/aemif.h> /* Timing value configuration */ #define TA(x) ((x) << 2) #define RHOLD(x) ((x) << 4) #define RSTROBE(x) ((x) << 7) #define RSETUP(x) ((x) << 13) #define WHOLD(x) ((x) << 17) #define WSTROBE(x) ((x) << 20) #define WSETUP(x) ((x) << 26) #define TA_MAX 0x3 #define RHOLD_MAX 0x7 #define RSTROBE_MAX 0x3f #define RSETUP_MAX 0xf #define WHOLD_MAX 0x7 #define WSTROBE_MAX 0x3f #define WSETUP_MAX 0xf #define TIMING_MASK (TA(TA_MAX) | \ RHOLD(RHOLD_MAX) | \ RSTROBE(RSTROBE_MAX) | \ RSETUP(RSETUP_MAX) | \ WHOLD(WHOLD_MAX) | \ WSTROBE(WSTROBE_MAX) | \ WSETUP(WSETUP_MAX)) /* * aemif_calc_rate - calculate timing data. * @wanted: The cycle time needed in nanoseconds. * @clk: The input clock rate in kHz. * @max: The maximum divider value that can be programmed. * * On success, returns the calculated timing value minus 1 for easy * programming into AEMIF timing registers, else negative errno. */ static int aemif_calc_rate(int wanted, unsigned long clk, int max) { int result; result = DIV_ROUND_UP((wanted * clk), NSEC_PER_MSEC) - 1; pr_debug("%s: result %d from %ld, %d\n", __func__, result, clk, wanted); /* It is generally OK to have a more relaxed timing than requested... */ if (result < 0) result = 0; /* ... But configuring tighter timings is not an option. */ else if (result > max) result = -EINVAL; return result; } /** * davinci_aemif_setup_timing - setup timing values for a given AEMIF interface * @t: timing values to be progammed * @base: The virtual base address of the AEMIF interface * @cs: chip-select to program the timing values for * * This function programs the given timing values (in real clock) into the * AEMIF registers taking the AEMIF clock into account. * * This function does not use any locking while programming the AEMIF * because it is expected that there is only one user of a given * chip-select. * * Returns 0 on success, else negative errno. */ int davinci_aemif_setup_timing(struct davinci_aemif_timing *t, void __iomem *base, unsigned cs) { unsigned set, val; unsigned ta, rhold, rstrobe, rsetup, whold, wstrobe, wsetup; unsigned offset = A1CR_OFFSET + cs * 4; struct clk *aemif_clk; unsigned long clkrate; if (!t) return 0; /* Nothing to do */ aemif_clk = clk_get(NULL, "aemif"); if (IS_ERR(aemif_clk)) return PTR_ERR(aemif_clk); clkrate = clk_get_rate(aemif_clk); clkrate /= 1000; /* turn clock into kHz for ease of use */ ta = aemif_calc_rate(t->ta, clkrate, TA_MAX); rhold = aemif_calc_rate(t->rhold, clkrate, RHOLD_MAX); rstrobe = aemif_calc_rate(t->rstrobe, clkrate, RSTROBE_MAX); rsetup = aemif_calc_rate(t->rsetup, clkrate, RSETUP_MAX); whold = aemif_calc_rate(t->whold, clkrate, WHOLD_MAX); wstrobe = aemif_calc_rate(t->wstrobe, clkrate, WSTROBE_MAX); wsetup = aemif_calc_rate(t->wsetup, clkrate, WSETUP_MAX); if (ta < 0 || rhold < 0 || rstrobe < 0 || rsetup < 0 || whold < 0 || wstrobe < 0 || wsetup < 0) { pr_err("%s: cannot get suitable timings\n", __func__); return -EINVAL; } set = TA(ta) | RHOLD(rhold) | RSTROBE(rstrobe) | RSETUP(rsetup) | WHOLD(whold) | WSTROBE(wstrobe) | WSETUP(wsetup); val = __raw_readl(base + offset); val &= ~TIMING_MASK; val |= set; __raw_writel(val, base + offset); return 0; } EXPORT_SYMBOL(davinci_aemif_setup_timing);