From c6c731fe311f7da42777ffd31804a4f6aa3f8e19 Mon Sep 17 00:00:00 2001 From: Yutang Jiang Date: Sat, 29 Oct 2016 00:14:32 +0800 Subject: layerscape: add 64b/32b target for ls1043ardb device Add support for NXP layerscape ls1043ardb 64b/32b Dev board. LS1043a is an SoC with 4x64-bit up to 1.6 GHz ARMv8 A53 cores. ls1043ardb support features as: 2GB DDR4, 128MB NOR/512MB NAND, USB3.0, eSDHC, I2C, GPIO, PCIe/Mini-PCIe, 6x1G/1x10G network port, etc. 64b/32b ls1043ardb target is using 4.4 kernel, and rcw/u-boot/fman images from NXP QorIQ SDK release. All of 4.4 kernel patches porting from SDK release or upstream. QorIQ SDK ISOs can be downloaded from this location: http://www.nxp.com/products/software-and-tools/run-time-software/linux-sdk/linux-sdk-for-qoriq-processors:SDKLINUX Signed-off-by: Yutang Jiang --- .../8036-ls2085a-Add-support-for-reset.patch | 135 +++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 target/linux/layerscape/patches-4.4/8036-ls2085a-Add-support-for-reset.patch (limited to 'target/linux/layerscape/patches-4.4/8036-ls2085a-Add-support-for-reset.patch') diff --git a/target/linux/layerscape/patches-4.4/8036-ls2085a-Add-support-for-reset.patch b/target/linux/layerscape/patches-4.4/8036-ls2085a-Add-support-for-reset.patch new file mode 100644 index 0000000000..62420191b7 --- /dev/null +++ b/target/linux/layerscape/patches-4.4/8036-ls2085a-Add-support-for-reset.patch @@ -0,0 +1,135 @@ +From 4b9227ba510562a51e87487905895aea97e17e77 Mon Sep 17 00:00:00 2001 +From: pankaj chauhan +Date: Tue, 3 Feb 2015 13:08:52 +0530 +Subject: [PATCH 36/70] ls2085a: Add support for reset + +Add support for layerscape reset driver. +Reset is implemented by raising RESET_REQ_B. + +Signed-off-by: pankaj chauhan +Signed-off-by: Stuart Yoder +(cherry picked from commit f248be3aea58ca32b7d77413d742996249b293e9) +--- + drivers/power/reset/Kconfig | 7 ++- + drivers/power/reset/Makefile | 1 + + drivers/power/reset/ls-reboot.c | 93 +++++++++++++++++++++++++++++++++++++++ + 3 files changed, 100 insertions(+), 1 deletion(-) + create mode 100644 drivers/power/reset/ls-reboot.c + +--- a/drivers/power/reset/Kconfig ++++ b/drivers/power/reset/Kconfig +@@ -173,5 +173,10 @@ config POWER_RESET_ZX + help + Reboot support for ZTE SoCs. + +-endif ++config POWER_RESET_LAYERSCAPE ++ bool "Freescale LayerScape reset driver" ++ depends on ARCH_FSL_LS2085A ++ help ++ Reboot support for the Freescale LayerScape SoCs. + ++endif +--- a/drivers/power/reset/Makefile ++++ b/drivers/power/reset/Makefile +@@ -20,3 +20,4 @@ obj-$(CONFIG_POWER_RESET_SYSCON) += sysc + obj-$(CONFIG_POWER_RESET_SYSCON_POWEROFF) += syscon-poweroff.o + obj-$(CONFIG_POWER_RESET_RMOBILE) += rmobile-reset.o + obj-$(CONFIG_POWER_RESET_ZX) += zx-reboot.o ++obj-$(CONFIG_POWER_RESET_LAYERSCAPE) += ls-reboot.o +--- /dev/null ++++ b/drivers/power/reset/ls-reboot.c +@@ -0,0 +1,93 @@ ++/* ++ * Freescale LayerScape reboot driver ++ * ++ * Copyright (c) 2015, Freescale Semiconductor. ++ * Author: Pankaj Chauhan ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++struct ls_reboot_priv { ++ struct device *dev; ++ u32 *rstcr; ++}; ++ ++static struct ls_reboot_priv *ls_reboot_priv; ++ ++static void ls_reboot(enum reboot_mode reboot_mode, const char *cmd) ++{ ++ struct ls_reboot_priv *priv = ls_reboot_priv; ++ u32 val; ++ unsigned long timeout; ++ ++ if (ls_reboot_priv) { ++ val = readl(priv->rstcr); ++ val |= 0x02; ++ writel(val, priv->rstcr); ++ } ++ ++ timeout = jiffies + HZ; ++ while (time_before(jiffies, timeout)) ++ cpu_relax(); ++ ++} ++ ++static int ls_reboot_probe(struct platform_device *pdev) ++{ ++ ls_reboot_priv = devm_kzalloc(&pdev->dev, ++ sizeof(*ls_reboot_priv), GFP_KERNEL); ++ if (!ls_reboot_priv) { ++ dev_err(&pdev->dev, "out of memory for context\n"); ++ return -ENODEV; ++ } ++ ++ ls_reboot_priv->rstcr = of_iomap(pdev->dev.of_node, 0); ++ if (!ls_reboot_priv->rstcr) { ++ devm_kfree(&pdev->dev, ls_reboot_priv); ++ dev_err(&pdev->dev, "can not map resource\n"); ++ return -ENODEV; ++ } ++ ++ ls_reboot_priv->dev = &pdev->dev; ++ ++ arm_pm_restart = ls_reboot; ++ ++ return 0; ++} ++ ++static struct of_device_id ls_reboot_of_match[] = { ++ { .compatible = "fsl,ls-reset" }, ++ {} ++}; ++ ++static struct platform_driver ls_reboot_driver = { ++ .probe = ls_reboot_probe, ++ .driver = { ++ .name = "ls-reset", ++ .of_match_table = ls_reboot_of_match, ++ }, ++}; ++ ++static int __init ls_reboot_init(void) ++{ ++ return platform_driver_register(&ls_reboot_driver); ++} ++device_initcall(ls_reboot_init); -- cgit v1.2.3