From f462077e5e6ab4dceb338b4a62eccea43b1be0e0 Mon Sep 17 00:00:00 2001 From: David P Date: Tue, 10 Dec 2019 11:23:34 -0300 Subject: addpkg: libre-testing/linux-libre-cros 5.4.2-1 Signed-off-by: David P --- ...RM-atags-add-support-for-Marvell-s-u-boot.patch | 51 + ...ctl-and-CONFIG-to-disallow-unprivileged-C.patch | 132 + ...gadget-no-TTY-hangup-on-USB-disconnect-WI.patch | 39 + ...dt-retrieve-MAC-addresses-from-Marvell-bo.patch | 47 + ...02-fix-Atmel-maXTouch-touchscreen-support.patch | 37 + ...vres-add-a-helper-function-for-ioremap_uc.patch | 79 + .../0003-SMILE-Plug-device-tree-file.patch | 209 + ...d-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch | 48 + ...Do-not-disable-interrupt-twice-on-suspend.patch | 99 + .../0004-fix-mvsdio-eMMC-timing.patch | 38 + ...PCI-pciehp-Prevent-deadlock-on-disconnect.patch | 272 + ...x-Allow-mac-address-to-be-set-as-a-parame.patch | 95 + .../0006-set-default-cubietruck-led-triggers.patch | 33 + ...odroid-set-higher-minimum-buck2-regulator.patch | 30 + .../0008-ARM-dove-enable-ethernet-on-D3Plug.patch | 31 + .../0009-USB-Armory-MkII-support.patch | 555 ++ libre-testing/linux-libre-cros/PKGBUILD | 323 + libre-testing/linux-libre-cros/config | 9612 ++++++++++++++++++++ libre-testing/linux-libre-cros/kernel.its | 217 + libre-testing/linux-libre-cros/kernel.keyblock | Bin 0 -> 1208 bytes .../linux-libre-cros/kernel_data_key.vbprivk | Bin 0 -> 1199 bytes .../linux-libre-cros/linux-libre-cros.install | 29 + libre-testing/linux-libre-cros/linux.preset | 10 + 23 files changed, 11986 insertions(+) create mode 100644 libre-testing/linux-libre-cros/0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch create mode 100644 libre-testing/linux-libre-cros/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch create mode 100644 libre-testing/linux-libre-cros/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch create mode 100644 libre-testing/linux-libre-cros/0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch create mode 100644 libre-testing/linux-libre-cros/0002-fix-Atmel-maXTouch-touchscreen-support.patch create mode 100644 libre-testing/linux-libre-cros/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch create mode 100644 libre-testing/linux-libre-cros/0003-SMILE-Plug-device-tree-file.patch create mode 100644 libre-testing/linux-libre-cros/0003-mfd-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch create mode 100644 libre-testing/linux-libre-cros/0004-PCI-pciehp-Do-not-disable-interrupt-twice-on-suspend.patch create mode 100644 libre-testing/linux-libre-cros/0004-fix-mvsdio-eMMC-timing.patch create mode 100644 libre-testing/linux-libre-cros/0005-PCI-pciehp-Prevent-deadlock-on-disconnect.patch create mode 100644 libre-testing/linux-libre-cros/0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch create mode 100644 libre-testing/linux-libre-cros/0006-set-default-cubietruck-led-triggers.patch create mode 100644 libre-testing/linux-libre-cros/0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch create mode 100644 libre-testing/linux-libre-cros/0008-ARM-dove-enable-ethernet-on-D3Plug.patch create mode 100644 libre-testing/linux-libre-cros/0009-USB-Armory-MkII-support.patch create mode 100644 libre-testing/linux-libre-cros/PKGBUILD create mode 100644 libre-testing/linux-libre-cros/config create mode 100644 libre-testing/linux-libre-cros/kernel.its create mode 100644 libre-testing/linux-libre-cros/kernel.keyblock create mode 100644 libre-testing/linux-libre-cros/kernel_data_key.vbprivk create mode 100644 libre-testing/linux-libre-cros/linux-libre-cros.install create mode 100644 libre-testing/linux-libre-cros/linux.preset (limited to 'libre-testing') diff --git a/libre-testing/linux-libre-cros/0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch b/libre-testing/linux-libre-cros/0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch new file mode 100644 index 000000000..074903c47 --- /dev/null +++ b/libre-testing/linux-libre-cros/0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch @@ -0,0 +1,51 @@ +From 88f69b1dcdda406ba9e4c6ad51f0577623d238b1 Mon Sep 17 00:00:00 2001 +From: Willy Tarreau +Date: Sun, 2 Dec 2012 19:59:28 +0100 +Subject: [PATCH 1/9] ARM: atags: add support for Marvell's u-boot + +Marvell uses a specific atag in its u-boot which includes among other +information the MAC addresses for up to 4 network interfaces. + +Signed-off-by: Willy Tarreau +--- + arch/arm/include/uapi/asm/setup.h | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/arch/arm/include/uapi/asm/setup.h b/arch/arm/include/uapi/asm/setup.h +index 25ceda63b284..83578c54975b 100644 +--- a/arch/arm/include/uapi/asm/setup.h ++++ b/arch/arm/include/uapi/asm/setup.h +@@ -144,6 +144,18 @@ struct tag_memclk { + __u32 fmemclk; + }; + ++/* Marvell uboot parameters */ ++#define ATAG_MV_UBOOT 0x41000403 ++struct tag_mv_uboot { ++ __u32 uboot_version; ++ __u32 tclk; ++ __u32 sysclk; ++ __u32 isUsbHost; ++ __u8 macAddr[4][6]; ++ __u16 mtu[4]; ++ __u32 nand_ecc; ++}; ++ + struct tag { + struct tag_header hdr; + union { +@@ -166,6 +178,11 @@ struct tag { + * DC21285 specific + */ + struct tag_memclk memclk; ++ ++ /* ++ * Marvell specific ++ */ ++ struct tag_mv_uboot mv_uboot; + } u; + }; + +-- +2.23.0 + diff --git a/libre-testing/linux-libre-cros/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch b/libre-testing/linux-libre-cros/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch new file mode 100644 index 000000000..bcd694ec0 --- /dev/null +++ b/libre-testing/linux-libre-cros/0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch @@ -0,0 +1,132 @@ +From 270144c854dea695a7721fdd3a5503eb4acae7e4 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +Date: Mon, 16 Sep 2019 04:53:20 +0200 +Subject: [PATCH 1/5] ZEN: Add sysctl and CONFIG to disallow unprivileged + CLONE_NEWUSER + +Our default behavior continues to match the vanilla kernel. +--- + init/Kconfig | 16 ++++++++++++++++ + kernel/fork.c | 15 +++++++++++++++ + kernel/sysctl.c | 12 ++++++++++++ + kernel/user_namespace.c | 7 +++++++ + 4 files changed, 50 insertions(+) + +diff --git a/init/Kconfig b/init/Kconfig +index b4daad2bac23..362f82c5ec07 100644 +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1118,6 +1118,22 @@ config USER_NS + + If unsure, say N. + ++config USER_NS_UNPRIVILEGED ++ bool "Allow unprivileged users to create namespaces" ++ default y ++ depends on USER_NS ++ help ++ When disabled, unprivileged users will not be able to create ++ new namespaces. Allowing users to create their own namespaces ++ has been part of several recent local privilege escalation ++ exploits, so if you need user namespaces but are ++ paranoid^Wsecurity-conscious you want to disable this. ++ ++ This setting can be overridden at runtime via the ++ kernel.unprivileged_userns_clone sysctl. ++ ++ If unsure, say Y. ++ + config PID_NS + bool "PID Namespaces" + default y +diff --git a/kernel/fork.c b/kernel/fork.c +index 6cabc124378c..fda4986da9eb 100644 +--- a/kernel/fork.c ++++ b/kernel/fork.c +@@ -106,6 +106,11 @@ + + #define CREATE_TRACE_POINTS + #include ++#ifdef CONFIG_USER_NS ++extern int unprivileged_userns_clone; ++#else ++#define unprivileged_userns_clone 0 ++#endif + + /* + * Minimum number of threads to boot the kernel +@@ -1779,6 +1784,10 @@ static __latent_entropy struct task_struct *copy_process( + if ((clone_flags & (CLONE_NEWUSER|CLONE_FS)) == (CLONE_NEWUSER|CLONE_FS)) + return ERR_PTR(-EINVAL); + ++ if ((clone_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) ++ if (!capable(CAP_SYS_ADMIN)) ++ return ERR_PTR(-EPERM); ++ + /* + * Thread groups must share signals as well, and detached threads + * can only be started up within the thread group. +@@ -2826,6 +2835,12 @@ int ksys_unshare(unsigned long unshare_flags) + if (unshare_flags & CLONE_NEWNS) + unshare_flags |= CLONE_FS; + ++ if ((unshare_flags & CLONE_NEWUSER) && !unprivileged_userns_clone) { ++ err = -EPERM; ++ if (!capable(CAP_SYS_ADMIN)) ++ goto bad_unshare_out; ++ } ++ + err = check_unshare_flags(unshare_flags); + if (err) + goto bad_unshare_out; +diff --git a/kernel/sysctl.c b/kernel/sysctl.c +index b6f2f35d0bcf..2e9c273990e8 100644 +--- a/kernel/sysctl.c ++++ b/kernel/sysctl.c +@@ -110,6 +110,9 @@ extern int core_uses_pid; + extern char core_pattern[]; + extern unsigned int core_pipe_limit; + #endif ++#ifdef CONFIG_USER_NS ++extern int unprivileged_userns_clone; ++#endif + extern int pid_max; + extern int pid_max_min, pid_max_max; + extern int percpu_pagelist_fraction; +@@ -546,6 +549,15 @@ static struct ctl_table kern_table[] = { + .proc_handler = proc_dointvec, + }, + #endif ++#ifdef CONFIG_USER_NS ++ { ++ .procname = "unprivileged_userns_clone", ++ .data = &unprivileged_userns_clone, ++ .maxlen = sizeof(int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, ++#endif + #ifdef CONFIG_PROC_SYSCTL + { + .procname = "tainted", +diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c +index 8eadadc478f9..c36ecd19562c 100644 +--- a/kernel/user_namespace.c ++++ b/kernel/user_namespace.c +@@ -21,6 +21,13 @@ + #include + #include + ++/* sysctl */ ++#ifdef CONFIG_USER_NS_UNPRIVILEGED ++int unprivileged_userns_clone = 1; ++#else ++int unprivileged_userns_clone; ++#endif ++ + static struct kmem_cache *user_ns_cachep __read_mostly; + static DEFINE_MUTEX(userns_state_mutex); + +-- +2.24.0 + diff --git a/libre-testing/linux-libre-cros/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch b/libre-testing/linux-libre-cros/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch new file mode 100644 index 000000000..e9de435fd --- /dev/null +++ b/libre-testing/linux-libre-cros/0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch @@ -0,0 +1,39 @@ +From 716120e8010a7f400c6bed7384000e95e1465c94 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= +Date: Mon, 26 Aug 2013 19:19:44 +0300 +Subject: [PATCH 1/2] usb serial gadget: no TTY hangup on USB disconnect [WIP] +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We may want to maintain the TTY over USB disconnects. + +This is useful when we have a terminal console to a host which +power-cycles or for other reasons resets the USB host controller. + +Signed-off-by: Kyösti Mälkki +--- + drivers/usb/gadget/function/u_serial.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c +index b369292..d156a28 100644 +--- a/drivers/usb/gadget/function/u_serial.c ++++ b/drivers/usb/gadget/function/u_serial.c +@@ -1258,8 +1258,13 @@ void gserial_disconnect(struct gserial *gser) + gser->ioport = NULL; + if (port->port.count > 0 || port->openclose) { + wake_up_interruptible(&port->drain_wait); ++#if 0 + if (port->port.tty) + tty_hangup(port->port.tty); ++#else ++ if (port->port.tty) ++ stop_tty(port->port.tty); ++#endif + } + spin_unlock_irqrestore(&port->port_lock, flags); + +-- +1.8.1.1 + diff --git a/libre-testing/linux-libre-cros/0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch b/libre-testing/linux-libre-cros/0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch new file mode 100644 index 000000000..546120041 --- /dev/null +++ b/libre-testing/linux-libre-cros/0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch @@ -0,0 +1,47 @@ +From cb931641740269a78b002b438904292a1110a5a7 Mon Sep 17 00:00:00 2001 +From: Willy Tarreau +Date: Sun, 2 Dec 2012 19:56:58 +0100 +Subject: [PATCH 2/9] ARM: atags/fdt: retrieve MAC addresses from Marvell boot + loader + +The atags are parsed and if a Marvell atag is found, up to 4 MAC +addresses are extracted there and assigned to node aliases eth0..3 +with the name "mac-address". + +This was tested on my Mirabox and the two NICs had their correct +address set. + +Signed-off-by: Willy Tarreau +--- + arch/arm/boot/compressed/atags_to_fdt.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/compressed/atags_to_fdt.c b/arch/arm/boot/compressed/atags_to_fdt.c +index 330cd3c2eae5..82f3802ff695 100644 +--- a/arch/arm/boot/compressed/atags_to_fdt.c ++++ b/arch/arm/boot/compressed/atags_to_fdt.c +@@ -19,7 +19,7 @@ static int node_offset(void *fdt, const char *node_path) + } + + static int setprop(void *fdt, const char *node_path, const char *property, +- uint32_t *val_array, int size) ++ void *val_array, int size) + { + int offset = node_offset(fdt, node_path); + if (offset < 0) +@@ -203,6 +203,12 @@ int atags_to_fdt(void *atag_list, void *fdt, int total_space) + hex_str(serno, atag->u.serialnr.high); + hex_str(serno+8, atag->u.serialnr.low); + setprop_string(fdt, "/", "serial-number", serno); ++ } else if (atag->hdr.tag == ATAG_MV_UBOOT) { ++ /* This ATAG provides up to 4 MAC addresses */ ++ setprop(fdt, "eth0", "mac-address", atag->u.mv_uboot.macAddr[0], 6); ++ setprop(fdt, "eth1", "mac-address", atag->u.mv_uboot.macAddr[1], 6); ++ setprop(fdt, "eth2", "mac-address", atag->u.mv_uboot.macAddr[2], 6); ++ setprop(fdt, "eth3", "mac-address", atag->u.mv_uboot.macAddr[3], 6); + } + } + +-- +2.23.0 + diff --git a/libre-testing/linux-libre-cros/0002-fix-Atmel-maXTouch-touchscreen-support.patch b/libre-testing/linux-libre-cros/0002-fix-Atmel-maXTouch-touchscreen-support.patch new file mode 100644 index 000000000..5ad26fc9e --- /dev/null +++ b/libre-testing/linux-libre-cros/0002-fix-Atmel-maXTouch-touchscreen-support.patch @@ -0,0 +1,37 @@ +From ab8cc1b2dc1b716d5c08f72dacbe1eded269f304 Mon Sep 17 00:00:00 2001 +From: André Silva +Date: Tue, 22 Mar 2016 17:58:59 -0300 +Subject: [PATCH 2/2] fix Atmel maXTouch touchscreen support + +The Atmel maXTouch touchscreen works with Linux-libre 3.13-gnu, +but not with the current longterm and mainline kernels in +Parabola. + +Now it needs to load nonfree firmware in mxt_initialize(), +which is in drivers/input/touchscreen/atmel_mxt_ts.c, and the +atmel_mxt_ts driver fails to work. + +This driver works if changing reject_firmware_nowait to +request_firmware_nowait in atmel_mxt_ts.c. This line is +requesting the file named MXT_CFG_NAME, and it's a config file, +not the firmware blob. + +Signed-off-by: André Silva +Signed-off-by: mytbk +--- + drivers/input/touchscreen/atmel_mxt_ts.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c +index 726a83e..d818834 100644 +--- a/drivers/input/touchscreen/atmel_mxt_ts.c ++++ b/drivers/input/touchscreen/atmel_mxt_ts.c +@@ -1989,7 +1989,7 @@ static int mxt_initialize(struct mxt_data *data) + if (error) + goto err_free_object_table; + +- error = reject_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME, ++ error = request_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME, + &client->dev, GFP_KERNEL, data, + mxt_config_cb); + if (error) { diff --git a/libre-testing/linux-libre-cros/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch b/libre-testing/linux-libre-cros/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch new file mode 100644 index 000000000..9befdd67a --- /dev/null +++ b/libre-testing/linux-libre-cros/0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch @@ -0,0 +1,79 @@ +From f20221735640685313d5020d7e6db4aad293a3ae Mon Sep 17 00:00:00 2001 +From: Tuowen Zhao +Date: Wed, 16 Oct 2019 15:06:28 -0600 +Subject: [PATCH 2/5] lib: devres: add a helper function for ioremap_uc + +Implement a resource managed strongly uncachable ioremap function. + +Cc: # v4.19+ +Tested-by: AceLan Kao +Signed-off-by: Tuowen Zhao +Acked-by: Mika Westerberg +Acked-by: Andy Shevchenko +Acked-by: Luis Chamberlain +Signed-off-by: Lee Jones +--- + include/linux/io.h | 2 ++ + lib/devres.c | 19 +++++++++++++++++++ + 2 files changed, 21 insertions(+) + +diff --git a/include/linux/io.h b/include/linux/io.h +index accac822336a..a59834bc0a11 100644 +--- a/include/linux/io.h ++++ b/include/linux/io.h +@@ -64,6 +64,8 @@ static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr) + + void __iomem *devm_ioremap(struct device *dev, resource_size_t offset, + resource_size_t size); ++void __iomem *devm_ioremap_uc(struct device *dev, resource_size_t offset, ++ resource_size_t size); + void __iomem *devm_ioremap_nocache(struct device *dev, resource_size_t offset, + resource_size_t size); + void __iomem *devm_ioremap_wc(struct device *dev, resource_size_t offset, +diff --git a/lib/devres.c b/lib/devres.c +index 6a0e9bd6524a..17624d35e82d 100644 +--- a/lib/devres.c ++++ b/lib/devres.c +@@ -9,6 +9,7 @@ + enum devm_ioremap_type { + DEVM_IOREMAP = 0, + DEVM_IOREMAP_NC, ++ DEVM_IOREMAP_UC, + DEVM_IOREMAP_WC, + }; + +@@ -39,6 +40,9 @@ static void __iomem *__devm_ioremap(struct device *dev, resource_size_t offset, + case DEVM_IOREMAP_NC: + addr = ioremap_nocache(offset, size); + break; ++ case DEVM_IOREMAP_UC: ++ addr = ioremap_uc(offset, size); ++ break; + case DEVM_IOREMAP_WC: + addr = ioremap_wc(offset, size); + break; +@@ -68,6 +72,21 @@ void __iomem *devm_ioremap(struct device *dev, resource_size_t offset, + } + EXPORT_SYMBOL(devm_ioremap); + ++/** ++ * devm_ioremap_uc - Managed ioremap_uc() ++ * @dev: Generic device to remap IO address for ++ * @offset: Resource address to map ++ * @size: Size of map ++ * ++ * Managed ioremap_uc(). Map is automatically unmapped on driver detach. ++ */ ++void __iomem *devm_ioremap_uc(struct device *dev, resource_size_t offset, ++ resource_size_t size) ++{ ++ return __devm_ioremap(dev, offset, size, DEVM_IOREMAP_UC); ++} ++EXPORT_SYMBOL_GPL(devm_ioremap_uc); ++ + /** + * devm_ioremap_nocache - Managed ioremap_nocache() + * @dev: Generic device to remap IO address for +-- +2.24.0 + diff --git a/libre-testing/linux-libre-cros/0003-SMILE-Plug-device-tree-file.patch b/libre-testing/linux-libre-cros/0003-SMILE-Plug-device-tree-file.patch new file mode 100644 index 000000000..b07e149b7 --- /dev/null +++ b/libre-testing/linux-libre-cros/0003-SMILE-Plug-device-tree-file.patch @@ -0,0 +1,209 @@ +From 8dc29eb34efbef2aa3ce6e499cea11765286ffbd Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Fri, 5 Sep 2014 15:41:19 -0600 +Subject: [PATCH 3/9] SMILE Plug device tree file + +This adds a dts file for the SMILE Plug, which only differs from the Mirabox +dts with the LED definitions. + +Signed-off-by: Kevin Mihelich +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/armada-370-smileplug.dts | 173 +++++++++++++++++++++ + 2 files changed, 174 insertions(+) + create mode 100644 arch/arm/boot/dts/armada-370-smileplug.dts + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index b21b3a64641a..a0f92b9dbd7d 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -1216,6 +1216,7 @@ dtb-$(CONFIG_MACH_ARMADA_370) += \ + armada-370-db.dtb \ + armada-370-dlink-dns327l.dtb \ + armada-370-mirabox.dtb \ ++ armada-370-smileplug.dtb \ + armada-370-netgear-rn102.dtb \ + armada-370-netgear-rn104.dtb \ + armada-370-rd.dtb \ +diff --git a/arch/arm/boot/dts/armada-370-smileplug.dts b/arch/arm/boot/dts/armada-370-smileplug.dts +new file mode 100644 +index 000000000000..d01308ab848b +--- /dev/null ++++ b/arch/arm/boot/dts/armada-370-smileplug.dts +@@ -0,0 +1,173 @@ ++/* ++ * Device Tree file for Marvell SMILE Plug ++ * ++ * Kevin Mihelich ++ * Gregory CLEMENT ++ * ++ * This file is licensed under the terms of the GNU General Public ++ * License version 2. This program is licensed "as is" without any ++ * warranty of any kind, whether express or implied. ++ */ ++ ++/dts-v1/; ++#include ++#include "armada-370.dtsi" ++ ++/ { ++ model = "Marvell SMILE Plug"; ++ compatible = "marvell,smileplug", "marvell,armada370", "marvell,armada-370-xp"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200 earlyprintk"; ++ }; ++ ++ memory { ++ device_type = "memory"; ++ reg = <0x00000000 0x20000000>; /* 512 MB */ ++ }; ++ ++ soc { ++ ranges = ; ++ ++ pcie-controller { ++ status = "okay"; ++ ++ /* Internal mini-PCIe connector */ ++ pcie@1,0 { ++ /* Port 0, Lane 0 */ ++ status = "okay"; ++ }; ++ ++ /* Connected on the PCB to a USB 3.0 XHCI controller */ ++ pcie@2,0 { ++ /* Port 1, Lane 0 */ ++ status = "okay"; ++ }; ++ }; ++ ++ internal-regs { ++ serial@12000 { ++ status = "okay"; ++ }; ++ timer@20300 { ++ clock-frequency = <600000000>; ++ status = "okay"; ++ }; ++ ++ gpio_leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&smile_led_pins>; ++ ++ red_eyes_led { ++ label = "smileplug:red:eyes"; ++ gpios = <&gpio1 31 0>; ++ default-state = "off"; ++ }; ++ ++ green_eyes_led { ++ label = "smileplug:green:eyes"; ++ gpios = <&gpio2 0 0>; ++ linux,default-trigger = "default-on"; ++ }; ++ ++ red_smile_led { ++ label = "smileplug:red:smile"; ++ gpios = <&gpio1 15 0>; ++ default-state = "off"; ++ }; ++ ++ green_smile_led { ++ label = "smileplug:green:smile"; ++ gpios = <&gpio1 27 0>; ++ linux,default-trigger = "default-on"; ++ }; ++ }; ++ ++ mdio { ++ pinctrl-0 = <&mdio_pins>; ++ pinctrl-names = "default"; ++ phy0: ethernet-phy@0 { ++ reg = <0>; ++ }; ++ ++ phy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++ }; ++ ethernet@70000 { ++ pinctrl-0 = <&ge0_rgmii_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ phy = <&phy0>; ++ phy-mode = "rgmii-id"; ++ }; ++ ethernet@74000 { ++ pinctrl-0 = <&ge1_rgmii_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ phy = <&phy1>; ++ phy-mode = "rgmii-id"; ++ }; ++ ++ mvsdio@d4000 { ++ pinctrl-0 = <&sdio_pins3>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ /* ++ * No CD or WP GPIOs: SDIO interface used for ++ * Wifi/Bluetooth chip ++ */ ++ broken-cd; ++ }; ++ ++ usb@50000 { ++ status = "okay"; ++ }; ++ ++ usb@51000 { ++ status = "okay"; ++ }; ++ ++ i2c@11000 { ++ status = "okay"; ++ clock-frequency = <100000>; ++ pca9505: pca9505@25 { ++ compatible = "nxp,pca9505"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ reg = <0x25>; ++ }; ++ }; ++ ++ nand@d0000 { ++ status = "okay"; ++ num-cs = <1>; ++ marvell,nand-keep-config; ++ marvell,nand-enable-arbiter; ++ nand-on-flash-bbt; ++ ++ partition@0 { ++ label = "U-Boot"; ++ reg = <0 0x400000>; ++ }; ++ partition@400000 { ++ label = "Linux"; ++ reg = <0x400000 0x400000>; ++ }; ++ partition@800000 { ++ label = "Filesystem"; ++ reg = <0x800000 0x3f800000>; ++ }; ++ }; ++ }; ++ }; ++}; ++ ++&pinctrl { ++ smile_led_pins: smile-led-pins { ++ marvell,pins = "mpp63", "mpp64", "mpp47", "mpp59"; ++ marvell,function = "gpio"; ++ }; ++}; +-- +2.23.0 + diff --git a/libre-testing/linux-libre-cros/0003-mfd-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch b/libre-testing/linux-libre-cros/0003-mfd-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch new file mode 100644 index 000000000..926097948 --- /dev/null +++ b/libre-testing/linux-libre-cros/0003-mfd-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch @@ -0,0 +1,48 @@ +From affb9e39e0d2b1eefff47e2dc0a0aa3893b9bb5d Mon Sep 17 00:00:00 2001 +From: Tuowen Zhao +Date: Wed, 16 Oct 2019 15:06:29 -0600 +Subject: [PATCH 3/5] mfd: intel-lpss: Use devm_ioremap_uc for MMIO + +Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci +in MTRR. This will cause the system to hang during boot. If possible, +this bug could be corrected with a firmware update. + +This patch use devm_ioremap_uc to overwrite/ignore the MTRR settings +by forcing the use of strongly uncachable pages for intel-lpss. + +The BIOS bug is present on Dell XPS 13 7390 2-in-1: + +[ 0.001734] 5 base 4000000000 mask 6000000000 write-combining + +4000000000-7fffffffff : PCI Bus 0000:00 + 4000000000-400fffffff : 0000:00:02.0 (i915) + 4010000000-4010000fff : 0000:00:15.0 (intel-lpss-pci) + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=203485 +Cc: # v4.19+ +Tested-by: AceLan Kao +Signed-off-by: Tuowen Zhao +Acked-by: Mika Westerberg +Acked-by: Andy Shevchenko +Tested-by: Roman Gilg +Signed-off-by: Lee Jones +--- + drivers/mfd/intel-lpss.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c +index bfe4ff337581..b0f0781a6b9c 100644 +--- a/drivers/mfd/intel-lpss.c ++++ b/drivers/mfd/intel-lpss.c +@@ -384,7 +384,7 @@ int intel_lpss_probe(struct device *dev, + if (!lpss) + return -ENOMEM; + +- lpss->priv = devm_ioremap(dev, info->mem->start + LPSS_PRIV_OFFSET, ++ lpss->priv = devm_ioremap_uc(dev, info->mem->start + LPSS_PRIV_OFFSET, + LPSS_PRIV_SIZE); + if (!lpss->priv) + return -ENOMEM; +-- +2.24.0 + diff --git a/libre-testing/linux-libre-cros/0004-PCI-pciehp-Do-not-disable-interrupt-twice-on-suspend.patch b/libre-testing/linux-libre-cros/0004-PCI-pciehp-Do-not-disable-interrupt-twice-on-suspend.patch new file mode 100644 index 000000000..f3cba134a --- /dev/null +++ b/libre-testing/linux-libre-cros/0004-PCI-pciehp-Do-not-disable-interrupt-twice-on-suspend.patch @@ -0,0 +1,99 @@ +From bdbb6d41bab0f525b679cf5018f77d5299773568 Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Tue, 29 Oct 2019 20:00:21 +0300 +Subject: [PATCH 4/5] PCI: pciehp: Do not disable interrupt twice on suspend + +We try to keep PCIe hotplug ports runtime suspended when entering system +suspend. Because the PCIe portdrv sets the DPM_FLAG_NEVER_SKIP flag, the PM +core always calls system suspend/resume hooks even if the device is left +runtime suspended. Since PCIe hotplug driver re-used the same function for +both runtime suspend and system suspend, it ended up disabling hotplug +interrupt twice and the second time following was printed: + + pciehp 0000:03:01.0:pcie204: pcie_do_write_cmd: no response from device + +Prevent this from happening by checking whether the device is already +runtime suspended when the system suspend hook is called. + +Fixes: 9c62f0bfb832 ("PCI: pciehp: Implement runtime PM callbacks") +Link: https://lore.kernel.org/r/20191029170022.57528-1-mika.westerberg@linux.intel.com +Reported-by: Kai-Heng Feng +Tested-by: Kai-Heng Feng +Signed-off-by: Mika Westerberg +Signed-off-by: Bjorn Helgaas +Reviewed-by: Rafael J. Wysocki +--- + drivers/pci/hotplug/pciehp_core.c | 25 +++++++++++++++++++++++-- + 1 file changed, 23 insertions(+), 2 deletions(-) + +diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c +index b3122c151b80..56daad828c9e 100644 +--- a/drivers/pci/hotplug/pciehp_core.c ++++ b/drivers/pci/hotplug/pciehp_core.c +@@ -253,7 +253,7 @@ static bool pme_is_native(struct pcie_device *dev) + return pcie_ports_native || host->native_pme; + } + +-static int pciehp_suspend(struct pcie_device *dev) ++static void pciehp_disable_interrupt(struct pcie_device *dev) + { + /* + * Disable hotplug interrupt so that it does not trigger +@@ -261,7 +261,19 @@ static int pciehp_suspend(struct pcie_device *dev) + */ + if (pme_is_native(dev)) + pcie_disable_interrupt(get_service_data(dev)); ++} + ++#ifdef CONFIG_PM_SLEEP ++static int pciehp_suspend(struct pcie_device *dev) ++{ ++ /* ++ * If the port is already runtime suspended we can keep it that ++ * way. ++ */ ++ if (dev_pm_smart_suspend_and_suspended(&dev->port->dev)) ++ return 0; ++ ++ pciehp_disable_interrupt(dev); + return 0; + } + +@@ -279,6 +291,7 @@ static int pciehp_resume_noirq(struct pcie_device *dev) + + return 0; + } ++#endif + + static int pciehp_resume(struct pcie_device *dev) + { +@@ -292,6 +305,12 @@ static int pciehp_resume(struct pcie_device *dev) + return 0; + } + ++static int pciehp_runtime_suspend(struct pcie_device *dev) ++{ ++ pciehp_disable_interrupt(dev); ++ return 0; ++} ++ + static int pciehp_runtime_resume(struct pcie_device *dev) + { + struct controller *ctrl = get_service_data(dev); +@@ -318,10 +337,12 @@ static struct pcie_port_service_driver hpdriver_portdrv = { + .remove = pciehp_remove, + + #ifdef CONFIG_PM ++#ifdef CONFIG_PM_SLEEP + .suspend = pciehp_suspend, + .resume_noirq = pciehp_resume_noirq, + .resume = pciehp_resume, +- .runtime_suspend = pciehp_suspend, ++#endif ++ .runtime_suspend = pciehp_runtime_suspend, + .runtime_resume = pciehp_runtime_resume, + #endif /* PM */ + }; +-- +2.24.0 + diff --git a/libre-testing/linux-libre-cros/0004-fix-mvsdio-eMMC-timing.patch b/libre-testing/linux-libre-cros/0004-fix-mvsdio-eMMC-timing.patch new file mode 100644 index 000000000..791a546d6 --- /dev/null +++ b/libre-testing/linux-libre-cros/0004-fix-mvsdio-eMMC-timing.patch @@ -0,0 +1,38 @@ +From 579d132a05177e4b85d3ff2321762948fd78b420 Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Fri, 5 Sep 2014 15:43:56 -0600 +Subject: [PATCH 4/9] fix mvsdio eMMC timing + +These changes from Globalscale change the MMC timing to allow the eMMC versions +of the Mirabox and SMILE Plug to work. + +Signed-off-by: Kevin Mihelich +--- + drivers/mmc/host/mvsdio.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c +index 74a0a7fbbf7f..92eadb116762 100644 +--- a/drivers/mmc/host/mvsdio.c ++++ b/drivers/mmc/host/mvsdio.c +@@ -90,7 +90,7 @@ static int mvsd_setup_data(struct mvsd_host *host, struct mmc_data *data) + tmout_index = fls(tmout - 1) - 12; + if (tmout_index < 0) + tmout_index = 0; +- if (tmout_index > MVSD_HOST_CTRL_TMOUT_MAX) ++// if (tmout_index > MVSD_HOST_CTRL_TMOUT_MAX) //by steven, try to setup the timeout to maximum value + tmout_index = MVSD_HOST_CTRL_TMOUT_MAX; + + dev_dbg(host->dev, "data %s at 0x%08x: blocks=%d blksz=%d tmout=%u (%d)\n", +@@ -613,6 +613,8 @@ static void mvsd_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) + u32 m = DIV_ROUND_UP(host->base_clock, ios->clock) - 1; + if (m > MVSD_BASE_DIV_MAX) + m = MVSD_BASE_DIV_MAX; ++ if(ios->clock==50000000 ) //by steven ++ m=1; + mvsd_write(MVSD_CLK_DIV, m); + host->clock = ios->clock; + host->ns_per_clk = 1000000000 / (host->base_clock / (m+1)); +-- +2.23.0 + diff --git a/libre-testing/linux-libre-cros/0005-PCI-pciehp-Prevent-deadlock-on-disconnect.patch b/libre-testing/linux-libre-cros/0005-PCI-pciehp-Prevent-deadlock-on-disconnect.patch new file mode 100644 index 000000000..0fc654b74 --- /dev/null +++ b/libre-testing/linux-libre-cros/0005-PCI-pciehp-Prevent-deadlock-on-disconnect.patch @@ -0,0 +1,272 @@ +From 23db61d908b9a4854c9b15565d4cbfa800c45cfe Mon Sep 17 00:00:00 2001 +From: Mika Westerberg +Date: Tue, 29 Oct 2019 20:00:22 +0300 +Subject: [PATCH 5/5] PCI: pciehp: Prevent deadlock on disconnect + +This addresses deadlocks in these common cases in hierarchies containing +two switches: + + - All involved ports are runtime suspended and they are unplugged. This + can happen easily if the drivers involved automatically enable runtime + PM (xHCI for example does that). + + - System is suspended (e.g., closing the lid on a laptop) with a dock + + something else connected, and the dock is unplugged while suspended. + +These cases lead to the following deadlock: + + INFO: task irq/126-pciehp:198 blocked for more than 120 seconds. + irq/126-pciehp D 0 198 2 0x80000000 + Call Trace: + schedule+0x2c/0x80 + schedule_timeout+0x246/0x350 + wait_for_completion+0xb7/0x140 + kthread_stop+0x49/0x110 + free_irq+0x32/0x70 + pcie_shutdown_notification+0x2f/0x50 + pciehp_remove+0x27/0x50 + pcie_port_remove_service+0x36/0x50 + device_release_driver+0x12/0x20 + bus_remove_device+0xec/0x160 + device_del+0x13b/0x350 + device_unregister+0x1a/0x60 + remove_iter+0x1e/0x30 + device_for_each_child+0x56/0x90 + pcie_port_device_remove+0x22/0x40 + pcie_portdrv_remove+0x20/0x60 + pci_device_remove+0x3e/0xc0 + device_release_driver_internal+0x18c/0x250 + device_release_driver+0x12/0x20 + pci_stop_bus_device+0x6f/0x90 + pci_stop_bus_device+0x31/0x90 + pci_stop_and_remove_bus_device+0x12/0x20 + pciehp_unconfigure_device+0x88/0x140 + pciehp_disable_slot+0x6a/0x110 + pciehp_handle_presence_or_link_change+0x263/0x400 + pciehp_ist+0x1c9/0x1d0 + irq_thread_fn+0x24/0x60 + irq_thread+0xeb/0x190 + kthread+0x120/0x140 + + INFO: task irq/190-pciehp:2288 blocked for more than 120 seconds. + irq/190-pciehp D 0 2288 2 0x80000000 + Call Trace: + __schedule+0x2a2/0x880 + schedule+0x2c/0x80 + schedule_preempt_disabled+0xe/0x10 + mutex_lock+0x2c/0x30 + pci_lock_rescan_remove+0x15/0x20 + pciehp_unconfigure_device+0x4d/0x140 + pciehp_disable_slot+0x6a/0x110 + pciehp_handle_presence_or_link_change+0x263/0x400 + pciehp_ist+0x1c9/0x1d0 + irq_thread_fn+0x24/0x60 + irq_thread+0xeb/0x190 + kthread+0x120/0x140 + +What happens here is that the whole hierarchy is runtime resumed and the +parent PCIe downstream port, which got the hot-remove event, starts +removing devices below it, taking pci_lock_rescan_remove() lock. When the +child PCIe port is runtime resumed it calls pciehp_check_presence() which +ends up calling pciehp_card_present() and pciehp_check_link_active(). Both +of these use pcie_capability_read_word(), which notices that the underlying +device is already gone and returns PCIBIOS_DEVICE_NOT_FOUND with the +capability value set to 0. When pciehp gets this value it thinks that its +child device is also hot-removed and schedules its IRQ thread to handle the +event. + +The deadlock happens when the child's IRQ thread runs and tries to acquire +pci_lock_rescan_remove() which is already taken by the parent and the +parent waits for the child's IRQ thread to finish. + +Prevent this from happening by checking the return value of +pcie_capability_read_word() and if it is PCIBIOS_DEVICE_NOT_FOUND stop +performing any hot-removal activities. + +[bhelgaas: add common scenarios to commit log] +Link: https://lore.kernel.org/r/20191029170022.57528-2-mika.westerberg@linux.intel.com +Tested-by: Kai-Heng Feng +Signed-off-by: Mika Westerberg +Signed-off-by: Bjorn Helgaas +--- + drivers/pci/hotplug/pciehp.h | 6 ++-- + drivers/pci/hotplug/pciehp_core.c | 11 ++++-- + drivers/pci/hotplug/pciehp_ctrl.c | 4 +-- + drivers/pci/hotplug/pciehp_hpc.c | 59 +++++++++++++++++++++++++------ + 4 files changed, 61 insertions(+), 19 deletions(-) + +diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h +index 654c972b8ea0..afea59a3aad2 100644 +--- a/drivers/pci/hotplug/pciehp.h ++++ b/drivers/pci/hotplug/pciehp.h +@@ -172,10 +172,10 @@ void pciehp_set_indicators(struct controller *ctrl, int pwr, int attn); + + void pciehp_get_latch_status(struct controller *ctrl, u8 *status); + int pciehp_query_power_fault(struct controller *ctrl); +-bool pciehp_card_present(struct controller *ctrl); +-bool pciehp_card_present_or_link_active(struct controller *ctrl); ++int pciehp_card_present(struct controller *ctrl); ++int pciehp_card_present_or_link_active(struct controller *ctrl); + int pciehp_check_link_status(struct controller *ctrl); +-bool pciehp_check_link_active(struct controller *ctrl); ++int pciehp_check_link_active(struct controller *ctrl); + void pciehp_release_ctrl(struct controller *ctrl); + + int pciehp_sysfs_enable_slot(struct hotplug_slot *hotplug_slot); +diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c +index 56daad828c9e..312cc45c44c7 100644 +--- a/drivers/pci/hotplug/pciehp_core.c ++++ b/drivers/pci/hotplug/pciehp_core.c +@@ -139,10 +139,15 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) + { + struct controller *ctrl = to_ctrl(hotplug_slot); + struct pci_dev *pdev = ctrl->pcie->port; ++ int ret; + + pci_config_pm_runtime_get(pdev); +- *value = pciehp_card_present_or_link_active(ctrl); ++ ret = pciehp_card_present_or_link_active(ctrl); + pci_config_pm_runtime_put(pdev); ++ if (ret < 0) ++ return ret; ++ ++ *value = ret; + return 0; + } + +@@ -158,13 +163,13 @@ static int get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value) + */ + static void pciehp_check_presence(struct controller *ctrl) + { +- bool occupied; ++ int occupied; + + down_read(&ctrl->reset_lock); + mutex_lock(&ctrl->state_lock); + + occupied = pciehp_card_present_or_link_active(ctrl); +- if ((occupied && (ctrl->state == OFF_STATE || ++ if ((occupied > 0 && (ctrl->state == OFF_STATE || + ctrl->state == BLINKINGON_STATE)) || + (!occupied && (ctrl->state == ON_STATE || + ctrl->state == BLINKINGOFF_STATE))) +diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c +index 21af7b16d7a4..c760a13ec7b1 100644 +--- a/drivers/pci/hotplug/pciehp_ctrl.c ++++ b/drivers/pci/hotplug/pciehp_ctrl.c +@@ -226,7 +226,7 @@ void pciehp_handle_disable_request(struct controller *ctrl) + + void pciehp_handle_presence_or_link_change(struct controller *ctrl, u32 events) + { +- bool present, link_active; ++ int present, link_active; + + /* + * If the slot is on and presence or link has changed, turn it off. +@@ -257,7 +257,7 @@ void pciehp_handle_presence_or_link_change(struct controller *ctrl, u32 events) + mutex_lock(&ctrl->state_lock); + present = pciehp_card_present(ctrl); + link_active = pciehp_check_link_active(ctrl); +- if (!present && !link_active) { ++ if (present <= 0 && link_active <= 0) { + mutex_unlock(&ctrl->state_lock); + return; + } +diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c +index 1a522c1c4177..526a8f70bac5 100644 +--- a/drivers/pci/hotplug/pciehp_hpc.c ++++ b/drivers/pci/hotplug/pciehp_hpc.c +@@ -201,17 +201,29 @@ static void pcie_write_cmd_nowait(struct controller *ctrl, u16 cmd, u16 mask) + pcie_do_write_cmd(ctrl, cmd, mask, false); + } + +-bool pciehp_check_link_active(struct controller *ctrl) ++/** ++ * pciehp_check_link_active() - Is the link active ++ * @ctrl: PCIe hotplug controller ++ * ++ * Check whether the downstream link is currently active. Note it is ++ * possible that the card is removed immediately after this so the ++ * caller may need to take it into account. ++ * ++ * If the hotplug controller itself is not available anymore returns ++ * %-ENODEV. ++ */ ++int pciehp_check_link_active(struct controller *ctrl) + { + struct pci_dev *pdev = ctrl_dev(ctrl); + u16 lnk_status; +- bool ret; ++ int ret; + +- pcie_capability_read_word(pdev, PCI_EXP_LNKSTA, &lnk_status); +- ret = !!(lnk_status & PCI_EXP_LNKSTA_DLLLA); ++ ret = pcie_capability_read_word(pdev, PCI_EXP_LNKSTA, &lnk_status); ++ if (ret == PCIBIOS_DEVICE_NOT_FOUND || lnk_status == (u16)~0) ++ return -ENODEV; + +- if (ret) +- ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); ++ ret = !!(lnk_status & PCI_EXP_LNKSTA_DLLLA); ++ ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); + + return ret; + } +@@ -373,13 +385,29 @@ void pciehp_get_latch_status(struct controller *ctrl, u8 *status) + *status = !!(slot_status & PCI_EXP_SLTSTA_MRLSS); + } + +-bool pciehp_card_present(struct controller *ctrl) ++/** ++ * pciehp_card_present() - Is the card present ++ * @ctrl: PCIe hotplug controller ++ * ++ * Function checks whether the card is currently present in the slot and ++ * in that case returns true. Note it is possible that the card is ++ * removed immediately after the check so the caller may need to take ++ * this into account. ++ * ++ * It the hotplug controller itself is not available anymore returns ++ * %-ENODEV. ++ */ ++int pciehp_card_present(struct controller *ctrl) + { + struct pci_dev *pdev = ctrl_dev(ctrl); + u16 slot_status; ++ int ret; + +- pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); +- return slot_status & PCI_EXP_SLTSTA_PDS; ++ ret = pcie_capability_read_word(pdev, PCI_EXP_SLTSTA, &slot_status); ++ if (ret == PCIBIOS_DEVICE_NOT_FOUND || slot_status == (u16)~0) ++ return -ENODEV; ++ ++ return !!(slot_status & PCI_EXP_SLTSTA_PDS); + } + + /** +@@ -390,10 +418,19 @@ bool pciehp_card_present(struct controller *ctrl) + * Presence Detect State bit, this helper also returns true if the Link Active + * bit is set. This is a concession to broken hotplug ports which hardwire + * Presence Detect State to zero, such as Wilocity's [1ae9:0200]. ++ * ++ * Returns: %1 if the slot is occupied and %0 if it is not. If the hotplug ++ * port is not present anymore returns %-ENODEV. + */ +-bool pciehp_card_present_or_link_active(struct controller *ctrl) ++int pciehp_card_present_or_link_active(struct controller *ctrl) + { +- return pciehp_card_present(ctrl) || pciehp_check_link_active(ctrl); ++ int ret; ++ ++ ret = pciehp_card_present(ctrl); ++ if (ret) ++ return ret; ++ ++ return pciehp_check_link_active(ctrl); + } + + int pciehp_query_power_fault(struct controller *ctrl) +-- +2.24.0 + diff --git a/libre-testing/linux-libre-cros/0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch b/libre-testing/linux-libre-cros/0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch new file mode 100644 index 000000000..e95960163 --- /dev/null +++ b/libre-testing/linux-libre-cros/0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch @@ -0,0 +1,95 @@ +From 585c73f82751043ebcf1e097a29bb9c6d2c3fbd1 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 18 Feb 2014 01:43:50 -0300 +Subject: [PATCH 5/9] net/smsc95xx: Allow mac address to be set as a parameter + +--- + drivers/net/usb/smsc95xx.c | 56 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 56 insertions(+) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index 355be77f4241..c94a7193e0b9 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -48,6 +48,7 @@ + #define SUSPEND_SUSPEND3 (0x08) + #define SUSPEND_ALLMODES (SUSPEND_SUSPEND0 | SUSPEND_SUSPEND1 | \ + SUSPEND_SUSPEND2 | SUSPEND_SUSPEND3) ++#define MAC_ADDR_LEN (6) + + #define CARRIER_CHECK_DELAY (2 * HZ) + +@@ -70,6 +71,10 @@ static bool turbo_mode = true; + module_param(turbo_mode, bool, 0644); + MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction"); + ++static char *macaddr = ":"; ++module_param(macaddr, charp, 0); ++MODULE_PARM_DESC(macaddr, "MAC address"); ++ + static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, + u32 *data, int in_pm) + { +@@ -899,8 +904,59 @@ static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd) + return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL); + } + ++/* Check the macaddr module parameter for a MAC address */ ++static int smsc95xx_is_macaddr_param(struct usbnet *dev, u8 *dev_mac) ++{ ++ int i, j, got_num, num; ++ u8 mtbl[MAC_ADDR_LEN]; ++ ++ if (macaddr[0] == ':') ++ return 0; ++ ++ i = 0; ++ j = 0; ++ num = 0; ++ got_num = 0; ++ while (j < MAC_ADDR_LEN) { ++ if (macaddr[i] && macaddr[i] != ':') { ++ got_num++; ++ if ('0' <= macaddr[i] && macaddr[i] <= '9') ++ num = num * 16 + macaddr[i] - '0'; ++ else if ('A' <= macaddr[i] && macaddr[i] <= 'F') ++ num = num * 16 + 10 + macaddr[i] - 'A'; ++ else if ('a' <= macaddr[i] && macaddr[i] <= 'f') ++ num = num * 16 + 10 + macaddr[i] - 'a'; ++ else ++ break; ++ i++; ++ } else if (got_num == 2) { ++ mtbl[j++] = (u8) num; ++ num = 0; ++ got_num = 0; ++ i++; ++ } else { ++ break; ++ } ++ } ++ ++ if (j == MAC_ADDR_LEN) { ++ netif_dbg(dev, ifup, dev->net, "Overriding MAC address with: " ++ "%02x:%02x:%02x:%02x:%02x:%02x\n", mtbl[0], mtbl[1], mtbl[2], ++ mtbl[3], mtbl[4], mtbl[5]); ++ for (i = 0; i < MAC_ADDR_LEN; i++) ++ dev_mac[i] = mtbl[i]; ++ return 1; ++ } else { ++ return 0; ++ } ++} ++ + static void smsc95xx_init_mac_address(struct usbnet *dev) + { ++ /* Check module parameters */ ++ if (smsc95xx_is_macaddr_param(dev, dev->net->dev_addr)) ++ return; ++ + const u8 *mac_addr; + + /* maybe the boot loader passed the MAC address in devicetree */ +-- +2.23.0 + diff --git a/libre-testing/linux-libre-cros/0006-set-default-cubietruck-led-triggers.patch b/libre-testing/linux-libre-cros/0006-set-default-cubietruck-led-triggers.patch new file mode 100644 index 000000000..efbbb49c4 --- /dev/null +++ b/libre-testing/linux-libre-cros/0006-set-default-cubietruck-led-triggers.patch @@ -0,0 +1,33 @@ +From 8fb925eac047386a298303e501042a0fd30e9ef9 Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Sat, 14 Feb 2015 12:32:27 +0100 +Subject: [PATCH 6/9] set default cubietruck led triggers + +Signed-off-by: Kevin Mihelich +--- + arch/arm/boot/dts/sun7i-a20-cubietruck.dts | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts +index 8c8dee6ea461..4f52a11b913e 100644 +--- a/arch/arm/boot/dts/sun7i-a20-cubietruck.dts ++++ b/arch/arm/boot/dts/sun7i-a20-cubietruck.dts +@@ -78,6 +78,7 @@ + blue { + label = "cubietruck:blue:usr"; + gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; + }; + + orange { +@@ -93,6 +94,7 @@ + green { + label = "cubietruck:green:usr"; + gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "mmc0"; + }; + }; + +-- +2.23.0 + diff --git a/libre-testing/linux-libre-cros/0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch b/libre-testing/linux-libre-cros/0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch new file mode 100644 index 000000000..40413f479 --- /dev/null +++ b/libre-testing/linux-libre-cros/0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch @@ -0,0 +1,30 @@ +From 054ac5f337ad4f79b22c9b191dc47f001722f0d6 Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Thu, 11 Aug 2016 00:42:37 -0600 +Subject: [PATCH 7/9] exynos4412-odroid: set higher minimum buck2 regulator + voltage + +Set a higher minimum voltage to help reboot issue. +http://www.spinics.net/lists/linux-samsung-soc/msg54434.html + +Signed-off-by: Kevin Mihelich +--- + arch/arm/boot/dts/exynos4412-odroid-common.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +index ea55f377d17c..a7bfc58bbc79 100644 +--- a/arch/arm/boot/dts/exynos4412-odroid-common.dtsi ++++ b/arch/arm/boot/dts/exynos4412-odroid-common.dtsi +@@ -430,7 +430,7 @@ + + buck2_reg: BUCK2 { + regulator-name = "vdd_arm"; +- regulator-min-microvolt = <900000>; ++ regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1350000>; + regulator-always-on; + regulator-boot-on; +-- +2.23.0 + diff --git a/libre-testing/linux-libre-cros/0008-ARM-dove-enable-ethernet-on-D3Plug.patch b/libre-testing/linux-libre-cros/0008-ARM-dove-enable-ethernet-on-D3Plug.patch new file mode 100644 index 000000000..b1687bf5c --- /dev/null +++ b/libre-testing/linux-libre-cros/0008-ARM-dove-enable-ethernet-on-D3Plug.patch @@ -0,0 +1,31 @@ +From 8b696580b73c7f6e7f3e9635bd2ad1c5c59e9082 Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Sun, 7 May 2017 13:32:25 -0600 +Subject: [PATCH 8/9] ARM: dove: enable ethernet on D3Plug + +Signed-off-by: Kevin Mihelich +--- + arch/arm/boot/dts/dove-d3plug.dts | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/arch/arm/boot/dts/dove-d3plug.dts b/arch/arm/boot/dts/dove-d3plug.dts +index 826026c28f90..a4c9963e1261 100644 +--- a/arch/arm/boot/dts/dove-d3plug.dts ++++ b/arch/arm/boot/dts/dove-d3plug.dts +@@ -61,6 +61,13 @@ + &uart0 { status = "okay"; }; + &sata0 { status = "okay"; }; + &i2c0 { status = "okay"; }; ++&mdio { status = "okay"; }; ++ð { status = "okay"; }; ++ ++ðphy { ++ compatible = "marvell,88e1310"; ++ reg = <1>; ++}; + + /* Samsung M8G2F eMMC */ + &sdio0 { +-- +2.23.0 + diff --git a/libre-testing/linux-libre-cros/0009-USB-Armory-MkII-support.patch b/libre-testing/linux-libre-cros/0009-USB-Armory-MkII-support.patch new file mode 100644 index 000000000..4c8f8fed3 --- /dev/null +++ b/libre-testing/linux-libre-cros/0009-USB-Armory-MkII-support.patch @@ -0,0 +1,555 @@ +From 55e7015aa06dd943b55a0101beddae1c811a2be5 Mon Sep 17 00:00:00 2001 +From: Kevin Mihelich +Date: Sun, 11 Aug 2019 12:34:17 -0600 +Subject: [PATCH 9/9] USB Armory MkII support + +--- + arch/arm/boot/dts/Makefile | 2 + + arch/arm/boot/dts/imx6ul-usbarmory.dts | 255 +++++++++++++++++++++++ + arch/arm/boot/dts/imx6ull-usbarmory.dts | 256 ++++++++++++++++++++++++ + 3 files changed, 513 insertions(+) + create mode 100644 arch/arm/boot/dts/imx6ul-usbarmory.dts + create mode 100644 arch/arm/boot/dts/imx6ull-usbarmory.dts + +diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile +index a0f92b9dbd7d..5d6e9f76f6db 100644 +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -580,9 +580,11 @@ dtb-$(CONFIG_SOC_IMX6UL) += \ + imx6ul-tx6ul-0010.dtb \ + imx6ul-tx6ul-0011.dtb \ + imx6ul-tx6ul-mainboard.dtb \ ++ imx6ul-usbarmory.dtb \ + imx6ull-14x14-evk.dtb \ + imx6ull-colibri-eval-v3.dtb \ + imx6ull-colibri-wifi-eval-v3.dtb \ ++ imx6ull-usbarmory.dtb \ + imx6ull-phytec-segin-ff-rdk-nand.dtb \ + imx6ull-phytec-segin-ff-rdk-emmc.dtb \ + imx6ull-phytec-segin-lc-rdk-nand.dtb \ +diff --git a/arch/arm/boot/dts/imx6ul-usbarmory.dts b/arch/arm/boot/dts/imx6ul-usbarmory.dts +new file mode 100644 +index 000000000000..3936ef8a64f1 +--- /dev/null ++++ b/arch/arm/boot/dts/imx6ul-usbarmory.dts +@@ -0,0 +1,255 @@ ++/* ++ * USB armory Mk II device tree file ++ * https://inversepath.com/usbarmory ++ * ++ * Copyright (C) 2019, F-Secure Corporation ++ * Andrej Rosano ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file 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. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++ ++#include "imx6ul.dtsi" ++ ++/ { ++ model = "F-Secure USB armory Mk II"; ++ compatible = "inversepath,imx6ul-usbarmory-mkII", "fsl,imx6ul"; ++ ++ chosen { ++ stdout-path = &uart2; ++ }; ++ ++ memory { ++ reg = <0x80000000 0x20000000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_led>; ++ ++ led-white { ++ label = "LED_WHITE"; ++ gpios = <&gpio4 21 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ led-blue { ++ label = "LED_BLUE"; ++ gpios = <&gpio4 22 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ regulators { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ reg_sd1_vmmc: sd1_regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "VSD_3V3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ }; ++}; ++ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_bluetooth>; ++ uart-has-rtscts; ++ status = "okay"; ++}; ++ ++&uart2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_uart2>; ++ status = "okay"; ++}; ++ ++&usdhc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_usdhc1>; ++ no-1-8-v; ++ keep-power-in-suspend; ++ wakeup-source; ++ status = "okay"; ++}; ++ ++&usdhc2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_usdhc2>; ++ non-removable; ++ status = "okay"; ++}; ++ ++&i2c1 { ++ pinctrl-0 = <&pinctrl_i2c1>; ++ status = "okay"; ++}; ++ ++&iomuxc { ++ pinctrl_uart2: uart2grp { ++ fsl,pins = < ++ MX6UL_PAD_UART2_TX_DATA__UART2_DCE_TX 0x1b0b1 ++ MX6UL_PAD_UART2_RX_DATA__UART2_DCE_RX 0x1b0b1 ++ >; ++ }; ++ ++ pinctrl_bluetooth: uart1grp { ++ fsl,pins = < ++ MX6UL_PAD_UART1_TX_DATA__UART1_DCE_TX 0x1b0b0 /* BT_UART_TX */ ++ MX6UL_PAD_UART1_RX_DATA__UART1_DCE_RX 0x1b0b0 /* BT_UART_RX */ ++ MX6UL_PAD_UART1_CTS_B__UART1_DCE_CTS 0x1b0b0 /* BT_UART_CTS */ ++ MX6UL_PAD_GPIO1_IO07__UART1_DCE_RTS 0x130b0 /* BT_UART_RTS */ ++ MX6UL_PAD_UART3_TX_DATA__GPIO1_IO24 0x1f020 /* BT_UART_DSR */ ++ MX6UL_PAD_UART3_RX_DATA__GPIO1_IO25 0x10020 /* BT_UART_DTR */ ++ MX6UL_PAD_GPIO1_IO04__GPIO1_IO04 0x1f020 /* BT_SWDCLK */ ++ MX6UL_PAD_GPIO1_IO05__GPIO1_IO05 0x1f020 /* BT_SWDIO */ ++ MX6UL_PAD_GPIO1_IO09__GPIO1_IO09 0x1f020 /* BT_RESET */ ++ MX6UL_PAD_UART3_RTS_B__GPIO1_IO27 0x1f020 /* BT_SWITCH_1 */ ++ MX6UL_PAD_UART3_CTS_B__GPIO1_IO26 0x1f020 /* BT_SWITCH_2 */ ++ >; ++ }; ++ ++ pinctrl_i2c1: i2c1grp { ++ fsl,pins = < ++ MX6UL_PAD_GPIO1_IO02__I2C1_SCL 0x4001b8b0 ++ MX6UL_PAD_GPIO1_IO03__I2C1_SDA 0x4001b8b0 ++ >; ++ }; ++ ++ pinctrl_led: ledgrp { ++ fsl,pins = < ++ MX6UL_PAD_CSI_DATA06__GPIO4_IO27 0x1f020 ++ MX6UL_PAD_CSI_DATA07__GPIO4_IO28 0x1f020 ++ >; ++ }; ++ ++ pinctrl_usdhc1: usdhc1grp { ++ fsl,pins = < ++ MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x1f019 ++ MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x1f019 ++ MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x1f019 ++ MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x1f019 ++ MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x1f019 ++ MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x1f019 ++ >; ++ }; ++ ++ pinctrl_usdhc2: usdhc2grp { ++ fsl,pins = < ++ MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x10071 ++ MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x17059 ++ MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x17059 ++ MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x17059 ++ MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x17059 ++ MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x17059 ++ MX6UL_PAD_NAND_DATA04__USDHC2_DATA4 0x17059 ++ MX6UL_PAD_NAND_DATA05__USDHC2_DATA5 0x17059 ++ MX6UL_PAD_NAND_DATA06__USDHC2_DATA6 0x17059 ++ MX6UL_PAD_NAND_DATA07__USDHC2_DATA7 0x17059 ++ >; ++ }; ++}; ++ ++&aips2 { ++ crypto: caam@2140000 { ++ compatible = "fsl,imx6ul-caam", "fsl,sec-v4.0"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ reg = <0x2140000 0x3c000>; ++ ranges = <0 0x2140000 0x3c000>; ++ interrupts = ; ++ clocks = <&clks IMX6UL_CLK_CAAM_IPG>, <&clks IMX6UL_CLK_CAAM_ACLK>, ++ <&clks IMX6UL_CLK_CAAM_MEM>; ++ clock-names = "ipg", "aclk", "mem"; ++ ++ sec_jr0: jr0@1000 { ++ compatible = "fsl,sec-v4.0-job-ring"; ++ reg = <0x1000 0x1000>; ++ interrupts = ; ++ }; ++ ++ sec_jr1: jr1@2000 { ++ compatible = "fsl,sec-v4.0-job-ring"; ++ reg = <0x2000 0x1000>; ++ interrupts = ; ++ }; ++ sec_jr2: jr2@3000 { ++ compatible = "fsl,sec-v4.0-job-ring"; ++ reg = <0x3000 0x1000>; ++ interrupts = ; ++ }; ++ }; ++}; ++ ++/ { ++ soc { ++ caam_sm: caam-sm@00100000 { ++ compatible = "fsl,imx7d-caam-sm", "fsl,imx6q-caam-sm"; ++ reg = <0x00100000 0x3fff>; ++ }; ++ ++ irq_sec_vio: caam_secvio { ++ compatible = "fsl,imx7d-caam-secvio", "fsl,imx6q-caam-secvio"; ++ interrupts = ; ++ }; ++ }; ++ ++ caam_keyblob: caam-keyblob { ++ compatible = "fsl,sec-v4.0-keyblob"; ++ status = "okay"; ++ }; ++}; ++ ++&usbotg1 { ++ dr_mode = "otg"; ++ disable-over-current; ++ tpl-support; ++ status = "okay"; ++}; ++ ++&usbotg2 { ++ dr_mode = "host"; ++ disable-over-current; ++ tpl-support; ++ status = "okay"; ++}; +diff --git a/arch/arm/boot/dts/imx6ull-usbarmory.dts b/arch/arm/boot/dts/imx6ull-usbarmory.dts +new file mode 100644 +index 000000000000..85cf30bff527 +--- /dev/null ++++ b/arch/arm/boot/dts/imx6ull-usbarmory.dts +@@ -0,0 +1,256 @@ ++/* ++ * USB armory Mk II device tree file ++ * https://inversepath.com/usbarmory ++ * ++ * Copyright (C) 2019, F-Secure Corporation ++ * Andrej Rosano ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file 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. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++ ++#include "imx6ul.dtsi" ++ ++/ { ++ model = "F-Secure USB armory Mk II"; ++ compatible = "inversepath,imx6ull-usbarmory-mkII", "fsl,imx6ull"; ++ ++ chosen { ++ stdout-path = &uart2; ++ }; ++ ++ memory { ++ reg = <0x80000000 0x20000000>; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_led>; ++ ++ led-white { ++ label = "LED_WHITE"; ++ gpios = <&gpio4 21 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ led-blue { ++ label = "LED_BLUE"; ++ gpios = <&gpio4 22 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ ++ regulators { ++ compatible = "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ reg_sd1_vmmc: sd1_regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "VSD_3V3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ }; ++ }; ++}; ++ ++/* Delete CAAM node in AIPS-2 (i.MX6UL specific) */ ++/delete-node/ &crypto; ++ ++&cpu0 { ++ operating-points = < ++ /* kHz uV */ ++ 900000 1275000 ++ 792000 1225000 ++ 528000 1175000 ++ 396000 1025000 ++ 198000 950000 ++ >; ++ fsl,soc-operating-points = < ++ /* KHz uV */ ++ 900000 1250000 ++ 792000 1175000 ++ 528000 1175000 ++ 396000 1175000 ++ 198000 1175000 ++ >; ++}; ++ ++&uart1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_bluetooth>; ++ uart-has-rtscts; ++ status = "okay"; ++}; ++ ++&uart2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_uart2>; ++ status = "okay"; ++}; ++ ++&usdhc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_usdhc1>; ++ no-1-8-v; ++ keep-power-in-suspend; ++ wakeup-source; ++ status = "okay"; ++}; ++ ++&usdhc2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_usdhc2>; ++ non-removable; ++ status = "okay"; ++}; ++ ++&i2c1 { ++ pinctrl-0 = <&pinctrl_i2c1>; ++ status = "okay"; ++}; ++ ++&iomuxc { ++ pinctrl_uart2: uart2grp { ++ fsl,pins = < ++ MX6UL_PAD_UART2_TX_DATA__UART2_DCE_TX 0x1b0b1 ++ MX6UL_PAD_UART2_RX_DATA__UART2_DCE_RX 0x1b0b1 ++ >; ++ }; ++ ++ pinctrl_bluetooth: uart1grp { ++ fsl,pins = < ++ MX6UL_PAD_UART1_TX_DATA__UART1_DCE_TX 0x1b0b0 /* BT_UART_TX */ ++ MX6UL_PAD_UART1_RX_DATA__UART1_DCE_RX 0x1b0b0 /* BT_UART_RX */ ++ MX6UL_PAD_UART1_CTS_B__UART1_DCE_CTS 0x1b0b0 /* BT_UART_CTS */ ++ MX6UL_PAD_GPIO1_IO07__UART1_DCE_RTS 0x130b0 /* BT_UART_RTS */ ++ MX6UL_PAD_UART3_TX_DATA__GPIO1_IO24 0x1f020 /* BT_UART_DSR */ ++ MX6UL_PAD_UART3_RX_DATA__GPIO1_IO25 0x10020 /* BT_UART_DTR */ ++ MX6UL_PAD_GPIO1_IO04__GPIO1_IO04 0x1f020 /* BT_SWDCLK */ ++ MX6UL_PAD_GPIO1_IO05__GPIO1_IO05 0x1f020 /* BT_SWDIO */ ++ MX6UL_PAD_GPIO1_IO09__GPIO1_IO09 0x1f020 /* BT_RESET */ ++ MX6UL_PAD_UART3_RTS_B__GPIO1_IO27 0x1f020 /* BT_SWITCH_1 */ ++ MX6UL_PAD_UART3_CTS_B__GPIO1_IO26 0x1f020 /* BT_SWITCH_2 */ ++ >; ++ }; ++ ++ pinctrl_i2c1: i2c1grp { ++ fsl,pins = < ++ MX6UL_PAD_GPIO1_IO02__I2C1_SCL 0x4001b8b0 ++ MX6UL_PAD_GPIO1_IO03__I2C1_SDA 0x4001b8b0 ++ >; ++ }; ++ ++ pinctrl_led: ledgrp { ++ fsl,pins = < ++ MX6UL_PAD_CSI_DATA06__GPIO4_IO27 0x1f020 ++ MX6UL_PAD_CSI_DATA07__GPIO4_IO28 0x1f020 ++ >; ++ }; ++ ++ pinctrl_usdhc1: usdhc1grp { ++ fsl,pins = < ++ MX6UL_PAD_SD1_CMD__USDHC1_CMD 0x1f019 ++ MX6UL_PAD_SD1_CLK__USDHC1_CLK 0x1f019 ++ MX6UL_PAD_SD1_DATA0__USDHC1_DATA0 0x1f019 ++ MX6UL_PAD_SD1_DATA1__USDHC1_DATA1 0x1f019 ++ MX6UL_PAD_SD1_DATA2__USDHC1_DATA2 0x1f019 ++ MX6UL_PAD_SD1_DATA3__USDHC1_DATA3 0x1f019 ++ >; ++ }; ++ ++ pinctrl_usdhc2: usdhc2grp { ++ fsl,pins = < ++ MX6UL_PAD_NAND_RE_B__USDHC2_CLK 0x10071 ++ MX6UL_PAD_NAND_WE_B__USDHC2_CMD 0x17059 ++ MX6UL_PAD_NAND_DATA00__USDHC2_DATA0 0x17059 ++ MX6UL_PAD_NAND_DATA01__USDHC2_DATA1 0x17059 ++ MX6UL_PAD_NAND_DATA02__USDHC2_DATA2 0x17059 ++ MX6UL_PAD_NAND_DATA03__USDHC2_DATA3 0x17059 ++ MX6UL_PAD_NAND_DATA04__USDHC2_DATA4 0x17059 ++ MX6UL_PAD_NAND_DATA05__USDHC2_DATA5 0x17059 ++ MX6UL_PAD_NAND_DATA06__USDHC2_DATA6 0x17059 ++ MX6UL_PAD_NAND_DATA07__USDHC2_DATA7 0x17059 ++ >; ++ }; ++}; ++ ++/ { ++ soc { ++ aips3: aips-bus@02200000 { ++ compatible = "fsl,aips-bus", "simple-bus"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ reg = <0x02200000 0x100000>; ++ ranges; ++ ++ dcp: dcp@02280000 { ++ compatible = "fsl,imx6ull-dcp", "fsl,imx6sl-dcp", "fsl,imx28-dcp"; ++ reg = <0x02280000 0x4000>; ++ interrupts = , ++ , ++ ; ++ clocks = <&clks IMX6ULL_CLK_DCP_CLK>; ++ clock-names = "dcp"; ++ }; ++ ++ rngb: rngb@02284000 { ++ compatible = "fsl,imx6sl-rng", "fsl,imx25-rngb", "fsl,imx-rng", "imx-rng"; ++ reg = <0x02284000 0x4000>; ++ interrupts = ; ++ clocks = <&clks IMX6UL_CLK_DUMMY>; ++ }; ++ }; ++ }; ++}; ++ ++&usbotg1 { ++ dr_mode = "peripheral"; ++ disable-over-current; ++ tpl-support; ++ status = "okay"; ++}; ++ ++&usbotg2 { ++ dr_mode = "host"; ++ disable-over-current; ++ tpl-support; ++ status = "okay"; ++}; +-- +2.23.0 + diff --git a/libre-testing/linux-libre-cros/PKGBUILD b/libre-testing/linux-libre-cros/PKGBUILD new file mode 100644 index 000000000..c4391af24 --- /dev/null +++ b/libre-testing/linux-libre-cros/PKGBUILD @@ -0,0 +1,323 @@ +# Maintainer: David P. + +_replacesarchkernel=('linux%') # '%' gets replaced with kernel suffix +_replacesoldkernels=() # '%' gets replaced with kernel suffix +_replacesoldmodules=() # '%' gets replaced with kernel suffix + +pkgbase=linux-libre-cros +pkgver=5.4.2 +pkgrel=1 +pkgdesc='Linux-libre' +rcnver=5.4.1 +rcnrel=armv7-x9 +url='https://gitlab.com/libreforks/linux-libre-cros' +arch=(armv7h) +license=(GPL2) +makedepends=( + bc kmod libelf + xmlto python-sphinx python-sphinx_rtd_theme graphviz imagemagick + uboot-tools vboot-utils dtc +) +options=('!strip') +_srcname=$pkgbase-chromeos-libre-v$pkgver +source=( + "$pkgbase-$pkgver.tar.gz::https://gitlab.com/libreforks/$pkgbase/-/archive/chromeos-libre-v$pkgver/$_srcname.tar.gz" + "https://repo.parabola.nu/other/linux-libre/logos/logo_linux_"{clut224.ppm,vga16.ppm,mono.pbm}{,.sig} + config # the main kernel config files + linux.preset # preset file for mkinitcpio ramdisk + "kernel"{.its,.keyblock,_data_key.vbprivk} # files for signing Chromebooks kernels + + # maintain the TTY over USB disconnects + # http://www.coreboot.org/EHCI_Gadget_Debug + 0001-usb-serial-gadget-no-TTY-hangup-on-USB-disconnect-WI.patch + # fix Atmel maXTouch touchscreen support + # https://labs.parabola.nu/issues/877 + # http://www.fsfla.org/pipermail/linux-libre/2015-November/003202.html + 0002-fix-Atmel-maXTouch-touchscreen-support.patch + # extracted patches from Arch Linux kernel sources + 0001-ZEN-Add-sysctl-and-CONFIG-to-disallow-unprivileged-C.patch + 0002-lib-devres-add-a-helper-function-for-ioremap_uc.patch + 0003-mfd-intel-lpss-Use-devm_ioremap_uc-for-MMIO.patch + 0004-PCI-pciehp-Do-not-disable-interrupt-twice-on-suspend.patch + 0005-PCI-pciehp-Prevent-deadlock-on-disconnect.patch + # RCN patch (CM3 firmware deblobbed and bloatware removed) + "https://repo.parabola.nu/other/rcn-libre/patches/$rcnver/rcn-libre-$rcnver-$rcnrel.patch"{,.sig} + # Arch Linux ARM patches + 0001-ARM-atags-add-support-for-Marvell-s-u-boot.patch + 0002-ARM-atags-fdt-retrieve-MAC-addresses-from-Marvell-bo.patch + 0003-SMILE-Plug-device-tree-file.patch + 0004-fix-mvsdio-eMMC-timing.patch + 0005-net-smsc95xx-Allow-mac-address-to-be-set-as-a-parame.patch + 0006-set-default-cubietruck-led-triggers.patch + 0007-exynos4412-odroid-set-higher-minimum-buck2-regulator.patch + 0008-ARM-dove-enable-ethernet-on-D3Plug.patch + 0009-USB-Armory-MkII-support.patch +) +validpgpkeys=( + '474402C8C582DAFBE389C427BCB7CF877E7D47A7' # Alexandre Oliva + '6DB9C4B4F0D8C0DC432CF6E4227CA7C556B2BA78' # David P. +) +sha512sums=('4084fd2fbb4d40212180bfe998aaa7b11e612801849750e53e14c9ef3fafd1fb59105206cbfc62d555d735407810b1a66f7dffd382ffac188a10cf9b682d5d2f' + '13cb5bc42542e7b8bb104d5f68253f6609e463b6799800418af33eb0272cc269aaa36163c3e6f0aacbdaaa1d05e2827a4a7c4a08a029238439ed08b89c564bb3' + 'SKIP' + '7a3716bfe3b9f546da309c7492f3e08f8f506813afeb1c737a474c83313d5c313cf4582b65215c2cfce3b74d9d1021c96e8badafe8f6e5b01fe28d2b5c61ae78' + 'SKIP' + '267295aa0cea65684968420c68b32f1a66a22d018b9d2b2c1ef14267bcf4cb68aaf7099d073cbfefe6c25c8608bdcbbd45f7ac8893fdcecbf1e621abdfe9ecc1' + 'SKIP' + 'a777070b3b52084a8ef49b7617581c0d5459f08452ff73616930e6f15c2ffac64faeb445a2fe7b1ec5e91088ef880f0a7e09bb91efc20c20303e418cd0bb698c' + 'f01e7925b262d2874a8a991b1f27d057356a2a384d2012b61be5a631d4e4d7cf87461c8fb9e7f183831f5a829ad204897f1f0545a52df6288a0e04a5c2e31b96' + '167bc73c6c1c63931806238905dc44c7d87c5a5c0f6293159f2133dfe717fb44081018d810675716d1605ec7dff5e8333b87b19e09e2de21d0448e447437873b' + 'bb6718984a7357c9b00c37e4788480e5b8b75018c172ecc1441bc3fc5d2d42444eb5d8c7f9d2e3a7d6fed6d03acb565e3c0559486e494c40a7fe6bd0570c9ede' + '143dea30c6da00e504c99984a98a0eb2411f558fcdd9dfa7f607d6c14e9e7dffff9cb00121d9317044b07e3e210808286598c785ee854084b993ec9cb14d8232' + '02af4dd2a007e41db0c63822c8ab3b80b5d25646af1906dc85d0ad9bb8bbf5236f8e381d7f91cf99ed4b0978c50aee37cb9567cdeef65b7ec3d91b882852b1af' + 'b8fe56e14006ab866970ddbd501c054ae37186ddc065bb869cf7d18db8c0d455118d5bda3255fb66a0dde38b544655cfe9040ffe46e41d19830b47959b2fb168' + '5bb7fa615301014045383b5421901892565ba7f7fd67da93e34a2b032d3721f6f3e677f8fc87072a33d0d79089541e37b5a34a14bfab2a71b587e3abe3e9743f' + '3ff6fc2cdf541b73e53b22213dd1b218544b15f363d6ce15f42a6ac2deb928dd8f536962a8162a648751cadde827d25427105d0bac4e596288ef839943b71f3a' + 'cfa690ea2e500b4a9670cfff96c9ffc675ffd34799b6ee41a7e173fb71d4fb915a8ff8b50f8802bbc59d1e9fe1ac458bdbdd3f0af249fbc44d3cc80b09a9da75' + 'd71a80d180f4f0a5491fc87dcda6237e53cb309d21d497a76a4f914ce376b53885cd767db2603e6a7ee5b0e6c1f926ac85865614f0997122a73e1e8d1c127749' + '56e94bb21c2f233c61f91336b08263bfc28a755e65cd8ddad89186e8f157417f51925927182bca106f03ddae6a5139e78647c48b6961b669444c4337c7b64731' + 'f0fcf0697f4ea10df04418b4fab6f5a34d7a1c183bd1d72eae18a1103ae0eb3b0da68f35c6cb60e78aae692afe3c11bc1bbb0d232e8e015b4d4bc96451e0c9e3' + 'SKIP' + 'b576a9c40ba59485c350f71b9234d9e71f245e25b26382bd2f67019f3309c3b5705a6020eae0a9dfccacc763fb2056a5937c0a8ff4e64f99ba1d60f0b2acb03f' + '85a13a274d4cbaca3ddbe8eaf883f1a1184765f8d09d6d40bb32defbe0876cb0153513e8db8671d7fc053e383ced793b74245ff29364a760e1a52bb36ebc8e85' + 'f9ce0bb4f06be6f742d8a31384e90fdab1a4686f14d5a8845e0c341dcfa62ae59db933237174223de9b32f9d91f99125c20ede7dff664755f1d42ea0cecdefdb' + 'b32623904f984118ebdd8ec31816885d73776ed80a68fa23925e67451f28a8f080dd8545307bb2f857435894adfa8b3db7c8a99aa02b8b3f2b5f8e3223d98a47' + 'd114f1e69504413e81dd67684f5b1ce69aa09d5bc768c7eee96a7d6b7ec47b32cd8f02593c878b0e9091475467de36a3d7c478e34a39148fa849548f53637b84' + 'bc0c6b1726679498393be8d4c417c62e1f356fe5c617c71ff23532652fdd5f314e5bfc6172eaca79cd4806b81031bf2f879d7d1a6050ad4c616c04e6bdf93c2a' + 'b13bea6412580325dba0d02cf0dc712e860f659569ffcb968aa4836fdb2882448cfee4659a675a70affccae02c8d2589d80b7239eef5ae7b615162aeaa76f3bb' + 'cff59f974651614587313674455a968ae5390a5ca825d204f0e2f8de2b422d577b007f5297a398e2afeb33ed0d324d34ad58ff4cd56e645bd4ca9a6bdc1354c5' + '54adbec4b6b85cda901df7d2b3eb1f517f10d3528326e60c7afa4b49ccc7cfb43b0d1f574ceb5d7d03c94a0fbcc97c0ef785258292dd26ed46728355da27332c') + +_replacesarchkernel=("${_replacesarchkernel[@]/\%/${pkgbase#linux-libre}}") +_replacesoldkernels=("${_replacesoldkernels[@]/\%/${pkgbase#linux-libre}}") +_replacesoldmodules=("${_replacesoldmodules[@]/\%/${pkgbase#linux-libre}}") + +export KBUILD_BUILD_HOST=parabola +export KBUILD_BUILD_USER=$pkgbase +export KBUILD_BUILD_TIMESTAMP="$(date -Ru${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH})" + +prepare() { + cd $_srcname + +# if [ "${_srcname##*-}" != "$pkgver" ]; then +# msg2 "Applying upstream patch..." +# patch -Np1 -i ../patch-${_srcname##*-}-gnu-$pkgver-gnu +# fi + + msg2 "Adding freedo as boot logo..." + install -m644 -t drivers/video/logo \ + ../logo_linux_{clut224.ppm,vga16.ppm,mono.pbm} + + msg2 "Setting version..." + scripts/setlocalversion --save-scmversion + echo "-$pkgrel" > localversion.10-pkgrel + echo "${pkgbase#linux-libre}" > localversion.20-pkgname + + local src + for src in "${source[@]}"; do + src="${src%%::*}" + src="${src##*/}" + [[ $src = *.patch ]] || continue + msg2 "Applying patch $src..." + patch -Np1 < "../$src" + done + + msg2 "Setting config..." + cp ../config .config + make olddefconfig + + make -s kernelrelease > version + msg2 "Prepared %s version %s" "$pkgbase" "$( cmdline + + msg2 "Creating kernel sign..." + vbutil_kernel \ + --pack vmlinux.kpart \ + --version 1 \ + --vmlinuz kernel.signed \ + --arch arm \ + --keyblock ../kernel.keyblock \ + --signprivate ../kernel_data_key.vbprivk \ + --config cmdline \ + --bootloader bootloader.bin + + msg2 "Installing kernel sign..." + mkdir -p "$pkgdir/boot" + cp vmlinux.kpart "$pkgdir/boot" + + msg2 "Fixing permissions..." + chmod -Rc u=rwX,go=rX "$pkgdir" +} + +_package-headers() { + pkgdesc="Header files and scripts for building modules for $pkgdesc kernel" + provides=("${_replacesarchkernel[@]/%/-headers=$pkgver}") + conflicts=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}") + replaces=("${_replacesarchkernel[@]/%/-headers}" "${_replacesoldkernels[@]/%/-headers}") + + cd $_srcname + local builddir="$pkgdir/usr/lib/modules/$(; + images { + kernel@1 { + description = "kernel"; + data = /incbin/("arch/arm/boot/zImage"); + type = "kernel_noload"; + arch = "arm"; + os = "linux"; + compression = "none"; + load = <0>; + entry = <0>; + }; + fdt@1 { + description = "exynos5250-snow.dtb"; + data = /incbin/("arch/arm/boot/dts/exynos5250-snow.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@2 { + description = "exynos5250-snow-rev5.dtb"; + data = /incbin/("arch/arm/boot/dts/exynos5250-snow-rev5.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@3 { + description = "exynos5250-spring.dtb"; + data = /incbin/("arch/arm/boot/dts/exynos5250-spring.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@4 { + description = "exynos5800-peach-pi.dtb"; + data = /incbin/("arch/arm/boot/dts/exynos5800-peach-pi.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1{ + algo = "sha1"; + }; + }; + fdt@5 { + description = "exynos5420-peach-pit.dtb"; + data = /incbin/("arch/arm/boot/dts/exynos5420-peach-pit.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@6 { + description = "rk3288-veyron-brain.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-brain.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@7 { + description = "rk3288-veyron-jaq.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-jaq.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@8 { + description = "rk3288-veyron-jerry.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-jerry.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@9 { + description = "rk3288-veyron-mickey.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-mickey.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@10 { + description = "rk3288-veyron-minnie.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-minnie.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@11 { + description = "rk3288-veyron-pinky.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-pinky.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1{ + algo = "sha1"; + }; + }; + fdt@12 { + description = "rk3288-veyron-speedy.dtb"; + data = /incbin/("arch/arm/boot/dts/rk3288-veyron-speedy.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@13 { + description = "tegra124-nyan-big.dtb"; + data = /incbin/("arch/arm/boot/dts/tegra124-nyan-big.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + fdt@14 { + description = "tegra124-nyan-blaze.dtb"; + data = /incbin/("arch/arm/boot/dts/tegra124-nyan-blaze.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "none"; + hash@1 { + algo = "sha1"; + }; + }; + }; + configurations { + default = "conf@1"; + conf@1 { + kernel = "kernel@1"; + fdt = "fdt@1"; + }; + conf@2 { + kernel = "kernel@1"; + fdt = "fdt@2"; + }; + conf@3 { + kernel = "kernel@1"; + fdt = "fdt@3"; + }; + conf@4 { + kernel = "kernel@1"; + fdt = "fdt@4"; + }; + conf@5 { + kernel = "kernel@1"; + fdt = "fdt@5"; + }; + conf@6 { + kernel = "kernel@1"; + fdt = "fdt@6"; + }; + conf@7 { + kernel = "kernel@1"; + fdt = "fdt@7"; + }; + conf@8 { + kernel = "kernel@1"; + fdt = "fdt@8"; + }; + conf@9 { + kernel = "kernel@1"; + fdt = "fdt@9"; + }; + conf@10 { + kernel = "kernel@1"; + fdt = "fdt@10"; + }; + conf@11 { + kernel = "kernel@1"; + fdt = "fdt@11"; + }; + conf@12 { + kernel = "kernel@1"; + fdt = "fdt@12"; + }; + conf@13 { + kernel = "kernel@1"; + fdt = "fdt@13"; + }; + conf@14 { + kernel = "kernel@1"; + fdt = "fdt@14"; + }; + }; +}; diff --git a/libre-testing/linux-libre-cros/kernel.keyblock b/libre-testing/linux-libre-cros/kernel.keyblock new file mode 100644 index 000000000..9740be4e6 Binary files /dev/null and b/libre-testing/linux-libre-cros/kernel.keyblock differ diff --git a/libre-testing/linux-libre-cros/kernel_data_key.vbprivk b/libre-testing/linux-libre-cros/kernel_data_key.vbprivk new file mode 100644 index 000000000..8d392fb29 Binary files /dev/null and b/libre-testing/linux-libre-cros/kernel_data_key.vbprivk differ diff --git a/libre-testing/linux-libre-cros/linux-libre-cros.install b/libre-testing/linux-libre-cros/linux-libre-cros.install new file mode 100644 index 000000000..962dcc3b3 --- /dev/null +++ b/libre-testing/linux-libre-cros/linux-libre-cros.install @@ -0,0 +1,29 @@ +flash_kernel() { + if mountpoint -q /boot; then + major=$(mountpoint -d /boot | cut -f 1 -d ':') + minor=$(mountpoint -d /boot | cut -f 2 -d ':') + else + major=$(mountpoint -d / | cut -f 1 -d ':') + minor=$(mountpoint -d / | cut -f 2 -d ':') + fi + device=$(awk {'if ($1 == "'$major'" && $2 == "'$minor'") print $4 '} /proc/partitions) + device="/dev/${device/%2/1}" + + echo "A new kernel version needs to be flashed onto $device." + read -rp "Do you want to do this now? [y|N] " shouldwe + if [[ $shouldwe =~ ^([yY][eE][sS]|[yY])$ ]]; then + dd if=/boot/vmlinux.kpart of=$device + sync + else + echo "You can do this later by running:" + echo "# dd if=/boot/vmlinux.kpart of=$device" + fi +} + +post_install () { + flash_kernel +} + +post_upgrade() { + flash_kernel +} diff --git a/libre-testing/linux-libre-cros/linux.preset b/libre-testing/linux-libre-cros/linux.preset new file mode 100644 index 000000000..ca3832faa --- /dev/null +++ b/libre-testing/linux-libre-cros/linux.preset @@ -0,0 +1,10 @@ +# mkinitcpio preset file for the '%PKGBASE%' package + +ALL_config="/etc/mkinitcpio.conf" +ALL_kver="%KERNVER%" + +PRESETS=('default') + +#default_config="/etc/mkinitcpio.conf" +default_image="/boot/initramfs-%PKGBASE%.img" +#default_options="" -- cgit v1.2.3