summaryrefslogtreecommitdiff
path: root/arch/arm/mach-at91
AgeCommit message (Collapse)Author
2015-03-13ARM: at91: sama5 use SoC detection infrastructureAlexandre Belloni
Use the soc detection infrastructure for sama5 initialization. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91: at91sam9: use SoC detection infrastructureAlexandre Belloni
Use the soc detection infrastructure for at91sam9 initialization. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91: at91rm9200 use SoC detection infrastructureAlexandre Belloni
Use the soc detection infrastructure for at91rm9200 initialization. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91: add soc detection infrastructureBoris BREZILLON
Add new structures and functions to handle AT91 SoC detection. [alexandre.belloni@free-electrons.com: reworked DBGU detection] Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91: remove unused _matrix.h headersAlexandre Belloni
The matrix headers are not used anymore, remove them. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91: remove unused at91_ioremap_matrix and headerAlexandre Belloni
at91_ioremap_matrix and the at91_matrix.h header are not used anymore, remove them. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91: remove NEED_MACH_IO_HArnd Bergmann
The mach/io.h header on at91 is used to support a nonstandard I/O space window for the cf card driver. This changes the driver to use pci_ioremap_io in order to have the standard location, and then removes the custom mach/io.h. [alexandre.belloni@free-electrons.com: Added PCI dependency] Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91/pm: flush data cache and clean, invalidate and disable the L2 cacheWenyou Yang
Flush data cache, and clean, invalidate and disable the L2 cache before going to suspend. Restore the L2 cache configuration and re-enable the L2 cache after waking up. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91/pm_suspend: add the WFI instruction support for ARMv7Wenyou Yang
Add the WFI instruction to make the cpu to the idle state. In the meanwhile, disable the processor's clock. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91/pm: remove unused void (*at91_pm_standby)(void)Wenyou Yang
Because the standby mode use the same sram function as the suspend to memory mode, void (*at91_pm_standby)(void) doesn't need, remove it. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91/pm: rename function name: at91_slow_clock() --> ↵Wenyou Yang
at91_pm_suspend_sram_fn() As the file name is renamed, rename the function name at91_slow_clock() --> at91_pm_suspend_sram_fn(), rename the function handler's name at the same time. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> [nicolas.ferre@atmel.com: little update of the commit message] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91/pm: rename file name: pm_slowclock.S --> pm_suspend.SWenyou Yang
Because the sram function is used for both suspend to memory and the suspend to standby mode, renaming is more elegant. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91/pm: standby mode uses same sram function as suspend to memory modeWenyou Yang
To simply the PM code, the suspend to standby mode uses same sram function as the suspend to memory mode, running in the internal SRAM, instead of the respective code for each mode. For the suspend to standby mode, the master clock doesn't switch to the slow clock, and PLLA and the main oscillator doesn't turn off as well. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91/pm: move the copying the sram function to the sram initialization ↵Wenyou Yang
phase To decrease the suspend time, move copying the sram function to the sram initialization phase, instead of every time go to suspend. In the meanwhile, substitute fncpy() for memcpy(). If there is no sram allocated for PM, the PM is not supported. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91/pm_slowclock: create the procedure to handle the sdram self-refreshWenyou Yang
To decrease the duplicated code, create the procedure to contain both activing and exiting the sdram self-refresh mode. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91/pm_slowclock: remove clocks which are already stopped when ↵Sylvain Rochet
entering slow clock mode Assume USB PLL and PLL B are already stopped before entering sleep mode. Removed PLL B from slow clock code, all drivers are supposed to properly unprepare clocks. Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Acked-by: Wenyou.Yang <wenyou.yang@atmel.com> [nicolas.ferre@atmel.com: remove the warning printed in pm.c] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91/pm: remove CONFIG_AT91_SLOW_CLOCK config optionWenyou Yang
The slow clock always exists, selecting CONFIG_AT91_SLOW_CLOCK config is unnecessary for the suspend to memory mode. For this mode the master clock should always switch to the slow clock. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91: move "select SRAM" under SOC_AT91SAM9 and SOC_SAMA5Wenyou Yang
To simply the PM config the CONFIG_AT91_SLOW_CLOCK option will be removed, so move "select SRAM" from under AT91_SLOW_CLOCK, add "select SRAM if PM" under SOC_AT91SAM9 and SOC_SAMA5 Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-13ARM: at91/pm_slowclock: remove the unused code related with ↵Wenyou Yang
SLOWDOWN_MASTER_CLOCK The SLOWDOWN_MASTER_CLOCK definition is not used, remove the redundant code. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-12ARM: at91: pm: change at91_pm_set_standby() to staticWenyou Yang
Since at91_pm_set_standby() will not be used out of the pm.c file, change its attribute from extern to static, remove its declaration as well. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-12ARM: at91: remove ksz8081 phy fixup registration for sama5d4ek boardBoris Brezillon
Commit 2b0ba96cea60 ("net: phy: micrel: disable NAND-tree for KSZ8021, KSZ8031, KSZ8051, KSZ8081") automated the NAND-tree mode deactivation process, thus making this phy fixup useless. Remove it along with the associated headers inclusion. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> [nicolas.ferre@atmel.com: remove selection of PHYLIB in at91 Kconfig] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-11ARM: at91: pm_slowclock: fix the compilation errorWenyou Yang
When compiling the kernel in thumb2 (CONFIG_THUMB2_KERNEL option activated), we hit a compilation crash. The error message is listed below: ---8< ----- Error: cannot use register index with PC-relative addressing -- `str r0,.saved_lpr' --->8---- Add the .arm directive in the assembly files related to power management. Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-05ARM: at91/pm: MOR register KEY was missingPatrice Vilchez
Because writing the MOR register requires the PASSWD(0x37), if missed, the write operation will be aborted. Signed-off-by: Patrice Vilchez <patrice.vilchez@atmel.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-03ARM: at91: pm: fix SRAM allocationAlexandre Belloni
On some platforms, there are multiple SRAM nodes defined in the device tree but some of them are disabled, leading to allocation failure. Try to find the first enabled SRAM node and allocate from it. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Tested-by: Wenyou Yang <wenyou.yang@atmel.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-03ARM: at91: pm: fix at91rm9200 standbyAlexandre Belloni
at91rm9200 standby and suspend to ram has been broken since 00482a4078f4. It is wrongly using AT91_BASE_SYS which is a physical address and actually doesn't correspond to any register on at91rm9200. Use the correct at91_ramc_base[0] instead. Fixes: 00482a4078f4 (ARM: at91: implement the standby function for pm/cpuidle) Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-03pm: at91: Workaround DDRSDRC self-refresh bug with LPDDR1 memories.Peter Rosin
The DDRSDR controller fails miserably to put LPDDR1 memories in self-refresh. Force the controller to think it has DDR2 memories during the self-refresh period, as the DDR2 self-refresh spec is equivalent to LPDDR1, and is correctly implemented in the controller. Assume that the second controller has the same fault, but that is untested. Signed-off-by: Peter Rosin <peda@axentia.se> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-03-03pm: at91: pm_slowclock: fix suspend/resume hang up in timeoutsSylvain Rochet
Removed timeout on XTAL, PLL lock and Master Clock Ready, hang if something went wrong instead of continuing in unknown condition. There is not much we can do if a PLL lock never ends, we are running in SRAM and we will not be able to connect back the sdram or ddram in order to be able to fire up a message or just panic. As a bonus, not decounting the timeout register in slow clock mode reduce cumulated suspend time and resume time from ~17ms to ~15ms. Signed-off-by: Sylvain Rochet <sylvain.rochet@finsecur.com> Acked-by: Wenyou.Yang <wenyou.yang@atmel.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-02-19ARM: make of_device_ids constUwe Kleine-König
of_device_ids (i.e. compatible strings and the respective data) are not supposed to change at runtime. All functions working with of_device_ids provided by <linux/of.h> work with const of_device_ids. So mark the non-const structs in arch/arm as const, too. While at it also add some __initconst annotations. Acked-by: Jason Cooper <jason@lakedameon.net> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2015-02-18ARM: mm: Remove Kconfig symbol CACHE_PL310Paul Bolle
Commit 20e783e39e55 ("ARM: 8296/1: cache-l2x0: clean up aurora cache handling") removed the only user of the Kconfig symbol CACHE_PL310. Setting CACHE_PL310 is now pointless. Remove its Kconfig entry, and one select of this symbol. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2015-02-18ARM: at91: fix pm declarationsArnd Bergmann
In a recent rearrangement of the at91 pm initialization code, a broken set of declarations was added for the !CONFIG_PM-case, leading to this link error: arch/arm/mach-at91/board-dt-sama5.o: In function `at91_rm9200_pm_init': arch/arm/mach-at91/generic.h:40: multiple definition of `at91_rm9200_pm_init' arch/arm/mach-at91/setup.o:arch/arm/mach-at91/generic.h:40: first defined here arch/arm/mach-at91/board-dt-sama5.o: In function `at91_sam9260_pm_init': arch/arm/mach-at91/generic.h:41: multiple definition of `at91_sam9260_pm_init' arch/arm/mach-at91/setup.o:arch/arm/mach-at91/generic.h:41: first defined here arch/arm/mach-at91/board-dt-sama5.o: In function `at91_sam9g45_pm_init': arch/arm/mach-at91/generic.h:42: multiple definition of `at91_sam9g45_pm_init' arch/arm/mach-at91/setup.o:arch/arm/mach-at91/generic.h:42: first defined here This adds the missing 'static inline' to the declarations to avoid creating a copy of the functions in each file that includes the header. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 4db0ba22da9 ("ARM: at91: pm: prepare for multiplatform") Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2015-02-02ARM: at91/trivial: unify functions and machine namesNicolas Ferre
Remove the string "(Device Tree)" after the machine name because all AT91 machines use the DT nowadays. Also change some function names to unify following the convention: - at91sam9xxx aren't named sam9, 9xxx but with the full name - sama5 are the ones that don't have the at91 prefix anymore. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-02-02ARM: at91: remove at91_dt_initialize and machine init_early()Alexandre Belloni
Move the ramc initialization to pm.c as it is the only user left. This allows us to get rid of at91_dt_initialize() that was the only one called by the init_early() function pointer of struct machine_desc. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> [nicolas.ferre@atmel.com: adapt patch to newer series] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-02-02ARM: at91: change board files into SoC filesNicolas Ferre
As board files are now DT only and can address all aspects of the SoC family, we can rename them so that the mach-at91 directory looks cleaner. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-02-02ARM: at91: remove at91_boot_socAlexandre Belloni
at91_boot_soc and at91_init_soc structures are not used by any SoC, remove their use. Also remove all the now empty SoC files. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> [nicolas.ferre@atmel.com: different organization of the patches] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-02-02ARM: at91: move alternative initial mapping to board-dt-sama5.cNicolas Ferre
For sama5d4, remove an indirection and the remaining need for at91_boot_soc structure. This will allow further cleanup. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-02-02ARM: at91: merge all SOC_AT91SAM9xxxAlexandre Belloni
Only use SOC_AT91SAM9 for all the at91sam9 SoCs. It removes all the empty at91sam9xxx.c SoC files. It also removes the useless at91_init_soc affectation procedure and its "init" function pointer. Only the SoC detection and display are kept for the at91sam9: at91_soc_is_enabled() and at91_boot_soc.map_io() function calls are also removed. It enables HAVE_AT91_SMD and HAVE_AT91_UTMI for all the sam9 SoCs but this only represents 96 bytes of uncompressed kernel code. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> [nicolas.ferre@atmel.com: different organization of the patches] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-02-02ARM: at91: at91rm9200: set idle and restart from rm9200_dt_device_init()Alexandre Belloni
Setup arm_pm_idle and arm_pm_restart function pointers from rm9200_dt_device_init() function to simplify the at91rm9200 initialization process. This same move is already done for the sam9s. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> [nicolas.ferre@atmel.com: adapt patch to newer series] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-02-02Merge tag 'at91-cleanup3' into at91-3.20-socNicolas Ferre
2015-01-26ARM: at91: pm: remove warning to remove SOC_AT91SAM9263 usageAlexandre Belloni
The SOC_AT91SAM9263 is being removed, stop using it. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-01-26ARM: at91: remove unused mach/system_rev.hAlexandre Belloni
mach/system_rev.h is not used, remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-01-26ARM: at91: stop using HAVE_AT91_DBGUxAlexandre Belloni
In order to remove SOC_SAM9xxx options, stop using HAVE_AT91_DBGUx. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-01-26ARM: at91: fix ordering of SRAM and PM initializationNicolas Ferre
The PM initialization needs internal SRAM for allocating a gen_pool and use it to store its PM code. So we need to have of_platform_populate() before this code. Suggested-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-01-26ARM: at91: sam9: set arm_pm_idle from sam9_dt_device_initAlexandre Belloni
As all sam9 SoCs are setting arm_pm_idle to at91sam9_idle(), do it from sam9_dt_device_init(). Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Suggested-by: Arnd Bergmann <arnd@arndb.de> [nicolas.ferre@atmel.com: adapt patch to newer series] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-01-26ARM: at91: fix sam9n12 and sam9x5 arm_pm_idleAlexandre Belloni
sam9n12 and sam9x5 don't set arm_pm_idle because of an oversight, fix that. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-01-26ARM: at91: mark const init data with __initconst instead of __initdataAlexandre Belloni
As long as there is no other non-const variable marked __initdata in the same compilation unit it doesn't hurt. If there were one however compilation would fail with error: $variablename causes a section type conflict because a section containing const variables is marked read only and so cannot contain non-const variables. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> [nicolas.ferre@atmel.com: update the paths after having re-arranged the patches] Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-01-26ARM: at91: fix PM initialization for newer SoCsNicolas Ferre
Newer SoCs: at91sam9x5, at91sam9n12, sama5d3 and sama5d4 embed a DDR controller and have a different PMC status register layout than the at91sam9g45. Create another at91_sam9x5_pm_init() function to match this compatibility. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-01-16ARM: at91: move at91rm9200_idle() to clk/at91/pmc.cAlexandre Belloni
Move at91rm9200_idle() along with at91sam9_idle() in clk/at91/pmc.c. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Michael Turquette <mturquette@linaro.org> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-01-16ARM: at91: remove unused at91_init_sramAlexandre Belloni
SRAM initialization is now done through the mmio-sram driver and at91_init_sram() is not called anymore, remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-01-16ARM: at91: sama5d4: remove useless call to at91_init_sramAlexandre Belloni
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
2015-01-16ARM: at91: remove useless map_ioAlexandre Belloni
Now that the SRAM is initialized by the mmio-sram driver, .map_io is useless. remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>