summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mvebu/common.c
Commit message (Collapse)AuthorAgeFilesLines
* treewide: Add missing includesSascha Hauer2019-03-181-0/+1
| | | | | | | | | Many files in the tree implement functions, but do not include the header files which provide the prototypes for these functions. This means conflicting prototypes remain undetected. Add the missing includes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dove: fix bit layout of DOVE_CPU_CTRL registerUwe Kleine-König2018-05-311-2/+2
| | | | | | | | | | | | | While creating the previous patch I checked the cpu's reference manual to see what the affected registers actually do and noticed that bits of the DOVE_CPU_CTRL actually used by the code doesn't match the bits described as AHBSlaveBase in the manual. I'm not aware of any effect (neither positive nor negative) of this patch. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* dove: move memory controller remapping before RAM detectionUwe Kleine-König2018-05-311-0/+29
| | | | | | | | | | | | | | | | | | Compared to other mvebu cpus the memory controller registers are in their own register window that can be moved independently of the mbus register window. Since commit f05c6e095cf8 the available RAM configured by the boot ROM is read out earlier. This happens to be before the memory controller register window is moved and so dove_memory_find() fails. To fix this move the memory controller window together with the mbus window. This change allows to boot barebox first stage again on a Solidrun Cubox. Fixes: f05c6e095cf8 ("mvebu: rework how memory is detected") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: fix size mask for RAM windowUwe Kleine-König2017-06-131-1/+1
| | | | | | | | | | The size field in the window control register occupies bits 31:16. So adapt ARMADA_370_XP_DDR_SIZE_MASK accordingly. This fixes detection of RAM chips smaller than 32 MiB and so probably doesn't affect any supported machine. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mvebu: get initial position of register window from image headerUwe Kleine-König2017-03-021-3/+3
| | | | | | | | | | | | | | | A problem when using 2nd stage booting on mvebu is that the first bootloader already switched the register window location from 0xd0000000 to 0xf1000000 by writing to 0xd0000080. When the second bootloader also tries to do this switch it writes to the wrong location resulting in an exception and so a boot failure. For this reason the base address of the register window is passed in the barebox header and picked up from there by early code. In a further patch bootm is taught to put the actual position of the window there for the second bootloader to finally make second stage booting work. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
* mvebu: rework how memory is detectedUwe Kleine-König2017-02-161-33/+120
| | | | | | | | | | | | | | Status quo is that initially a size of 64 MiB is assumed (which is also used to determine the size of the malloc area) and then later the dtb is fixed up with the actually available RAM which is then used. Instead detect the real RAM size earlier and don't fixup the device tree. The device tree is fixed up instead by generic code. This way the malloc area is more appropriately sized and RAM detection is more similar to mach-imx which is both nice. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* restart: replace reset_cpu with registered restart handlersSascha Hauer2015-08-271-13/+0
| | | | | | | | | | | | | | | | | | | | | | This replaces the reset_cpu() function which every SoC or board must provide with registered handlers. This makes it possible to have multiple reset functions for boards which have multiple ways to reset the machine. Also boards which have no way at all to reset the machine no longer have to provide a dummy reset_cpu() function. The problem this solves is that some machines have external PMICs or similar to reset the system which have to be preferred over the internal SoC reset, because the PMIC can reset not only the SoC but also the external devices. To pick the right way to reset a machine each handler has a priority. The default priority is 100 and all currently existing restart handlers are registered with this priority. of_get_restart_priority() allows to retrieve the priority from the device tree which makes it possible for boards to give certain restart handlers a higher priority in order to use this one instead of the default one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: Move PCIe register defines to socid.hSebastian Hesselbarth2015-04-271-4/+1
| | | | | | | | To prepare PCIe device id fixups, move PCIe register defines to a common location. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: Simplify memory init orderSascha Hauer2014-09-191-24/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initialisation of the memory nodes on mvebu is a bit compilcated: pure_initcall(mvebu_memory_fixup_register) of_register_fixup(mvebu_memory_of_fixup, NULL) core_initcall(kirkwood_init_soc) mvebu_set_memory() core_initcall(of_arm_init) of_fix_tree() mvebu_memory_of_fixup() First a mvebu common of_fixup function is registered, then the SoC calls mvebu_set_memory which stores the memory base and size in global variables. Afterwards the of_fixup is executed which fixes the memory nodes according to the global variables. Instead register a SoC specific fixup which directly calls mvebu_set_memory with the memory base and size as arguments: pure_initcall(kirkwood_register_soc_fixup); of_register_fixup(kirkwood_init_soc, NULL); core_initcall(of_arm_init) of_fix_tree() kirkwood_init_soc() mvebu_set_memory(phys_base, phys_size); Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: Add common reset_cpu functionSascha Hauer2014-09-191-0/+14
| | | | | | | | | mvebu has a reset_cpu function per SoC this does not work when multiple SoCs are selected, so add a common reset_cpu function which calls into the SoC specific ones. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
* ARM: mvebu: add fixup for directly attached memorySebastian Hesselbarth2014-07-251-0/+59
| | | | | | | | | | | | On Marvell MVEBU SoCs memory size is set up by BootROM and can be read from SoC's RAM controller. With early DT fixups available, set corresponding DT node to reflect accessible amount of directly attached RAM. This patch also removes non-DT call to arm_add_mem_device to silence a warning about request_region conflict due to adding a mem device twice. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: determine SoC id and revision from PCIe nodesSebastian Hesselbarth2014-06-251-0/+64
| | | | | | | | | Marvell MVEBU SoC id and revision can be read out from any PCIe port registers. This adds corresponding code to read out id and revision and provides a helper function for drivers to use it. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: move lowlevel code to lowlevel.cSebastian Hesselbarth2014-06-241-40/+0
| | | | | | | | mach-mvebu has two files containing lowlevel code. Consolidate both into mach-mvebu/lowlevel.c. Also put the now empty mach-mvebu/common.c into non-lowlevel obj-y as it will be used for common non-lowlevel code later. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
* ARM: change signature of barebox_arm_entryLucas Stach2014-05-051-1/+1
| | | | | | | | | | | Mostly to make it clear that boarddata needs to be something we can dereference. As this is a pretty invasive change, use the opportunity to make the signature 64bit safe. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: mvebu: introduce multi image supportSascha Hauer2013-08-161-2/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* arm: mvebu: introduce common lowlevel and early initSebastian Hesselbarth2013-05-211-0/+57
At early stage after boot, all MVEBU SoCs are similar enough to have a common lowlevel and barebox entry. We also remap the internal register base address to 0xf100000 as it gives some 512M more of contiguous address space. As we cannot determine real memory size that early, we start with a default memory size of 64M and probe correct size later in SoC init. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>