summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/tqmls1046a
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-05-09 12:50:39 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-05-10 08:18:25 +0200
commit9d543d51e617603f6f22c1c9b0c463399bee5af9 (patch)
tree236227b2b42c921137dc4f6e998b5b7be09648fd /arch/arm/boards/tqmls1046a
parent6a7b4b186a6d6e6c6987f0b2d82800f91609d28d (diff)
downloadbarebox-9d543d51e617603f6f22c1c9b0c463399bee5af9.tar.gz
barebox-9d543d51e617603f6f22c1c9b0c463399bee5af9.tar.xz
ARM: Layerscape: TQMLS1046a: Add environment and update handlers
The TQMLS1046a can boot from QSPI and SD/MMC. Add partitioning for these devices and barebox environment / barebox update handlers on them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/tqmls1046a')
-rw-r--r--arch/arm/boards/tqmls1046a/board.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/boards/tqmls1046a/board.c b/arch/arm/boards/tqmls1046a/board.c
index caf0f7ce38..8cc4d73de5 100644
--- a/arch/arm/boards/tqmls1046a/board.c
+++ b/arch/arm/boards/tqmls1046a/board.c
@@ -3,11 +3,15 @@
#include <common.h>
#include <init.h>
#include <envfs.h>
+#include <bbu.h>
+#include <bootsource.h>
#include <asm/memory.h>
#include <linux/sizes.h>
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <soc/fsl/immap_lsch2.h>
+#include <mach/bbu.h>
+#include <mach/layerscape.h>
static int tqmls1046a_mem_init(void)
{
@@ -23,6 +27,8 @@ mem_initcall(tqmls1046a_mem_init);
static int tqmls1046a_postcore_init(void)
{
struct ccsr_scfg *scfg = IOMEM(LSCH2_SCFG_ADDR);
+ enum bootsource bootsource;
+ unsigned long sd_bbu_flags = 0, qspi_bbu_flags = 0;
if (!of_machine_is_compatible("tqc,tqmls1046a"))
return 0;
@@ -35,6 +41,24 @@ static int tqmls1046a_postcore_init(void)
/* divide CGA1/CGA2 PLL by 24 to get QSPI interface clock */
out_be32(&scfg->qspi_cfg, 0x30100000);
+ bootsource = ls1046_bootsource_get();
+
+ switch (bootsource) {
+ case BOOTSOURCE_MMC:
+ of_device_enable_path("/chosen/environment-sd");
+ sd_bbu_flags = BBU_HANDLER_FLAG_DEFAULT;
+ break;
+ case BOOTSOURCE_SPI_NOR:
+ of_device_enable_path("/chosen/environment-qspi");
+ qspi_bbu_flags = BBU_HANDLER_FLAG_DEFAULT;
+ break;
+ default:
+ break;
+ }
+
+ ls1046a_bbu_mmc_register_handler("sd", "/dev/mmc0.barebox", sd_bbu_flags);
+ ls1046a_bbu_qspi_register_handler("qspi", "/dev/qspiflash0.barebox", qspi_bbu_flags);
+
return 0;
}