From 15a14cf1665ef3d8b5c77cce69b52d131340e3b3 Mon Sep 17 00:00:00 2001 From: Yutang Jiang Date: Sat, 29 Oct 2016 00:18:23 +0800 Subject: layerscape: add 64b/32b target for ls1012ardb device The QorIQ LS1012A processor, optimized for battery-backed or USB-powered, integrates a single ARM Cortex-A53 core with a hardware packet forwarding engine and high-speed interfaces to deliver line-rate networking performance. QorIQ LS1012A Reference Design System (LS1012ARDB) is a high-performance development platform, with a complete debugging environment. The LS1012ARDB board supports the QorIQ LS1012A processor and is optimized to support the high-bandwidth DDR3L memory and a full complement of high-speed SerDes ports. LEDE/OPENWRT will auto strip executable program file while make. So we need select CONFIG_NO_STRIP=y while make menuconfig to avoid the ppfe network fiemware be destroyed, then run make to build ls1012ardb firmware. The fsl-quadspi flash with jffs2 fs is unstable and arise some failed message. This issue have noticed the IP owner for investigate, hope he can solve it earlier. So the ls1012ardb now also provide a xx-firmware.ext4.bin as default firmware, and the uboot bootcmd will run wrtboot_ext4rfs for "rootfstype=ext4" bootargs. Signed-off-by: Yutang Jiang --- ...mtd-fsl-quadspi-possible-NULL-dereference.patch | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 target/linux/layerscape/patches-4.4/1080-mtd-fsl-quadspi-possible-NULL-dereference.patch (limited to 'target/linux/layerscape/patches-4.4/1080-mtd-fsl-quadspi-possible-NULL-dereference.patch') diff --git a/target/linux/layerscape/patches-4.4/1080-mtd-fsl-quadspi-possible-NULL-dereference.patch b/target/linux/layerscape/patches-4.4/1080-mtd-fsl-quadspi-possible-NULL-dereference.patch new file mode 100644 index 0000000000..76898ab58d --- /dev/null +++ b/target/linux/layerscape/patches-4.4/1080-mtd-fsl-quadspi-possible-NULL-dereference.patch @@ -0,0 +1,50 @@ +From bd02decd1ad7cc883ce388e769a34a3c402b90c4 Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Mon, 16 Nov 2015 10:45:30 -0800 +Subject: [PATCH 080/113] mtd: fsl-quadspi: possible NULL dereference + +It is theoretically possible to probe this driver without a matching +device tree, so let's guard against this. + +Also, use the of_device_get_match_data() helper to make this a bit +simpler. + +Coverity complained about this one. + +Signed-off-by: Brian Norris +Acked-by: Han xu +--- + drivers/mtd/spi-nor/fsl-quadspi.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/mtd/spi-nor/fsl-quadspi.c ++++ b/drivers/mtd/spi-nor/fsl-quadspi.c +@@ -269,7 +269,7 @@ struct fsl_qspi { + struct clk *clk, *clk_en; + struct device *dev; + struct completion c; +- struct fsl_qspi_devtype_data *devtype_data; ++ const struct fsl_qspi_devtype_data *devtype_data; + u32 nor_size; + u32 nor_num; + u32 clk_rate; +@@ -933,8 +933,6 @@ static int fsl_qspi_probe(struct platfor + struct spi_nor *nor; + struct mtd_info *mtd; + int ret, i = 0; +- const struct of_device_id *of_id = +- of_match_device(fsl_qspi_dt_ids, &pdev->dev); + + q = devm_kzalloc(dev, sizeof(*q), GFP_KERNEL); + if (!q) +@@ -945,7 +943,9 @@ static int fsl_qspi_probe(struct platfor + return -ENODEV; + + q->dev = dev; +- q->devtype_data = (struct fsl_qspi_devtype_data *)of_id->data; ++ q->devtype_data = of_device_get_match_data(dev); ++ if (!q->devtype_data) ++ return -ENODEV; + platform_set_drvdata(pdev, q); + + /* find the resources */ -- cgit v1.2.3