Re: [LEDE-DEV] [PATCH] ipq806x: Add nand boot support for ipq40xx AP-DK04.1-C1
On Sat, May 13, 2017 at 10:36 AM, Christian Lamparter <chunk...@googlemail.com> wrote: > Hello Ram, > > On Thursday, May 11, 2017 8:39:46 PM CEST Christian Lamparter wrote: >> On Thursday, May 11, 2017 10:15:58 PM CEST Ram Chandra Jangir wrote: >> > I added nand pinmux in https://patchwork.ozlabs.org/patch/761243/ , >> > Could you please try with this, if it helps you. >> Thanks, I'll forward it to Chris Blake. He can test it once >> he returns. I'll let you know how it turned out. > > Chris reported: > [1.40] nand: device found, Manufacturer ID: 0x01, Chip ID: 0xf1 > [1.007580] nand: AMD/Spansion S34ML01G2 > [1.014146] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB > size: 64 > [1.018135] 11 ofpart partitions found on MTD device qcom_nand.0 > [1.025449] Creating 11 MTD partitions on "qcom_nand.0": > > so, it's working now. > > Regards, > Christian > > Hello Ram, First off, thank you very much for this patch and your work on the ipq40xx platform. I have been doing more testing, and it seems that some of the pins in pinctl are not defined to the correct function. This is what I am currently seeing on the board: [1.278649] ipq4019-pinctrl 100.pinctrl: invalid group "gpio57" for function "qpic_pad" [1.279841] ipq4019-pinctrl 100.pinctrl: invalid group "gpio58" for function "qpic_pad" [1.288214] ipq4019-pinctrl 100.pinctrl: invalid group "gpio59" for function "qpic_pad" [1.296508] ipq4019-pinctrl 100.pinctrl: invalid group "gpio60" for function "qpic_pad" [1.304905] ipq4019-pinctrl 100.pinctrl: invalid group "gpio64" for function "qpic_pad" [1.313190] ipq4019-pinctrl 100.pinctrl: invalid group "gpio65" for function "qpic_pad" [1.321522] ipq4019-pinctrl 100.pinctrl: invalid group "gpio66" for function "qpic_pad" [1.329856] ipq4019-pinctrl 100.pinctrl: invalid group "gpio67" for function "qpic_pad" [1.338190] ipq4019-pinctrl 100.pinctrl: invalid group "gpio68" for function "qpic_pad" With that said, NAND still inits and works. I was also able to clear up the errors by fixing the groups for each GPIO in my DTS with the help of Christian. Example of this is at https://pastebin.com/rQDY3z9c. Is this something specific with my board, or some other variation with your patch? I am new to this arch so please excuse me if any of this is noobish. :) Regards, Chris Blake ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 1/2] x86: Move Traverse Geos configs into x86 base-files
This change moves the files in 657418d to the root of the x86 target. This is done in preperation for adding more devices under other subtargets. CC: David Woodhouse <dw...@infradead.org> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/x86/{geode => }/base-files/etc/board.d/01_leds| 0 target/linux/x86/{geode => }/base-files/etc/board.d/02_network | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename target/linux/x86/{geode => }/base-files/etc/board.d/01_leds (100%) rename target/linux/x86/{geode => }/base-files/etc/board.d/02_network (100%) diff --git a/target/linux/x86/geode/base-files/etc/board.d/01_leds b/target/linux/x86/base-files/etc/board.d/01_leds similarity index 100% rename from target/linux/x86/geode/base-files/etc/board.d/01_leds rename to target/linux/x86/base-files/etc/board.d/01_leds diff --git a/target/linux/x86/geode/base-files/etc/board.d/02_network b/target/linux/x86/base-files/etc/board.d/02_network similarity index 100% rename from target/linux/x86/geode/base-files/etc/board.d/02_network rename to target/linux/x86/base-files/etc/board.d/02_network -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH v3] leds-apu2: Add PC Engines APU2 LED driver
This adds support for the PCB LEDs and Reset Button found on the PC Engines APU2/APU3 embedded boards. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- package/kernel/leds-apu2/Makefile| 52 + package/kernel/leds-apu2/src/Kconfig | 8 + package/kernel/leds-apu2/src/Makefile| 1 + package/kernel/leds-apu2/src/leds-apu2.c | 374 +++ 4 files changed, 435 insertions(+) create mode 100644 package/kernel/leds-apu2/Makefile create mode 100644 package/kernel/leds-apu2/src/Kconfig create mode 100644 package/kernel/leds-apu2/src/Makefile create mode 100644 package/kernel/leds-apu2/src/leds-apu2.c diff --git a/package/kernel/leds-apu2/Makefile b/package/kernel/leds-apu2/Makefile new file mode 100644 index 000..bab2315 --- /dev/null +++ b/package/kernel/leds-apu2/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2017 Chris Blake <chrisrblak...@gmail.com> +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=leds-apu2 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Chris Blake <chrisrblak...@gmail.com> +PKG_LICENSE:=GPL-2.0 + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/leds-apu2 + SUBMENU:=LED modules + TITLE:= PC Engines APU2/APU3 LED support + DEPENDS:= @GPIO_SUPPORT @TARGET_x86 + FILES:=$(PKG_BUILD_DIR)/leds-apu2.ko + AUTOLOAD:=$(call AutoLoad,41,leds-apu2,1) + KCONFIG:= +endef + +define KernelPackage/leds-apu2/description + Driver for the PC Engines APU2/APU3 LEDs & Reset Button. +endef + +EXTRA_KCONFIG:= \ + CONFIG_LEDS_APU2=m + +EXTRA_CFLAGS:= \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG \ + +MAKE_OPTS:= \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + SUBDIRS="$(PKG_BUILD_DIR)" \ + EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + $(EXTRA_KCONFIG) + +define Build/Compile +$(MAKE) -C "$(LINUX_DIR)" \ + $(MAKE_OPTS) \ + modules +endef + +$(eval $(call KernelPackage,leds-apu2)) diff --git a/package/kernel/leds-apu2/src/Kconfig b/package/kernel/leds-apu2/src/Kconfig new file mode 100644 index 000..d0ad5be --- /dev/null +++ b/package/kernel/leds-apu2/src/Kconfig @@ -0,0 +1,8 @@ +config LEDS_APU2 +tristate "PC Engines APU2/APU3 LED support" +depends on LEDS_CLASS +depends on LEDS_GPIO +depends on GPIOLIB +help + Say yes here to enable support for the CPU GPIO pins on the PC Engines + APU2/APU3 board, which enables the front LEDs and Reset Button. diff --git a/package/kernel/leds-apu2/src/Makefile b/package/kernel/leds-apu2/src/Makefile new file mode 100644 index 000..4f77b39 --- /dev/null +++ b/package/kernel/leds-apu2/src/Makefile @@ -0,0 +1 @@ +obj-${CONFIG_LEDS_APU2}+= leds-apu2.o diff --git a/package/kernel/leds-apu2/src/leds-apu2.c b/package/kernel/leds-apu2/src/leds-apu2.c new file mode 100644 index 000..00f80a3 --- /dev/null +++ b/package/kernel/leds-apu2/src/leds-apu2.c @@ -0,0 +1,374 @@ +/* +* APU2 LED/GPIO Driver +* Copyright (c) 2016 Christian Lamparter +* +* Based on gpio-apu2.c - AMD FCH GPIO support for PC-Engines APU-2 board +* +* Copyright (c) 2015 Carsten Spiess +* +* This program 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 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, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define DEVNAME "leds-apu2" + +#define FCH_ACPI_MMIO_BASE 0xFED8 +#define FCH_GPIO_BASE (FCH_ACPI_MMIO_BASE + 0x1500) +#define FCH_GPIO_SIZE 0x300 + +#define APU_NUM_GPIO4 + +#define GPIO_BIT_DIR23 +#define GPIO_BIT_WRITE 22 +#define GPIO_BIT_READ 16 + +/* internal variables */ +static struct pci_dev *gpio_apu2_pci; +static DEFINE_SPINLOCK (gpio_lock); + +/* the watchdog platform device */ +static struct platform_device *gpio_apu2_platform_device; +static st
[LEDE-DEV] [PATCH v2] leds-apu2: Add PC Engines APU2 LED driver
This adds support for the PCB LEDs and Reset Button found on the PC Engines APU2/APU3 embedded boards. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- package/kernel/leds-apu2/Makefile| 52 + package/kernel/leds-apu2/src/Kconfig | 8 + package/kernel/leds-apu2/src/Makefile| 1 + package/kernel/leds-apu2/src/leds-apu2.c | 374 +++ 4 files changed, 435 insertions(+) create mode 100644 package/kernel/leds-apu2/Makefile create mode 100644 package/kernel/leds-apu2/src/Kconfig create mode 100644 package/kernel/leds-apu2/src/Makefile create mode 100644 package/kernel/leds-apu2/src/leds-apu2.c diff --git a/package/kernel/leds-apu2/Makefile b/package/kernel/leds-apu2/Makefile new file mode 100644 index 000..bab2315 --- /dev/null +++ b/package/kernel/leds-apu2/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2017 Chris Blake <chrisrblak...@gmail.com> +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=leds-apu2 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Chris Blake <chrisrblak...@gmail.com> +PKG_LICENSE:=GPL-2.0 + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/leds-apu2 + SUBMENU:=LED modules + TITLE:= PC Engines APU2/APU3 LED support + DEPENDS:= @GPIO_SUPPORT @TARGET_x86 + FILES:=$(PKG_BUILD_DIR)/leds-apu2.ko + AUTOLOAD:=$(call AutoLoad,41,leds-apu2,1) + KCONFIG:= +endef + +define KernelPackage/leds-apu2/description + Driver for the PC Engines APU2/APU3 LEDs & Reset Button. +endef + +EXTRA_KCONFIG:= \ + CONFIG_LEDS_APU2=m + +EXTRA_CFLAGS:= \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG \ + +MAKE_OPTS:= \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + SUBDIRS="$(PKG_BUILD_DIR)" \ + EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + $(EXTRA_KCONFIG) + +define Build/Compile +$(MAKE) -C "$(LINUX_DIR)" \ + $(MAKE_OPTS) \ + modules +endef + +$(eval $(call KernelPackage,leds-apu2)) diff --git a/package/kernel/leds-apu2/src/Kconfig b/package/kernel/leds-apu2/src/Kconfig new file mode 100644 index 000..d0ad5be --- /dev/null +++ b/package/kernel/leds-apu2/src/Kconfig @@ -0,0 +1,8 @@ +config LEDS_APU2 +tristate "PC Engines APU2/APU3 LED support" +depends on LEDS_CLASS +depends on LEDS_GPIO +depends on GPIOLIB +help + Say yes here to enable support for the CPU GPIO pins on the PC Engines + APU2/APU3 board, which enables the front LEDs and Reset Button. diff --git a/package/kernel/leds-apu2/src/Makefile b/package/kernel/leds-apu2/src/Makefile new file mode 100644 index 000..4f77b39 --- /dev/null +++ b/package/kernel/leds-apu2/src/Makefile @@ -0,0 +1 @@ +obj-${CONFIG_LEDS_APU2}+= leds-apu2.o diff --git a/package/kernel/leds-apu2/src/leds-apu2.c b/package/kernel/leds-apu2/src/leds-apu2.c new file mode 100644 index 000..8da8a2d --- /dev/null +++ b/package/kernel/leds-apu2/src/leds-apu2.c @@ -0,0 +1,374 @@ +/* + * APU2 LED/GPIO Driver + * Copyright (c) 2016 Christian Lamparter + * + * Based on gpio-apu2.c - AMD FCH GPIO support for PC-Engines APU-2 board + * + * Copyright (c) 2015 Carsten Spiess + * + * This program 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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include + #include + #include + + #define DEVNAME "leds-apu2" + + #define FCH_ACPI_MMIO_BASE 0xFED8 + #define FCH_GPIO_BASE (FCH_ACPI_MMIO_BASE + 0x1500) + #define FCH_GPIO_SIZE 0x300 + + #define APU_NUM_GPIO4 + + #define GPIO_BIT_DIR23 + #define GPIO_BIT_WRITE 22 + #define GPIO_BIT_READ 16 + + /* internal variables */ + static struct pci_dev *gpio_apu2_pci; + static DEFINE_SPINLOCK (gpio_lock); + + /* the watchdog platform device */ + static struct platform
[LEDE-DEV] [PATCH 3/3] leds-apu2: Add PC Engines APU2 LED driver
This adds support for the PCB LEDs and Reset Button found on the PC Engines APU2/APU3 embedded boards. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- package/kernel/leds-apu2/Makefile| 52 + package/kernel/leds-apu2/src/Kconfig | 8 + package/kernel/leds-apu2/src/Makefile| 1 + package/kernel/leds-apu2/src/leds-apu2.c | 374 +++ 4 files changed, 435 insertions(+) create mode 100644 package/kernel/leds-apu2/Makefile create mode 100644 package/kernel/leds-apu2/src/Kconfig create mode 100644 package/kernel/leds-apu2/src/Makefile create mode 100644 package/kernel/leds-apu2/src/leds-apu2.c diff --git a/package/kernel/leds-apu2/Makefile b/package/kernel/leds-apu2/Makefile new file mode 100644 index 000..bab2315 --- /dev/null +++ b/package/kernel/leds-apu2/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2017 Chris Blake <chrisrblak...@gmail.com> +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=leds-apu2 +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Chris Blake <chrisrblak...@gmail.com> +PKG_LICENSE:=GPL-2.0 + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/leds-apu2 + SUBMENU:=LED modules + TITLE:= PC Engines APU2/APU3 LED support + DEPENDS:= @GPIO_SUPPORT @TARGET_x86 + FILES:=$(PKG_BUILD_DIR)/leds-apu2.ko + AUTOLOAD:=$(call AutoLoad,41,leds-apu2,1) + KCONFIG:= +endef + +define KernelPackage/leds-apu2/description + Driver for the PC Engines APU2/APU3 LEDs & Reset Button. +endef + +EXTRA_KCONFIG:= \ + CONFIG_LEDS_APU2=m + +EXTRA_CFLAGS:= \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG \ + +MAKE_OPTS:= \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + SUBDIRS="$(PKG_BUILD_DIR)" \ + EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + $(EXTRA_KCONFIG) + +define Build/Compile +$(MAKE) -C "$(LINUX_DIR)" \ + $(MAKE_OPTS) \ + modules +endef + +$(eval $(call KernelPackage,leds-apu2)) diff --git a/package/kernel/leds-apu2/src/Kconfig b/package/kernel/leds-apu2/src/Kconfig new file mode 100644 index 000..d0ad5be --- /dev/null +++ b/package/kernel/leds-apu2/src/Kconfig @@ -0,0 +1,8 @@ +config LEDS_APU2 +tristate "PC Engines APU2/APU3 LED support" +depends on LEDS_CLASS +depends on LEDS_GPIO +depends on GPIOLIB +help + Say yes here to enable support for the CPU GPIO pins on the PC Engines + APU2/APU3 board, which enables the front LEDs and Reset Button. diff --git a/package/kernel/leds-apu2/src/Makefile b/package/kernel/leds-apu2/src/Makefile new file mode 100644 index 000..4f77b39 --- /dev/null +++ b/package/kernel/leds-apu2/src/Makefile @@ -0,0 +1 @@ +obj-${CONFIG_LEDS_APU2}+= leds-apu2.o diff --git a/package/kernel/leds-apu2/src/leds-apu2.c b/package/kernel/leds-apu2/src/leds-apu2.c new file mode 100644 index 000..8da8a2d --- /dev/null +++ b/package/kernel/leds-apu2/src/leds-apu2.c @@ -0,0 +1,374 @@ +/* + * APU2 LED/GPIO Driver + * Copyright (c) 2016 Christian Lamparter + * + * Based on gpio-apu2.c - AMD FCH GPIO support for PC-Engines APU-2 board + * + * Copyright (c) 2015 Carsten Spiess + * + * This program 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 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, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include + #include + #include + + #define DEVNAME "leds-apu2" + + #define FCH_ACPI_MMIO_BASE 0xFED8 + #define FCH_GPIO_BASE (FCH_ACPI_MMIO_BASE + 0x1500) + #define FCH_GPIO_SIZE 0x300 + + #define APU_NUM_GPIO4 + + #define GPIO_BIT_DIR23 + #define GPIO_BIT_WRITE 22 + #define GPIO_BIT_READ 16 + + /* internal variables */ + static struct pci_dev *gpio_apu2_pci; + static DEFINE_SPINLOCK (gpio_lock); + + /* the watchdog platform device */ + static struct platform
[LEDE-DEV] [PATCH 2/3] gpio-nct5104d: Add nct5104d driver package
This adds support for the SuperIO chip nct5104d found on the PC Engines APU boards, which allows for a handful of additional ports, such as 2x additional UART pinouts, enabling an external watchdog (no driver for this functionality yet), and 16 GPIO pins. More info can be found at https://pcengines.ch/ht_gpio.htm Thanks to @feckert for helping package this. Cc: Florian Eckert <eckert.flor...@googlemail.com> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- package/kernel/gpio-nct5104d/Makefile| 52 +++ package/kernel/gpio-nct5104d/src/Kconfig | 5 + package/kernel/gpio-nct5104d/src/Makefile| 1 + package/kernel/gpio-nct5104d/src/gpio-nct5104d.c | 461 +++ 4 files changed, 519 insertions(+) create mode 100644 package/kernel/gpio-nct5104d/Makefile create mode 100644 package/kernel/gpio-nct5104d/src/Kconfig create mode 100644 package/kernel/gpio-nct5104d/src/Makefile create mode 100644 package/kernel/gpio-nct5104d/src/gpio-nct5104d.c diff --git a/package/kernel/gpio-nct5104d/Makefile b/package/kernel/gpio-nct5104d/Makefile new file mode 100644 index 000..b43291e --- /dev/null +++ b/package/kernel/gpio-nct5104d/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=gpio-nct5104d +PKG_RELEASE:=1 + +PKG_MAINTAINER:=Florian Eckert <eckert.flor...@googlemail.com> +PKG_LICENSE:=GPL-2.0 + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/gpio-nct5104d + SUBMENU:=Other modules + TITLE:= GPIO nct5104d support + DEPENDS:= @GPIO_SUPPORT @TARGET_x86 + FILES:=$(PKG_BUILD_DIR)/gpio-nct5104d.ko + AUTOLOAD:=$(call AutoLoad,30,gpio-nct5104d,1) + KCONFIG:= +endef + +define KernelPackage/gpio-nct5104d/description + Support for GPIO functionality of NCT5104D super I/O chip. +endef + +EXTRA_KCONFIG:= \ + CONFIG_GPIO_NCT5104D=m + +EXTRA_CFLAGS:= \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG \ + +MAKE_OPTS:= \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + SUBDIRS="$(PKG_BUILD_DIR)" \ + EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + $(EXTRA_KCONFIG) + +define Build/Compile +$(MAKE) -C "$(LINUX_DIR)" \ + $(MAKE_OPTS) \ + modules +endef + +$(eval $(call KernelPackage,gpio-nct5104d)) diff --git a/package/kernel/gpio-nct5104d/src/Kconfig b/package/kernel/gpio-nct5104d/src/Kconfig new file mode 100644 index 000..cf658e2 --- /dev/null +++ b/package/kernel/gpio-nct5104d/src/Kconfig @@ -0,0 +1,5 @@ +config GPIO_NCT5104D +tristate "NCT5104D GPIO support" +depends on GENERIC_GPIO +help + Say yes here to support GPIO functionality of NCT5104D super I/O chip diff --git a/package/kernel/gpio-nct5104d/src/Makefile b/package/kernel/gpio-nct5104d/src/Makefile new file mode 100644 index 000..6f0375a --- /dev/null +++ b/package/kernel/gpio-nct5104d/src/Makefile @@ -0,0 +1 @@ +obj-${CONFIG_GPIO_NCT5104D}+= gpio-nct5104d.o diff --git a/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c b/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c new file mode 100644 index 000..a37a1d0 --- /dev/null +++ b/package/kernel/gpio-nct5104d/src/gpio-nct5104d.c @@ -0,0 +1,461 @@ +/* + * GPIO driver for NCT5104D + * + * Author: Tasanakorn Phaipool <tasanak...@gmail.com> + * + * This program 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define DRVNAME "gpio-nct5104d" + +/* + * Super-I/O registers + */ +#define SIO_LDSEL 0x07/* Logical device select */ +#define SIO_CHIPID 0x20/* Chaip ID (2 bytes) */ +#define SIO_GPIO_ENABLE0x30/* GPIO enable */ +#define SIO_GPIO1_MODE 0xE0/* GPIO1 Mode OpenDrain/Push-Pull */ +#define SIO_GPIO2_MODE 0xE1/* GPIO2 Mode OpenDrain/Push-Pull */ + +#define SIO_LD_GPIO0x07/* GPIO logical device */ +#define SIO_LD_GPIO_MODE 0x0F/* GPIO mode control device */ +#define SIO_UNLOCK_KEY 0x87/* Key to enable Super-I/O */ +#define SIO_LOCK_KEY 0xAA/* Key to disable Super-I/O */ + +#define SIO_NCT5104D_ID0x1061 /* Chip ID */ +#define SIO_PCENGINES_APU_NCT5104D_ID 0xc452 /* Chip ID */ + +enum chips { nct5104d }; + +static const char * const nct5104d_names[]
[LEDE-DEV] [PATCH 1/3] x86/64: Enable GPIO sysfs & GPIO LED support
The following changes enables GPIO sysfs as well as the LEDS_GPIO option within the kernel. This is required to enable LEDs over a GPIO interface. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/x86/64/config-default | 9 + 1 file changed, 9 insertions(+) diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default index 791c1f2..848f041 100644 --- a/target/linux/x86/64/config-default +++ b/target/linux/x86/64/config-default @@ -109,6 +109,14 @@ CONFIG_GART_IOMMU=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_CPU=y CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_GPIOLIB=y +# CONFIG_GPIO_104_IDIO_16 is not set +# CONFIG_GPIO_AMDPT is not set +# CONFIG_GPIO_F7188X is not set +# CONFIG_GPIO_INTEL_MID is not set +# CONFIG_GPIO_IT87 is not set +# CONFIG_GPIO_LYNXPOINT is not set +CONFIG_GPIO_SYSFS=y CONFIG_HAVE_ACPI_APEI=y CONFIG_HAVE_ACPI_APEI_NMI=y # CONFIG_HAVE_AOUT is not set @@ -161,6 +169,7 @@ CONFIG_ITCO_WDT=y # CONFIG_KVM_DEBUG_FS is not set CONFIG_KVM_GUEST=y # CONFIG_LCD_CLASS_DEVICE is not set +CONFIG_LEDS_GPIO=y # CONFIG_LEGACY_VSYSCALL_EMULATE is not set # CONFIG_LEGACY_VSYSCALL_NATIVE is not set CONFIG_LEGACY_VSYSCALL_NONE=y -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 0/3] Add GPIO/LED Support for the PC Engines APU2/APU3
The following series of patches are to help add support for the PC Engines APU2/APU3 board within LEDE. Specifically, these patches enable support for the Super IO GPIO controller (nct5104d), as well as the front LEDs and reset button. Chris Blake (3): x86/64: Enable GPIO sysfs & GPIO LED support gpio-nct5104d: Add nct5104d driver package leds-apu2: Add PC Engines APU2 LED driver package/kernel/gpio-nct5104d/Makefile| 52 +++ package/kernel/gpio-nct5104d/src/Kconfig | 5 + package/kernel/gpio-nct5104d/src/Makefile| 1 + package/kernel/gpio-nct5104d/src/gpio-nct5104d.c | 461 +++ package/kernel/leds-apu2/Makefile| 52 +++ package/kernel/leds-apu2/src/Kconfig | 8 + package/kernel/leds-apu2/src/Makefile| 1 + package/kernel/leds-apu2/src/leds-apu2.c | 374 ++ target/linux/x86/64/config-default | 9 + 9 files changed, 963 insertions(+) create mode 100644 package/kernel/gpio-nct5104d/Makefile create mode 100644 package/kernel/gpio-nct5104d/src/Kconfig create mode 100644 package/kernel/gpio-nct5104d/src/Makefile create mode 100644 package/kernel/gpio-nct5104d/src/gpio-nct5104d.c create mode 100644 package/kernel/leds-apu2/Makefile create mode 100644 package/kernel/leds-apu2/src/Kconfig create mode 100644 package/kernel/leds-apu2/src/Makefile create mode 100644 package/kernel/leds-apu2/src/leds-apu2.c -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH 4/4] x86: Add APU2 LED Driver
On Sat, Jan 14, 2017 at 11:13 AM, Felix Fietkau <n...@nbd.name> wrote: > On 2017-01-14 18:04, Chris Blake wrote: >> On Sat, Jan 14, 2017 at 10:41 AM, Chris Blake <chrisrblak...@gmail.com> >> wrote: >>> On Sat, Jan 14, 2017 at 10:31 AM, Felix Fietkau <n...@nbd.name> wrote: >>>> On 2017-01-14 17:20, Chris Blake wrote: >>>>> The following patch adds LED support for the PC Engines APU2/APU3 board >>>>> on LEDE. >>>>> >>>>> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> >>>> Has this driver been submitted for upstream inclusion yet? >>>> >>>> - Felix >>>> >>> >>> Felix, >>> >>> This driver has not been submitted upstream to the Linux mailing list >>> at this time. >>> >>> - Chris B >> >> Felix, >> >> In regards to upstream it seems this driver in particular, APU2 LED, >> was submitted upstream at https://patches.linaro.org/patch/80049/ >> previously. While this version of the driver varies slightly (better >> platform detection), would you still prefer this to be re-submitted in >> package form? Due to the platform specific code I doubt it would have >> much luck in the upstream lists. > Yes, since there doesn't seem to be any progress towards getting this > merged, please re-submit it in package form. > > Thanks, > > - Felix > Felix, I have been working on moving the LED driver to a package, but have some concerns about implementation. Specifically, this would hit the same issue I had with the Meraki MR18 LED Driver (NU801) around having the LEDs/Reset button available during boot. Specifically, this is a concern as the reset button will be unusable for failsafe mode and the LEDs will fail to show boot status once system integration [0] is cleaned up and sent as a later PR. I was curious if you had any feedback, or ideas to get around this. As for the other GPIO driver, that should have no issues being packaged. Regards, Chris B [0]: http://lists.infradead.org/pipermail/lede-dev/2016-October/003535.html ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH 4/4] x86: Add APU2 LED Driver
On Sat, Jan 14, 2017 at 10:41 AM, Chris Blake <chrisrblak...@gmail.com> wrote: > On Sat, Jan 14, 2017 at 10:31 AM, Felix Fietkau <n...@nbd.name> wrote: >> On 2017-01-14 17:20, Chris Blake wrote: >>> The following patch adds LED support for the PC Engines APU2/APU3 board >>> on LEDE. >>> >>> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> >> Has this driver been submitted for upstream inclusion yet? >> >> - Felix >> > > Felix, > > This driver has not been submitted upstream to the Linux mailing list > at this time. > > - Chris B Felix, In regards to upstream it seems this driver in particular, APU2 LED, was submitted upstream at https://patches.linaro.org/patch/80049/ previously. While this version of the driver varies slightly (better platform detection), would you still prefer this to be re-submitted in package form? Due to the platform specific code I doubt it would have much luck in the upstream lists. - Chris B ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH 4/4] x86: Add APU2 LED Driver
On Sat, Jan 14, 2017 at 10:31 AM, Felix Fietkau <n...@nbd.name> wrote: > On 2017-01-14 17:20, Chris Blake wrote: >> The following patch adds LED support for the PC Engines APU2/APU3 board >> on LEDE. >> >> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> > Has this driver been submitted for upstream inclusion yet? > > - Felix > Felix, This driver has not been submitted upstream to the Linux mailing list at this time. - Chris B ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 1/4] x86: Add sp5100_tco AMD patches
This adds the following patches to the x86 target: sp5100_tco: Add AMD Mullins platform support sp5100_tco: Add AMD Carrizo platform support sp5100_tco: fix the device check for SB800 and later chipsets watchdog: sp5100_tco: properly check for new register layouts With these added, the sp5100_tco driver can then be used on newer AMD platforms, such as the PCEngines APU2/APU3 boards. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- ...5100_tco-Add-AMD-Mullins-platform-support.patch | 30 ...5100_tco-Add-AMD-Carrizo-platform-support.patch | 31 + ...device-check-for-SB800-and-later-chipsets.patch | 80 ++ ...5100_tco-properly-check-for-new-register-.patch | 76 4 files changed, 217 insertions(+) create mode 100644 target/linux/x86/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch create mode 100644 target/linux/x86/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch create mode 100644 target/linux/x86/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch create mode 100644 target/linux/x86/patches-4.4/097-0004-watchdog-sp5100_tco-properly-check-for-new-register-.patch diff --git a/target/linux/x86/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch b/target/linux/x86/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch new file mode 100644 index 000..ee88859 --- /dev/null +++ b/target/linux/x86/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch @@ -0,0 +1,30 @@ +From 190aa4304de6fe2185d96392ddf56580fa133e99 Mon Sep 17 00:00:00 2001 +From: Denis Turischev <denis.turisc...@compulab.co.il> +Date: Tue, 24 Nov 2015 10:46:12 +0200 +Subject: [PATCH] sp5100_tco: Add AMD Mullins platform support + +AMD Mullins watchdog is fully compatible to the previous Hudson chipset, +reuse the existent sp5100_tco driver. + +Signed-off-by: Denis Turischev <denis.turisc...@compulab.co.il> +Signed-off-by: Guenter Roeck <li...@roeck-us.net> +Signed-off-by: Wim Van Sebroeck <w...@iguana.be> +--- + drivers/watchdog/sp5100_tco.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c +index eb8044e..ef039f8 100644 +--- a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c +@@ -306,6 +306,8 @@ static struct miscdevice sp5100_tco_miscdev = { + static const struct pci_device_id sp5100_tco_pci_tbl[] = { + { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, PCI_ANY_ID, + PCI_ANY_ID, }, ++ { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, PCI_ANY_ID, ++PCI_ANY_ID, }, + { 0, }, /* End of list */ + }; + MODULE_DEVICE_TABLE(pci, sp5100_tco_pci_tbl); +-- +2.7.4 diff --git a/target/linux/x86/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch b/target/linux/x86/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch new file mode 100644 index 000..664d4bb --- /dev/null +++ b/target/linux/x86/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch @@ -0,0 +1,31 @@ +From cca118fa2a0a94e0f0b3c8dd1dda922cdee45089 Mon Sep 17 00:00:00 2001 +From: Huang Rui <ray.hu...@amd.com> +Date: Mon, 23 Nov 2015 18:07:36 +0800 +Subject: [PATCH] sp5100_tco: Add AMD Carrizo platform support + +sp5100_tco watchdog is also supported on AMD KernCZ chipset of Carrizo +platform. + +Signed-off-by: Huang Rui <ray.hu...@amd.com> +Cc: Denis Turischev <denis.turisc...@compulab.co.il> +Signed-off-by: Guenter Roeck <li...@roeck-us.net> +Signed-off-by: Wim Van Sebroeck <w...@iguana.be> +--- + drivers/watchdog/sp5100_tco.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c +index ef039f8..0ccadb4 100644 +--- a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c +@@ -308,6 +308,8 @@ static const struct pci_device_id sp5100_tco_pci_tbl[] = { + PCI_ANY_ID, }, + { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, PCI_ANY_ID, + PCI_ANY_ID, }, ++ { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_KERNCZ_SMBUS, PCI_ANY_ID, ++PCI_ANY_ID, }, + { 0, }, /* End of list */ + }; + MODULE_DEVICE_TABLE(pci, sp5100_tco_pci_tbl); +-- +2.7.4 diff --git a/target/linux/x86/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch b/target/linux/x86/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch new file mode 100644 index 000..e9f4513 --- /dev/null +++ b/target/linux/x86/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch @@ -0,0 +1,80 @@ +From bdecfcdb5461834aab24002bb18d3cbdd907b7fb Mon Sep 17 00:00:00 2001 +From: Huang Rui <ray.hu...@amd.com> +Date: Mon, 23 Nov 2015 18:07:35 +0800 +Subject: [PA
[LEDE-DEV] [PATCH 2/4] x86: add kernel module for sp5100_tco watchdog
This change adds the sp5100_tco driver as a kernel module for the x86 target. Specifically, this can be used by the PCEngines APU2/APU3. The reason for having this as a kernel module is to allow users to load/unload it on demand, as the I2C interface on the APU2/APU3 will not work while this module is loaded. More info can be found on GitHub at https://github.com/riptidewave93/LEDE-APU2/pull/5#issuecomment-255667736 Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/x86/modules.mk | 15 +++ 1 file changed, 15 insertions(+) diff --git a/target/linux/x86/modules.mk b/target/linux/x86/modules.mk index 656500b..87733c2 100644 --- a/target/linux/x86/modules.mk +++ b/target/linux/x86/modules.mk @@ -19,3 +19,18 @@ define KernelPackage/sound-cs5535audio/description endef $(eval $(call KernelPackage,sound-cs5535audio)) + +define KernelPackage/sp5100_tco + SUBMENU:=$(OTHER_MENU) + TITLE:=SP5100 Watchdog Support + DEPENDS:=@TARGET_x86 + KCONFIG:=CONFIG_SP5100_TCO + FILES:=$(LINUX_DIR)/drivers/watchdog/sp5100_tco.ko + AUTOLOAD:=$(call AutoLoad,50,sp5100_tco,1) +endef + +define KernelPackage/sp5100_tco/description + Kernel module for the SP5100_TCO hardware watchdog. +endef + +$(eval $(call KernelPackage,sp5100_tco)) -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 3/4] x86: Add NCT5104D GPIO driver
The following patch is to add driver support for the NCT5104D GPIO Super I/O chip which is found on the PC Engines APU2/APU3 boards. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/x86/64/config-default | 9 + .../linux/x86/files/drivers/gpio/gpio-nct5104d.c | 461 + .../patches-4.4/801-add-nct5104d-gpio-driver.patch | 28 ++ 3 files changed, 498 insertions(+) create mode 100644 target/linux/x86/files/drivers/gpio/gpio-nct5104d.c create mode 100644 target/linux/x86/patches-4.4/801-add-nct5104d-gpio-driver.patch diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default index 791c1f2..d2e2774 100644 --- a/target/linux/x86/64/config-default +++ b/target/linux/x86/64/config-default @@ -109,6 +109,15 @@ CONFIG_GART_IOMMU=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_CPU=y CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_GPIOLIB=y +# CONFIG_GPIO_104_IDIO_16 is not set +# CONFIG_GPIO_AMDPT is not set +# CONFIG_GPIO_F7188X is not set +# CONFIG_GPIO_INTEL_MID is not set +# CONFIG_GPIO_IT87 is not set +# CONFIG_GPIO_LYNXPOINT is not set +CONFIG_GPIO_NCT5104D=y +CONFIG_GPIO_SYSFS=y CONFIG_HAVE_ACPI_APEI=y CONFIG_HAVE_ACPI_APEI_NMI=y # CONFIG_HAVE_AOUT is not set diff --git a/target/linux/x86/files/drivers/gpio/gpio-nct5104d.c b/target/linux/x86/files/drivers/gpio/gpio-nct5104d.c new file mode 100644 index 000..a37a1d0 --- /dev/null +++ b/target/linux/x86/files/drivers/gpio/gpio-nct5104d.c @@ -0,0 +1,461 @@ +/* + * GPIO driver for NCT5104D + * + * Author: Tasanakorn Phaipool <tasanak...@gmail.com> + * + * This program 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. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define DRVNAME "gpio-nct5104d" + +/* + * Super-I/O registers + */ +#define SIO_LDSEL 0x07/* Logical device select */ +#define SIO_CHIPID 0x20/* Chaip ID (2 bytes) */ +#define SIO_GPIO_ENABLE0x30/* GPIO enable */ +#define SIO_GPIO1_MODE 0xE0/* GPIO1 Mode OpenDrain/Push-Pull */ +#define SIO_GPIO2_MODE 0xE1/* GPIO2 Mode OpenDrain/Push-Pull */ + +#define SIO_LD_GPIO0x07/* GPIO logical device */ +#define SIO_LD_GPIO_MODE 0x0F/* GPIO mode control device */ +#define SIO_UNLOCK_KEY 0x87/* Key to enable Super-I/O */ +#define SIO_LOCK_KEY 0xAA/* Key to disable Super-I/O */ + +#define SIO_NCT5104D_ID0x1061 /* Chip ID */ +#define SIO_PCENGINES_APU_NCT5104D_ID 0xc452 /* Chip ID */ + +enum chips { nct5104d }; + +static const char * const nct5104d_names[] = { + "nct5104d" +}; + +struct nct5104d_sio { + int addr; + enum chips type; +}; + +struct nct5104d_gpio_bank { + struct gpio_chip chip; + unsigned int regbase; + struct nct5104d_gpio_data *data; +}; + +struct nct5104d_gpio_data { + struct nct5104d_sio *sio; + int nr_bank; + struct nct5104d_gpio_bank *bank; +}; + +/* + * Super-I/O functions. + */ + +static inline int superio_inb(int base, int reg) +{ + outb(reg, base); + return inb(base + 1); +} + +static int superio_inw(int base, int reg) +{ + int val; + + outb(reg++, base); + val = inb(base + 1) << 8; + outb(reg, base); + val |= inb(base + 1); + + return val; +} + +static inline void superio_outb(int base, int reg, int val) +{ + outb(reg, base); + outb(val, base + 1); +} + +static inline int superio_enter(int base) +{ + /* Don't step on other drivers' I/O space by accident. */ + if (!request_muxed_region(base, 2, DRVNAME)) { + pr_err(DRVNAME "I/O address 0x%04x already in use\n", base); + return -EBUSY; + } + + /* According to the datasheet the key must be send twice. */ + outb(SIO_UNLOCK_KEY, base); + outb(SIO_UNLOCK_KEY, base); + + return 0; +} + +static inline void superio_select(int base, int ld) +{ + outb(SIO_LDSEL, base); + outb(ld, base + 1); +} + +static inline void superio_exit(int base) +{ + outb(SIO_LOCK_KEY, base); + release_region(base, 2); +} + +/* + * GPIO chip. + */ + +static int nct5104d_gpio_direction_in(struct gpio_chip *chip, unsigned offset); +static int nct5104d_gpio_get(struct gpio_chip *chip, unsigned offset); +static int nct5104d_gpio_direction_out(struct gpio_chip *chip, +unsigned offset, int value); +static void nct5104d_gpio_set(struct gpio_chip *chip, unsigned offset, int value); + +#define NCT5104D_GPIO_BANK(_base, _ngpio, _regbase)\ + {
[LEDE-DEV] [PATCH v2 2/2] apm821xx: Add support for the Cisco Meraki MX60/MX60W
This patch adds support for the Cisco Meraki MX60/MX60W Security Appliance. Flashing information can be found at https://github.com/riptidewave93/LEDE-MX60 Specs are as follows: AppliedMicro APM82181 SoC at 800MHz 1GiB NAND - Samsung K9K8G08U0D 512MB DDR RAM - 4x Nanya NT5TU128M8GE-AC Atheros AR8327-BL1A Gigabit Ethernet Switch 1x USB 2.0 Port More info can be found at https://wiki.openwrt.org/toh/meraki/mx60 Cc: Christian Lamparter <chunk...@gmail.com> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- .../linux/apm821xx/base-files/etc/board.d/01_leds | 8 + .../apm821xx/base-files/etc/board.d/02_network | 3 +- target/linux/apm821xx/base-files/etc/diag.sh | 15 +- target/linux/apm821xx/base-files/lib/apm821xx.sh | 4 + .../lib/preinit/05_set_iface_mac_apm821xx | 3 +- .../apm821xx/base-files/lib/upgrade/merakinand.sh | 9 +- .../apm821xx/base-files/lib/upgrade/platform.sh| 6 +- target/linux/apm821xx/config-4.4 | 1 + target/linux/apm821xx/dts/MX60.dts | 186 + target/linux/apm821xx/image/Makefile | 32 .../203-add-meraki-mx60-buckminster-support.patch | 32 11 files changed, 283 insertions(+), 16 deletions(-) create mode 100644 target/linux/apm821xx/dts/MX60.dts create mode 100644 target/linux/apm821xx/patches-4.4/203-add-meraki-mx60-buckminster-support.patch diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds b/target/linux/apm821xx/base-files/etc/board.d/01_leds index 38cfbdc..ad9bef9c 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/01_leds +++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds @@ -16,6 +16,14 @@ mr24) ucidef_set_led_wlan "wlan4" "WLAN4" "mr24:green:wifi4" "phy0tpt" ;; +mx60) + ucidef_set_led_switch "wan" "WAN" "mx60:green:wan" "switch0" "0x20" + ucidef_set_led_switch "lan1" "LAN1" "mx60:green:lan1" "switch0" "0x10" + ucidef_set_led_switch "lan2" "LAN2" "mx60:green:lan2" "switch0" "0x08" + ucidef_set_led_switch "lan3" "LAN3" "mx60:green:lan3" "switch0" "0x04" + ucidef_set_led_switch "lan4" "LAN4" "mx60:green:lan4" "switch0" "0x02" + ;; + mbl) ucidef_set_led_ide "sata" "SATA" "mbl:blue:power" ;; diff --git a/target/linux/apm821xx/base-files/etc/board.d/02_network b/target/linux/apm821xx/base-files/etc/board.d/02_network index 3a25709..90a8c1a 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/02_network +++ b/target/linux/apm821xx/base-files/etc/board.d/02_network @@ -9,11 +9,12 @@ board_config_update board=$(apm821xx_board_name) case "$board" in -mbl | \ +mbl|\ mr24) ucidef_set_interface_lan "eth0" ;; +mx60|\ wndr4700) ucidef_add_switch "switch0" \ "0@eth0" "4:lan" "3:lan" "2:lan" "1:lan" "5:wan" diff --git a/target/linux/apm821xx/base-files/etc/diag.sh b/target/linux/apm821xx/base-files/etc/diag.sh index 3ddd21d..3e480f1 100755 --- a/target/linux/apm821xx/base-files/etc/diag.sh +++ b/target/linux/apm821xx/base-files/etc/diag.sh @@ -4,17 +4,14 @@ . /lib/apm821xx.sh get_status_led() { - case $(apm821xx_board_name) in - mbl) - status_led="mbl:green:power" - ;; - - mr24) - status_led="mr24:green:power" - ;; + local board=$(apm821xx_board_name) + case $board in + mbl|\ + mr24|\ + mx60|\ wndr4700) - status_led="wndr4700:green:power" + status_led="$board:green:power" ;; *) diff --git a/target/linux/apm821xx/base-files/lib/apm821xx.sh b/target/linux/apm821xx/base-files/lib/apm821xx.sh index 78fe452..98f6ee9 100755 --- a/target/linux/apm821xx/base-files/lib/apm821xx.sh +++ b/target/linux/apm821xx/base-files/lib/apm821xx.sh @@ -14,6 +14,10 @@ apm821xx_board_detect() { name="mr24" ;; + *"Meraki MX60/MX60W Security Appliance") + name="mx60" + ;; + *"MyBook Live"*) name="mbl" ;; diff --git a/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx b/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx index 5dc7175..750af04 100644 --- a/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx +++ b/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx @@ -4,7 +4,8
[LEDE-DEV] [PATCH 0/2] Add support for the Cisco Meraki MX60 & MX60W
These patches add support for the Cisco Meraki MX60 & MX60W Security Appliance. Cc: Christian Lamparter <chunk...@gmail.com> Chris Blake (2): firmware-utils: Add support for the Cisco Meraki MX60/MX60W apm821xx: Add support for the Cisco Meraki MX60/MX60W .../linux/apm821xx/base-files/etc/board.d/01_leds | 8 + .../apm821xx/base-files/etc/board.d/02_network | 3 +- target/linux/apm821xx/base-files/etc/diag.sh | 15 +- target/linux/apm821xx/base-files/lib/apm821xx.sh | 4 + .../lib/preinit/05_set_iface_mac_apm821xx | 3 +- .../apm821xx/base-files/lib/upgrade/merakinand.sh | 9 +- .../apm821xx/base-files/lib/upgrade/platform.sh| 6 +- target/linux/apm821xx/config-4.4 | 3 + target/linux/apm821xx/dts/MX60.dts | 186 + target/linux/apm821xx/image/Makefile | 32 .../203-add-meraki-mx60-buckminster-support.patch | 32 tools/firmware-utils/src/mkmerakifw.c | 69 ++-- 12 files changed, 343 insertions(+), 27 deletions(-) create mode 100644 target/linux/apm821xx/dts/MX60.dts create mode 100644 target/linux/apm821xx/patches-4.4/203-add-meraki-mx60-buckminster-support.patch -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 1/2] firmware-utils: Add support for the Cisco Meraki MX60/MX60W
This patch adds header support for the Cisco Meraki MX60/MX60W, which are a part of the apm821xx target. Some structure changes were needed due to the fact this device uses U-Boot (unlike other devices in mkmerakifw.c) which uses a different header structure to define the load offsets for the image. A thanks to Christian for helping implement this properly. Cc: Christian Lamparter <chunk...@gmail.com> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- tools/firmware-utils/src/mkmerakifw.c | 69 +-- 1 file changed, 58 insertions(+), 11 deletions(-) diff --git a/tools/firmware-utils/src/mkmerakifw.c b/tools/firmware-utils/src/mkmerakifw.c index 61b81c6..6394cba 100644 --- a/tools/firmware-utils/src/mkmerakifw.c +++ b/tools/firmware-utils/src/mkmerakifw.c @@ -32,13 +32,27 @@ #define HDR_OFF_IMAGELEN 8 #define HDR_OFF_CHECKSUM 12 #define HDR_OFF_MAGIC2 32 -#define HDR_OFF_FILLER 36 +#define HDR_OFF_MAGIC3 36 #define HDR_OFF_STATICHASH 40 +#define HDR_OFF_KERNEL_OFFSET 40 +#define HDR_OFF_RAMDISK_OFFSET 44 +#define HDR_OFF_FDT_OFFSET 48 +#define HDR_OFF_UNKNOWN_OFFSET 52 struct board_info { - uint32_t magic; + uint32_t magic1; + uint32_t magic2; + uint32_t magic3; uint32_t imagelen; - unsigned char statichash[20]; + union { + unsigned char statichash[20]; + struct { + uint32_t kernel_offset; + uint32_t ramdisk_offset; + uint32_t fdt_offset; + uint32_t unknown_offset; + } mx60; + }; char *id; char *description; }; @@ -55,7 +69,8 @@ static const struct board_info boards[] = { { .id = "mr18", .description= "Meraki MR18 Access Point", - .magic = 0x8e73ed8a, + .magic1 = 0x8e73ed8a, + .magic2 = 0x8e73ed8a, .imagelen = 0x0080, .statichash = {0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 0x32, 0x55, @@ -64,14 +79,34 @@ static const struct board_info boards[] = { }, { .id = "mr24", .description= "Meraki MR24 Access Point", - .magic = 0x8e73ed8a, + .magic1 = 0x8e73ed8a, + .magic2 = 0x8e73ed8a, .imagelen = 0x0080, .statichash = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, }, { - + .id = "mx60", + .description= "Meraki MX60/MX60W Security Appliance", + .magic1 = 0x8e73ed8a, + .magic2 = 0xa1f0beef, /* Enables use of load addr in statichash */ + .magic3 = 0x00060001, /* This goes along with magic2 */ + .imagelen = 0x3fd0, + /* The static hash below does the following: +* 1st Row: Kernel Offset +* 2nd Row: Ramdisk Offset +* 3rd Row: FDT Offset +* 4th Row: ? Unused/Unknown ? +* 5th Row: ? Unused/Unknown ? +*/ + .mx60 = { + .kernel_offset = 0x1, + .ramdisk_offset = 0x3FFC00, + .fdt_offset = 0x0400, + .unknown_offset = 0x0400, + }, + }, { /* terminating entry */ } }; @@ -237,10 +272,10 @@ int main(int argc, char *argv[]) kernel = buf + HDR_LENGTH; fread(kernel, klen, 1, in); - /* Write magic values and filler */ - writel(buf, HDR_OFF_MAGIC1, board->magic); - writel(buf, HDR_OFF_MAGIC2, board->magic); - writel(buf, HDR_OFF_FILLER, 0); + /* Write magic values */ + writel(buf, HDR_OFF_MAGIC1, board->magic1); + writel(buf, HDR_OFF_MAGIC2, board->magic2); + writel(buf, HDR_OFF_MAGIC3, board->magic3); /* Write header and image length */ writel(buf, HDR_OFF_HDRLEN, HDR_LENGTH); @@ -248,7 +283,19 @@ int main(int argc, char *argv[]) /* Write checksum and static hash */ sha1_csum(kernel, klen, buf + HDR_OFF_CHECKSUM); - memcpy(buf + HDR_OFF_STATICHASH, board->statichash, 20); + + switch (board->magic2) { + case 0xa1f0beef: + writel(buf, HDR_OFF_KERNEL_OFFSET, board->mx60.kernel_offset); + writel(buf, HDR_OFF_RAMDISK_OFFSET, board->mx60.ramdisk_offset);
[LEDE-DEV] [PATCH 2/2] apm821xx: Add support for the Cisco Meraki MX60/MX60W
This patch adds support for the Cisco Meraki MX60/MX60W Security Appliance. Flashing information can be found at https://github.com/riptidewave93/LEDE-MX60 Specs are as follows: AppliedMicro APM82181 SoC at 800MHz 1GiB NAND - Samsung K9K8G08U0D 512MB DDR RAM - 4x Nanya NT5TU128M8GE-AC Atheros AR8327-BL1A Gigabit Ethernet Switch 1x USB 2.0 Port More info can be found at https://wiki.openwrt.org/toh/meraki/mx60 Cc: Christian Lamparter <chunk...@gmail.com> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- .../linux/apm821xx/base-files/etc/board.d/01_leds | 8 + .../apm821xx/base-files/etc/board.d/02_network | 3 +- target/linux/apm821xx/base-files/etc/diag.sh | 15 +- target/linux/apm821xx/base-files/lib/apm821xx.sh | 4 + .../lib/preinit/05_set_iface_mac_apm821xx | 3 +- .../apm821xx/base-files/lib/upgrade/merakinand.sh | 9 +- .../apm821xx/base-files/lib/upgrade/platform.sh| 6 +- target/linux/apm821xx/config-4.4 | 3 + target/linux/apm821xx/dts/MX60.dts | 186 + target/linux/apm821xx/image/Makefile | 32 .../203-add-meraki-mx60-buckminster-support.patch | 32 11 files changed, 285 insertions(+), 16 deletions(-) create mode 100644 target/linux/apm821xx/dts/MX60.dts create mode 100644 target/linux/apm821xx/patches-4.4/203-add-meraki-mx60-buckminster-support.patch diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds b/target/linux/apm821xx/base-files/etc/board.d/01_leds index 38cfbdc..ad9bef9c 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/01_leds +++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds @@ -16,6 +16,14 @@ mr24) ucidef_set_led_wlan "wlan4" "WLAN4" "mr24:green:wifi4" "phy0tpt" ;; +mx60) + ucidef_set_led_switch "wan" "WAN" "mx60:green:wan" "switch0" "0x20" + ucidef_set_led_switch "lan1" "LAN1" "mx60:green:lan1" "switch0" "0x10" + ucidef_set_led_switch "lan2" "LAN2" "mx60:green:lan2" "switch0" "0x08" + ucidef_set_led_switch "lan3" "LAN3" "mx60:green:lan3" "switch0" "0x04" + ucidef_set_led_switch "lan4" "LAN4" "mx60:green:lan4" "switch0" "0x02" + ;; + mbl) ucidef_set_led_ide "sata" "SATA" "mbl:blue:power" ;; diff --git a/target/linux/apm821xx/base-files/etc/board.d/02_network b/target/linux/apm821xx/base-files/etc/board.d/02_network index 3a25709..90a8c1a 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/02_network +++ b/target/linux/apm821xx/base-files/etc/board.d/02_network @@ -9,11 +9,12 @@ board_config_update board=$(apm821xx_board_name) case "$board" in -mbl | \ +mbl|\ mr24) ucidef_set_interface_lan "eth0" ;; +mx60|\ wndr4700) ucidef_add_switch "switch0" \ "0@eth0" "4:lan" "3:lan" "2:lan" "1:lan" "5:wan" diff --git a/target/linux/apm821xx/base-files/etc/diag.sh b/target/linux/apm821xx/base-files/etc/diag.sh index 3ddd21d..3e480f1 100755 --- a/target/linux/apm821xx/base-files/etc/diag.sh +++ b/target/linux/apm821xx/base-files/etc/diag.sh @@ -4,17 +4,14 @@ . /lib/apm821xx.sh get_status_led() { - case $(apm821xx_board_name) in - mbl) - status_led="mbl:green:power" - ;; - - mr24) - status_led="mr24:green:power" - ;; + local board=$(apm821xx_board_name) + case $board in + mbl|\ + mr24|\ + mx60|\ wndr4700) - status_led="wndr4700:green:power" + status_led="$board:green:power" ;; *) diff --git a/target/linux/apm821xx/base-files/lib/apm821xx.sh b/target/linux/apm821xx/base-files/lib/apm821xx.sh index 78fe452..98f6ee9 100755 --- a/target/linux/apm821xx/base-files/lib/apm821xx.sh +++ b/target/linux/apm821xx/base-files/lib/apm821xx.sh @@ -14,6 +14,10 @@ apm821xx_board_detect() { name="mr24" ;; + *"Meraki MX60/MX60W Security Appliance") + name="mx60" + ;; + *"MyBook Live"*) name="mbl" ;; diff --git a/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx b/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx index 5dc7175..750af04 100644 --- a/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx +++ b/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx @@ -4,7 +4,8 @@
Re: [LEDE-DEV] [RFC 3/6 v2] x86: Add sp5100_tco as a kernel module
On Sun, Oct 23, 2016 at 7:19 AM, Felix Fietkau <n...@nbd.name> wrote: > On 2016-10-22 19:39, Chris Blake wrote: >> This patch enables the kernel sp5100_tco watchdog driver to be built as >> a kernel module. >> >> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> >> --- >> target/linux/x86/modules.mk | 15 +++ >> 1 file changed, 15 insertions(+) >> >> diff --git a/target/linux/x86/modules.mk b/target/linux/x86/modules.mk >> index 1fc5ce5..f6a87ee 100644 >> --- a/target/linux/x86/modules.mk >> +++ b/target/linux/x86/modules.mk >> @@ -19,3 +19,18 @@ define KernelPackage/gpio-nct5104d/description >> endef >> >> $(eval $(call KernelPackage,gpio-nct5104d)) >> + >> +define KernelPackage/sp5100_tco >> + SUBMENU:=$(OTHER_MENU) >> + TITLE:=SP5100 Watchdog Support >> + DEPENDS:=@TARGET_x86 >> + KCONFIG:=CONFIG_SP5100_TCO >> + FILES:=$(LINUX_DIR)/drivers/watchdog/sp5100_tco.ko >> + AUTOLOAD:=$(call AutoLoad,50,sp5100_tco,1) >> +endef >> + >> +define KernelPackage/sp5100_tco/description >> + Kernel module for the SP5100_TCO hardware watchdog. >> +endef > Please enable this in the x86/64 kernel config instead of packaging it. > > - Felix > Felix, If possible, can sp5100_tco be kept as a kmod? The justifiable reason is that if a user wants to use the I2c interface on the board, this driver needs to be unloaded as it can't be used along side the i2c interface. Keeping this a kmod will allow users to do this without needing to modify the build. More info is at https://github.com/riptidewave93/LEDE-APU2/issues/9 and https://github.com/riptidewave93/LEDE-APU2/pull/5#issuecomment-255667736 Regards, Chris Blake ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH 1/1] package/utils: Add beep package
John, Sounds good. My only question is around the current RFC for the PC Engines APU2 which has this application defined in the profile for the board. Would that be enough justification to allow this into the LEDE branch, or would it be OK to keep "beep" defined in the profile and just merge this into the packages feed? Regards, Chris Blake On Thu, Oct 27, 2016 at 5:08 AM, John Crispin <j...@phrozen.org> wrote: > Hi, > > after some time considering i am against merging this into trunk. there > are no direct users and no hardware that wont function without. please > submit the package as a PR to the packages feed. > > John > > On 19/10/2016 16:59, Chris Blake wrote: >> This adds the "beep" binary as a package to LEDE. Note that busybox does >> have a beep option that can be built in, but it is disabled by default >> on all LEDE targets. This package gives users the option to manually >> install beep at a later time, or include it as a default for a device >> profile. >> >> This was based on the older PR at https://lists.openwrt.org/pipermail >> /openwrt-devel/2009-November/005226.html >> >> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> >> --- >> package/utils/beep/Makefile | 50 >> + >> 1 file changed, 50 insertions(+) >> create mode 100644 package/utils/beep/Makefile >> >> diff --git a/package/utils/beep/Makefile b/package/utils/beep/Makefile >> new file mode 100644 >> index 000..b9bb4d80 >> --- /dev/null >> +++ b/package/utils/beep/Makefile >> @@ -0,0 +1,50 @@ >> +# >> +# Copyright (C) 2016 OpenWrt.org >> +# >> +# This is free software, licensed under the GNU General Public License v2. >> +# See /LICENSE for more information. >> +# >> + >> +include $(TOPDIR)/rules.mk >> + >> +PKG_NAME:=beep >> +PKG_REV:=0d790fa45777896749a885c3b93b2c1476d59f20 >> +PKG_VERSION:=1.3 >> +PKG_RELEASE:=1 >> + >> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz >> +PKG_SOURCE_URL:=https://github.com/johnath/beep.git >> +PKG_SOURCE_PROTO:=git >> +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) >> +PKG_SOURCE_VERSION:=$(PKG_REV) >> + >> +PKG_LICENSE:=GPL >> +PKG_LICENSE_FILES:= >> + >> +include $(INCLUDE_DIR)/package.mk >> + >> +define Package/beep >> + SECTION:=sound >> + CATEGORY:=Sound >> + DEPENDS:=+kmod-pcspkr >> + TITLE:=Play beep sounds through a PC speaker >> + URL:=http://johnath.com/beep/README >> +endef >> + >> +define Package/beep/description >> + This program plays beeps through the PC speaker >> +endef >> + >> +CONFIGURE_ARGS += \ >> + --enable-static \ >> + --enable-shared >> + >> +MAKE_FLAGS += \ >> + CFLAGS="$(TARGET_CFLAGS)" >> + >> +define Package/beep/install >> + $(INSTALL_DIR) $(1)/usr/bin >> + $(INSTALL_BIN) $(PKG_BUILD_DIR)/beep $(1)/usr/bin >> +endef >> + >> +$(eval $(call BuildPackage,beep)) >> -- >> 2.7.4 >> >> ___ >> Lede-dev mailing list >> Lede-dev@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/lede-dev >> ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 3/3 v3] ar71xx: Remove switch config for the MR12/MR16
These boards do not have a switch, so they should have never been added to this file in the first place. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- .../ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration index ee8f63b..c6b91b7 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration @@ -61,8 +61,6 @@ dir-615-c1|\ dir-615-e1|\ dir-615-e4|\ ja76pf|\ -mr-12|\ -mr-16|\ rb-750|\ rb-751|\ tew-632brp|\ -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 2/3 v3] ar71xx: add mac partition to the MR12/MR16
On the stock Meraki Firmare for the MR12/MR16, a chunk of SPI space after u-boot-env is used to store the boards Mac address. Sadly as this was removed on any device already on OpenWRT/LEDE, moving forward a new, 64k partition named "mac" will be used to store the mac address for the device (which is the minimum size). This allows users to properly set the correct MAC, without editing the ART partition (which holds the same MAC for all devices). The reason the space is taken from kernel instead of rootfs is currently kernels are only 1.3MB, so that way we can leave the current rootfs space alone for users who fully utilize the available storage space. Once this partition is added to a device, you can set your MAC doing the following: mtd erase mac echo -n -e '\x00\x18\x0a\x33\x44\x55' > /dev/mtd5 sync && reboot Where 00:18:0a:33:44:55 is your MAC address. This was tested, and confirmed working on both the MR12 and MR16. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- .../linux/ar71xx/files/arch/mips/ath79/mach-mr12.c | 15 +++ .../linux/ar71xx/files/arch/mips/ath79/mach-mr16.c | 22 +++--- target/linux/ar71xx/image/generic.mk | 8 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c index 12c9a1c..5a337e5 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c @@ -42,8 +42,7 @@ #define MR12_WAN_PHYMASKBIT(4) -#define MR12_WMAC0_MAC_OFFSET 0x120c -#define MR12_CALDATA0_OFFSET0x1000 +#define MR12_CALDATA0_OFFSET0x21000 static struct gpio_led MR12_leds_gpio[] __initdata = { { @@ -90,8 +89,9 @@ static struct gpio_keys_button MR12_gpio_keys[] __initdata = { static void __init MR12_setup(void) { - u8 *mac = (u8 *) KSEG1ADDR(0xbfff); - + u8 *mac = (u8 *) KSEG1ADDR(0xbffd); + u8 wlan_mac[ETH_ALEN]; + ath79_register_mdio(0,0x0); ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); @@ -107,9 +107,8 @@ static void __init MR12_setup(void) ARRAY_SIZE(MR12_gpio_keys), MR12_gpio_keys); - ap91_pci_init(mac + MR12_CALDATA0_OFFSET, - mac + MR12_WMAC0_MAC_OFFSET); - + ath79_init_mac(wlan_mac, mac, 1); + ap91_pci_init(mac + MR12_CALDATA0_OFFSET, wlan_mac); } -MIPS_MACHINE(ATH79_MACH_MR12, "MR12", "Meraki MR12", MR12_setup); \ No newline at end of file +MIPS_MACHINE(ATH79_MACH_MR12, "MR12", "Meraki MR12", MR12_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c index 9f08e3d..9da21ea 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c @@ -42,10 +42,8 @@ #define MR16_WAN_PHYMASKBIT(0) -#define MR16_WMAC0_MAC_OFFSET 0x120c -#define MR16_WMAC1_MAC_OFFSET 0x520c -#define MR16_CALDATA0_OFFSET 0x1000 -#define MR16_CALDATA1_OFFSET 0x5000 +#define MR16_CALDATA0_OFFSET 0x21000 +#define MR16_CALDATA1_OFFSET 0x25000 static struct gpio_led MR16_leds_gpio[] __initdata = { { @@ -92,8 +90,10 @@ static struct gpio_keys_button MR16_gpio_keys[] __initdata = { static void __init MR16_setup(void) { - u8 *mac = (u8 *) KSEG1ADDR(0xbfff); - + u8 *mac = (u8 *) KSEG1ADDR(0xbffd); + u8 wlan0_mac[ETH_ALEN]; + u8 wlan1_mac[ETH_ALEN]; + ath79_register_mdio(0,0x0); ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); @@ -109,10 +109,10 @@ static void __init MR16_setup(void) ARRAY_SIZE(MR16_gpio_keys), MR16_gpio_keys); - ap94_pci_init(mac + MR16_CALDATA0_OFFSET, - mac + MR16_WMAC0_MAC_OFFSET, - mac + MR16_CALDATA1_OFFSET, - mac + MR16_WMAC1_MAC_OFFSET); + ath79_init_mac(wlan0_mac, mac, 1); + ath79_init_mac(wlan1_mac, mac, 2); + ap94_pci_init(mac + MR16_CALDATA0_OFFSET, wlan0_mac, + mac + MR16_CALDATA1_OFFSET, wlan1_mac); } -MIPS_MACHINE(ATH79_MACH_MR16, "MR16", "Meraki MR16", MR16_setup); \ No newline at end of file +MIPS_MACHINE(ATH79_MACH_MR16, "MR16", "Meraki MR16", MR16_setup); diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index ee910af..cda2015 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -101,8 +101,8 @@ define Device/mr12 DEVICE_TITLE := Meraki MR12 DEVICE_PACKAGES := kmod-spi-gpio BOARDNAME = MR12
Re: [LEDE-DEV] [PATCH v4] base-files: Ensure reset only works if an overlay exists
Hello, Alexis is correct, it's to ensure any chance of a random error is suppressed. 2> /dev/null was just added as a protection. Regards, Chris Blake On Sun, Oct 23, 2016 at 4:46 PM, Alexis Green <ale...@cessp.it> wrote: > I’m guessing it’s because there might some random error message from grep? > Maybe use -s option for grep instead to suppress error messages? > >> On Oct 23, 2016, at 12:30 PM, Bastian Bittorf <b...@npl.de> wrote: >> >> * Chris Blake <chrisrblak...@gmail.com> [23.10.2016 21:10]: >>> +OVERLAY="$( grep ' /overlay ' /proc/mounts 2>/dev/null )" >> >> whats the reason for the 2>...? >> >> bye, bastian >> >> ___ >> Lede-dev mailing list >> Lede-dev@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/lede-dev > ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH v4] base-files: Ensure reset only works if an overlay exists
Currently the reset script will try to run jffs2reset on boards that are running a rw rootfs, such as ext4. This will cause jffs2reset to fail and the board to never reboot while the LED blinks until a manual reboot. This commit does two different things: 1. Disables reset on boards that do not have an overlay mount 2. Disables the Blinking LED after 5 seconds if the board does not support reset Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- package/base-files/files/etc/rc.button/reset | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/etc/rc.button/reset b/package/base-files/files/etc/rc.button/reset index c6dc7cf..c6a3165 100755 --- a/package/base-files/files/etc/rc.button/reset +++ b/package/base-files/files/etc/rc.button/reset @@ -2,8 +2,12 @@ . /lib/functions.sh +OVERLAY="$( grep ' /overlay ' /proc/mounts 2>/dev/null )" + case "$ACTION" in pressed) + [ -z "$OVERLAY" ] && return 0 + return 5 ;; timeout) @@ -16,7 +20,7 @@ released) echo "REBOOT" > /dev/console sync reboot - elif [ "$SEEN" -gt 5 ] + elif [ "$SEEN" -gt 5 -a -n "$OVERLAY" ] then echo "FACTORY RESET" > /dev/console jffs2reset -y && reboot & -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [RFC 4/6 v2] Generic: Crypto - aesni - add ccm(aes) algorithm implementation
Christian, Thanks for the information. This patch will be removed from the next RFC. - Chris Blake On Sat, Oct 22, 2016 at 2:12 PM, Christian Lamparter <chunk...@googlemail.com> wrote: > On Saturday, October 22, 2016 12:39:26 PM CEST Chris Blake wrote: >> This patch was provided by Ben at http://lists.infradead.org/pipermail >> /lede-dev/2016-October/003332.html and adds ccm(aes) support to the AES-NI >> acceleration. Currently it is not submitted upstream, but has been confirmed >> working on the PC Engines APU2 using openssl. > Well, I might be able to provide a bit of context for that patch > and why it was never for upstream. > > First, the original version can be found here: > "Re: Looking for non-NIC hardware-offload for wpa2 decrypt." > <http://marc.info/?l=linux-wireless=140767827527151> > > And it wasn't about openssl at all (In fact, openssl could just use > AES-NI directly instead of bothering the kernel, since it's part of > the x86 ISA). Instead it was a PoC that improved the performance of > the software encryption/decryption in mac80211's aes_ccm.c code-path. > > In order to get mac80211 to pick it up as a viable aead cipher, it > had to support the synchronous crypto reguests from mac80211. So most > of the special code deals with setting up aes-ccm fallback (for > !irq_fpu_usable() cases - used by ICMP) and the other is just the AESNI > aes-ctr with parts from ccm.c. > > I don't think this will ever fly by the crypto folks in this form due > to the CRYPTO_ALGO_ASYNC fallback parts which are necessary to get it > to work with mac80211. And in case CRYPTO_ALGO_ASYNC is possible, the > crypto framework will already pick up AESNI aes-ctr anyway. > > The real solution here would be: make mac80211 support asynchronous > software encryption/decryption. This has the added benefit that it > would work with other ciphers and also allow for hardware crypto > devices (like the ppc4xx-crypto). And not supporting this patch. > (Note: crypto API changes are a pain and "expensive"). > > Regards, > Christian > > [...] >> ++struct ccm_async_ctx { >> ++struct crypto_aes_ctx ctx; >> ++struct crypto_aead *fallback; >> ++}; >> ++[...] >> ++ >> ++static int ccm_init(struct crypto_aead *tfm) >> ++{ >> ++struct crypto_aead *crypto_tfm; >> ++struct ccm_async_ctx *ctx = (struct ccm_async_ctx *) >> ++PTR_ALIGN((u8 *)crypto_aead_ctx(tfm), AESNI_ALIGN); >> ++ >> ++crypto_tfm = crypto_alloc_aead("ccm(aes)", 0, >> ++CRYPTO_ALG_ASYNC | CRYPTO_ALG_NEED_FALLBACK); >> ++if (IS_ERR(crypto_tfm)) >> ++return PTR_ERR(crypto_tfm); >> ++ >> ++ctx->fallback = crypto_tfm; >> ++return 0; >> ++} >> ++ >> ++static void ccm_exit(struct crypto_aead *tfm) >> ++{ >> ++struct ccm_async_ctx *ctx = (struct ccm_async_ctx *) >> ++PTR_ALIGN((u8 *)crypto_aead_ctx(tfm), AESNI_ALIGN); >> ++ >> ++if (!IS_ERR_OR_NULL(ctx->fallback)) >> ++crypto_free_aead(ctx->fallback); >> ++} >> ++ >> ++static int ccm_setkey(struct crypto_aead *aead, const u8 *in_key, >> ++ unsigned int key_len) >> ++{ >> ++struct crypto_tfm *tfm = crypto_aead_tfm(aead); >> ++struct ccm_async_ctx *ctx = (struct ccm_async_ctx *) >> ++PTR_ALIGN((u8 *)crypto_aead_ctx(aead), AESNI_ALIGN); >> ++int err; >> ++ >> ++err = __ccm_setkey(aead, in_key, key_len); >> ++if (err) >> ++return err; >> ++ >> ++/* >> ++ * Set the fallback transform to use the same request flags as >> ++ * the hardware transform. >> ++ */ >> ++ctx->fallback->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; >> ++ctx->fallback->base.crt_flags |= >> ++tfm->crt_flags & CRYPTO_TFM_REQ_MASK; >> ++return crypto_aead_setkey(ctx->fallback, in_key, key_len); >> ++} >> ++ >> ++static int ccm_setauthsize(struct crypto_aead *aead, unsigned int authsize) >> ++{ >> ++struct ccm_async_ctx *ctx = (struct ccm_async_ctx *) >> ++PTR_ALIGN((u8 *)crypto_aead_ctx(aead), AESNI_ALIGN); >> ++int err; >> ++ >> ++err = __ccm_setauthsize(aead, authsize); >> ++if (err) >> ++return err; >> ++ >> ++return crypto_aead_setauthsize(ctx->fallback, authsize); >> ++} >> ++ >> ++static int ccm_encrypt(struct aead_request *req) >> ++{ >> ++int ret; >> ++ >> ++if (!irq_fpu_usable()) { >&g
Re: [LEDE-DEV] [RFC 0/6 v2] Add the PC Engines APU2 to LEDE
Hello, In regards to the usb-serial-kmod decision, this goes back to the issue in the coverletter around what should be considered "acceptable" for this image or not. If we are going for full functionality, then we could add every package available to the image. The goal is to support things the PC Engines, out of box, supports, unless I hear otherwise from any of the maintainers. As the board has a SIM slot I can see how usb-serial-kmod may be acceptable, but with so many serial/modem kmods, where is the line drawn? With that said, I am open to any critizism as I just want to make sure this image meets the communites, and maintainers, requests. I will go ahead and add usb-serial-kmod to the next RFC. Regards, Chris Blake ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [RFC 6/6 v2] x86: Add a Profile for the PC Engines APU2 board
The following patch adds support for the PC Engines APU2 board within the x86_64 target. Currently this patch relies on the beep package, which is in review at http://lists.infradead.org/pipermail/lede- dev/2016-October/003455.html The changes are as follows: - Enable the LED driver in the kernel config so it is available during boot. Note that this driver does use DMI, so it will only load on the APU2 board. - Enable DEVMEM within the kernel config for use with the flashrom package. - Add userspace support for LEDs & reset button, as well as the default network config. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/x86/64/config-default | 2 ++ target/linux/x86/64/profiles/001-PCEngines.mk | 21 target/linux/x86/base-files/etc/board.d/01_leds| 22 + target/linux/x86/base-files/etc/board.d/02_network | 26 +++ target/linux/x86/base-files/etc/diag.sh| 37 ++ target/linux/x86/base-files/lib/x86.sh | 13 6 files changed, 121 insertions(+) create mode 100644 target/linux/x86/64/profiles/001-PCEngines.mk create mode 100755 target/linux/x86/base-files/etc/board.d/01_leds create mode 100755 target/linux/x86/base-files/etc/board.d/02_network create mode 100755 target/linux/x86/base-files/etc/diag.sh create mode 100755 target/linux/x86/base-files/lib/x86.sh diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default index 609ff2d..7b8f4f3 100644 --- a/target/linux/x86/64/config-default +++ b/target/linux/x86/64/config-default @@ -76,6 +76,7 @@ CONFIG_CRYPTO_CRCT10DIF=y # CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set # CONFIG_CRYPTO_TWOFISH_X86_64 is not set # CONFIG_CRYPTO_TWOFISH_X86_64_3WAY is not set +CONFIG_DEVMEM=y # CONFIG_EFI is not set CONFIG_FB=y CONFIG_FB_CMDLINE=y @@ -145,6 +146,7 @@ CONFIG_ITCO_WDT=y # CONFIG_KVM_DEBUG_FS is not set CONFIG_KVM_GUEST=y # CONFIG_LCD_CLASS_DEVICE is not set +CONFIG_LEDS_APU2=y # CONFIG_LEGACY_VSYSCALL_EMULATE is not set # CONFIG_LEGACY_VSYSCALL_NATIVE is not set CONFIG_LEGACY_VSYSCALL_NONE=y diff --git a/target/linux/x86/64/profiles/001-PCEngines.mk b/target/linux/x86/64/profiles/001-PCEngines.mk new file mode 100644 index 000..8f416de --- /dev/null +++ b/target/linux/x86/64/profiles/001-PCEngines.mk @@ -0,0 +1,21 @@ +# +# Copyright (C) 2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/APU2 + NAME:=PC Engines APU2 + PACKAGES:=beep flashrom libsensors lm-sensors usbutils wpad-mini \ + kmod-ath9k kmod-ath10k kmod-gpio-button-hotplug kmod-gpio-nct5104d \ + kmod-hwmon-core kmod-hwmon-k10temp kmod-leds-gpio kmod-pcspkr \ + kmod-sound-core kmod-sp5100_tco kmod-usb-core kmod-usb-ohci \ + kmod-usb2 kmod-usb3 \ + -kmod-e1000e -kmod-e1000 -kmod-r8169 +endef + +define Profile/APU2/Description + PC Engines APU2 Embedded Board +endef +$(eval $(call Profile,APU2)) diff --git a/target/linux/x86/base-files/etc/board.d/01_leds b/target/linux/x86/base-files/etc/board.d/01_leds new file mode 100755 index 000..1cd83e3 --- /dev/null +++ b/target/linux/x86/base-files/etc/board.d/01_leds @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Copyright (C) 2016 OpenWrt.org +# + +. /lib/functions/uci-defaults.sh +. /lib/x86.sh + +board_config_update + +board=$(x86_board_name) + +case "$board" in +pc-engines-apu2) + ucidef_set_led_wlan "wlan0" "WLAN0" "apu2:green:led2" "phy0tpt" + ucidef_set_led_wlan "wlan1" "WLAN1" "apu2:green:led3" "phy1tpt" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/x86/base-files/etc/board.d/02_network b/target/linux/x86/base-files/etc/board.d/02_network new file mode 100755 index 000..f0e23f3 --- /dev/null +++ b/target/linux/x86/base-files/etc/board.d/02_network @@ -0,0 +1,26 @@ +#!/bin/sh +# +# Copyright (C) 2016 OpenWrt.org +# + +. /lib/functions/system.sh +. /lib/functions/uci-defaults.sh +. /lib/x86.sh + +board_config_update + +board=$(x86_board_name) + +case "$board" in +pc-engines-apu2) + ucidef_set_interfaces_lan_wan "eth1" "eth0" + ucidef_set_interface_raw "opt" "eth2" + ;; +*) + ucidef_set_interfaces_lan_wan "eth1" "eth0" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/x86/base-files/etc/diag.sh b/target/linux/x86/base-files/etc/diag.sh new file mode 100755 index 000..27e150d --- /dev/null +++ b/target/linux/x86/base-files/etc/diag.sh @@ -0,0 +1,37 @@ +#!/bin/sh +# +# Copyright (C) 2016 OpenWrt.org +# + +. /lib/functions/leds.sh +. /lib/x86.sh + +get_status_led() { +case $(x86_board_name) in +pc-engines-apu2) +status_led="
[LEDE-DEV] [RFC 0/6 v2] Add the PC Engines APU2 to LEDE
This is the 2nd RFC to port the PC Engines APU2 board to LEDE. The last RFC can be found at http://lists.infradead.org/pipermail/lede-dev/2016-October/003326.html Things Working: - board detection - USB ports - LED/Button support - ath9k and ath10k - to support both wireless cards sold via PC Engines - SP5100 Watchdog - NCT5104D GPIO Driver - PC Buzzer - AES-NI Acceleration Not Working: - You tell me? Default Packages: - flashrom - BIOS Upgrades - lm-sensors - Temp Monitoring - wpad-mini - Wireless AP support - beep - PC Speaker support - usbutils - lsusb and other tools Changes added from the last RFC: - Unsquashed SP5100_TCO patches and moved them to generic - Added "beep" package, as well as the required kmods to use it. - Patch for adding beep can be found at http://lists.infradead.org/pipermail/lede-dev/2016-October/003455.html - Added AES-NI patch from http://lists.infradead.org/pipermail/lede-dev/2016-October/003332.html to linux/generic - Thanks Ben! - Enabled AES-NI into the x86_64 config-default - Removed CONFIG_INPUT_PCSPKR from x86 config - Added lsusb utility - Removed hwmon definition from x86_64 config-default (thanks to https://github.com/lede-project/source/commit/5f9598a432d92c1b60f4f2c724da0912cd3369a1) - Remove unused default modules at the profile level - Removed hwclock package as it's included in busybox - Updates to the led-apu2.c driver around board detection Changes rejected from the last RFC: - add usb-serial-kmod - The goal of this port is to add support for all sold hardware via PC Engines. As they do not sell 2G/3G/4G PCI-E modems, this will not be included. - add AES_NI_INTEL to crypto-aes - http://lists.infradead.org/pipermail/lede-dev/2016-October/003331.html is no longer relevant as crypto-aes was removed from crypto.mk Things that still need working out: - Default Packages - Currently the "goal" of my unofficial port was to make sure all features of the device, and hardware sold via PC Engines, is supported. Is this the path LEDE wants to take, or should it be more of a "minimal" approach? AKA, no packages/ath*k - Profile Specific Images - So far the ./image/Makefile does not seem to support 'profiles'. This will need to be fixed, so APU2 & Generic images can build without merging. - x86_64 kernel config - GPIO support had to be added. Should this be done here, or in the root target kernel config like other targets? Also, DEVMEM was added for flashrom. Is this an issue, or would it be OK to keep this in? - AES-NI - Currently we are enabling it via the kernel config as the crypto-aes module was removed from being a kmod. Do we want to try to re-add it as a module? If there are any comments, suggestions, or visible improvements please let me know/reply with some patches. Cc: Jo-Philipp Wich <j...@mein.io> Cc: Felix Fietkau <n...@nbd.name> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> Chris Blake (6): Generic: Backport sp5100_tco patches for AMD platforms x86: Add LED & GPIO drivers for the PC Engines APU2 board x86: Add sp5100_tco as a kernel module Generic: Crypto - aesni - add ccm(aes) algorithm implementation x86: Update the x86_64 kernel config x86: Add a Profile for the PC Engines APU2 board ...5100_tco-Add-AMD-Mullins-platform-support.patch | 30 ++ ...5100_tco-Add-AMD-Carrizo-platform-support.patch | 31 ++ ...device-check-for-SB800-and-later-chipsets.patch | 80 +++ ...5100_tco-properly-check-for-new-register-.patch | 76 +++ ...esni-add-ccm-aes-algorithm-implementation.patch | 552 + target/linux/x86/64/config-default | 14 +- target/linux/x86/64/profiles/001-PCEngines.mk | 21 + target/linux/x86/base-files/etc/board.d/01_leds| 22 + target/linux/x86/base-files/etc/board.d/02_network | 26 + target/linux/x86/base-files/etc/diag.sh| 37 ++ target/linux/x86/base-files/lib/x86.sh | 13 + .../linux/x86/files/drivers/gpio/gpio-nct5104d.c | 432 target/linux/x86/files/drivers/leds/leds-apu2.c| 374 ++ target/linux/x86/modules.mk| 36 ++ .../x86/patches-4.4/800-add-apu2-led-driver.patch | 29 ++ .../patches-4.4/801-add-nct5104d-gpio-driver.patch | 27 + 16 files changed, 1799 insertions(+), 1 deletion(-) create mode 100644 target/linux/generic/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch create mode 100644 target/linux/generic/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch create mode 100644 target/linux/generic/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch create mode 100644 target/linux/generic/patches-4.4/097-0004-watchdog-sp5100_tco-properly-check-for-new-register-.patch create mode 100644 target/linux/generic/patches-4.4/891-0001-crypto-aesni-add-ccm-aes-algorithm-implementation.pa
[LEDE-DEV] [RFC 1/6 v2] Generic: Backport sp5100_tco patches for AMD platforms
This patch adds the following upstream patches to the 4.4 kernel: sp5100_tco: Add AMD Mullins platform support sp5100_tco: Add AMD Carrizo platform support sp5100_tco: fix the device check for SB800 and later chipsets watchdog: sp5100_tco: properly check for new register layouts These patches are required for sp5100_tco to work correctly on newer AMD embedded boards, such as the PC Engines APU2. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- ...5100_tco-Add-AMD-Mullins-platform-support.patch | 30 ...5100_tco-Add-AMD-Carrizo-platform-support.patch | 31 + ...device-check-for-SB800-and-later-chipsets.patch | 80 ++ ...5100_tco-properly-check-for-new-register-.patch | 76 4 files changed, 217 insertions(+) create mode 100644 target/linux/generic/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch create mode 100644 target/linux/generic/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch create mode 100644 target/linux/generic/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch create mode 100644 target/linux/generic/patches-4.4/097-0004-watchdog-sp5100_tco-properly-check-for-new-register-.patch diff --git a/target/linux/generic/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch b/target/linux/generic/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch new file mode 100644 index 000..ee88859 --- /dev/null +++ b/target/linux/generic/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch @@ -0,0 +1,30 @@ +From 190aa4304de6fe2185d96392ddf56580fa133e99 Mon Sep 17 00:00:00 2001 +From: Denis Turischev <denis.turisc...@compulab.co.il> +Date: Tue, 24 Nov 2015 10:46:12 +0200 +Subject: [PATCH] sp5100_tco: Add AMD Mullins platform support + +AMD Mullins watchdog is fully compatible to the previous Hudson chipset, +reuse the existent sp5100_tco driver. + +Signed-off-by: Denis Turischev <denis.turisc...@compulab.co.il> +Signed-off-by: Guenter Roeck <li...@roeck-us.net> +Signed-off-by: Wim Van Sebroeck <w...@iguana.be> +--- + drivers/watchdog/sp5100_tco.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c +index eb8044e..ef039f8 100644 +--- a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c +@@ -306,6 +306,8 @@ static struct miscdevice sp5100_tco_miscdev = { + static const struct pci_device_id sp5100_tco_pci_tbl[] = { + { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, PCI_ANY_ID, + PCI_ANY_ID, }, ++ { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, PCI_ANY_ID, ++PCI_ANY_ID, }, + { 0, }, /* End of list */ + }; + MODULE_DEVICE_TABLE(pci, sp5100_tco_pci_tbl); +-- +2.7.4 diff --git a/target/linux/generic/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch b/target/linux/generic/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch new file mode 100644 index 000..664d4bb --- /dev/null +++ b/target/linux/generic/patches-4.4/097-0002-sp5100_tco-Add-AMD-Carrizo-platform-support.patch @@ -0,0 +1,31 @@ +From cca118fa2a0a94e0f0b3c8dd1dda922cdee45089 Mon Sep 17 00:00:00 2001 +From: Huang Rui <ray.hu...@amd.com> +Date: Mon, 23 Nov 2015 18:07:36 +0800 +Subject: [PATCH] sp5100_tco: Add AMD Carrizo platform support + +sp5100_tco watchdog is also supported on AMD KernCZ chipset of Carrizo +platform. + +Signed-off-by: Huang Rui <ray.hu...@amd.com> +Cc: Denis Turischev <denis.turisc...@compulab.co.il> +Signed-off-by: Guenter Roeck <li...@roeck-us.net> +Signed-off-by: Wim Van Sebroeck <w...@iguana.be> +--- + drivers/watchdog/sp5100_tco.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c +index ef039f8..0ccadb4 100644 +--- a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c +@@ -308,6 +308,8 @@ static const struct pci_device_id sp5100_tco_pci_tbl[] = { + PCI_ANY_ID, }, + { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_HUDSON2_SMBUS, PCI_ANY_ID, + PCI_ANY_ID, }, ++ { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_KERNCZ_SMBUS, PCI_ANY_ID, ++PCI_ANY_ID, }, + { 0, }, /* End of list */ + }; + MODULE_DEVICE_TABLE(pci, sp5100_tco_pci_tbl); +-- +2.7.4 diff --git a/target/linux/generic/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch b/target/linux/generic/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch new file mode 100644 index 000..e9f4513 --- /dev/null +++ b/target/linux/generic/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch @@ -0,0 +1,80 @@ +From bdecfcdb5461834aab24002bb18d3cbdd907b7fb Mon Sep 17 00:00:00 2001 +From: Huang Rui <ray.hu...@a
[LEDE-DEV] [RFC 3/6 v2] x86: Add sp5100_tco as a kernel module
This patch enables the kernel sp5100_tco watchdog driver to be built as a kernel module. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/x86/modules.mk | 15 +++ 1 file changed, 15 insertions(+) diff --git a/target/linux/x86/modules.mk b/target/linux/x86/modules.mk index 1fc5ce5..f6a87ee 100644 --- a/target/linux/x86/modules.mk +++ b/target/linux/x86/modules.mk @@ -19,3 +19,18 @@ define KernelPackage/gpio-nct5104d/description endef $(eval $(call KernelPackage,gpio-nct5104d)) + +define KernelPackage/sp5100_tco + SUBMENU:=$(OTHER_MENU) + TITLE:=SP5100 Watchdog Support + DEPENDS:=@TARGET_x86 + KCONFIG:=CONFIG_SP5100_TCO + FILES:=$(LINUX_DIR)/drivers/watchdog/sp5100_tco.ko + AUTOLOAD:=$(call AutoLoad,50,sp5100_tco,1) +endef + +define KernelPackage/sp5100_tco/description + Kernel module for the SP5100_TCO hardware watchdog. +endef + +$(eval $(call KernelPackage,sp5100_tco)) -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [RFC 5/6 v2] x86: Update the x86_64 kernel config
This adds the following changes to the x86_64 Kernel config: 1. Enables AES_x86_64, AEAD, and AES_NI_Intel. 2. Enables GPIO and GPIOLIB to match other targets. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/x86/64/config-default | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default index 646e773..609ff2d 100644 --- a/target/linux/x86/64/config-default +++ b/target/linux/x86/64/config-default @@ -50,7 +50,9 @@ CONFIG_CALGARY_IOMMU=y CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y CONFIG_CPU_RMAP=y CONFIG_CRC_T10DIF=y -# CONFIG_CRYPTO_AES_X86_64 is not set +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AES_X86_64=y +CONFIG_CRYPTO_AES_NI_INTEL=y # CONFIG_CRYPTO_BLOWFISH_X86_64 is not set # CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 is not set # CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 is not set @@ -91,6 +93,14 @@ CONFIG_GART_IOMMU=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_CPU=y CONFIG_GENERIC_PENDING_IRQ=y +CONFIG_GPIOLIB=y +# CONFIG_GPIO_104_IDIO_16 is not set +# CONFIG_GPIO_AMDPT is not set +# CONFIG_GPIO_F7188X is not set +# CONFIG_GPIO_INTEL_MID is not set +# CONFIG_GPIO_IT87 is not set +# CONFIG_GPIO_LYNXPOINT is not set +CONFIG_GPIO_SYSFS=y CONFIG_HAVE_ACPI_APEI=y CONFIG_HAVE_ACPI_APEI_NMI=y # CONFIG_HAVE_AOUT is not set -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH] base-files: ensure reset only works if an overlay exists
Forgive me as I forgot the v3 in the patch header. Previous patch discussion was at http://lists.infradead.org/pipermail/lede-dev/2016-October/003473.html - Chris Blake ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 2/3 v2] ar71xx: add mac partition to the MR12/MR16
On the stock Meraki Firmare for the MR12/MR16, a chunk of SPI space after u-boot-env is used to store the boards Mac address. Sadly as this was removed on any device already on OpenWRT/LEDE, moving forward a new, 64k partition named "mac" will be used to store the mac address for the device (which is the minimum size). This allows users to properly set the correct MAC, without editing the ART partition (which holds the same MAC for all devices). The reason the space is taken from kernel instead of rootfs is currently kernels are only 1.3MB, so that way we can leave the current rootfs space alone for users who fully utilize the available storage space. Once this partition is added to a device, you can set your MAC doing the following: mtd erase mac echo -n -e '\x00\x18\x0a\x33\x44\x55' > /dev/mtd5 sync && reboot Where 00:18:0a:33:44:55 is your MAC address. This was tested, and confirmed working on both the MR12 and MR16. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- .../linux/ar71xx/files/arch/mips/ath79/mach-mr12.c | 14 +++--- .../linux/ar71xx/files/arch/mips/ath79/mach-mr16.c | 22 +++--- target/linux/ar71xx/image/generic.mk | 4 ++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c index 12c9a1c..dc880c5 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr12.c @@ -42,8 +42,7 @@ #define MR12_WAN_PHYMASKBIT(4) -#define MR12_WMAC0_MAC_OFFSET 0x120c -#define MR12_CALDATA0_OFFSET0x1000 +#define MR12_CALDATA0_OFFSET0x21000 static struct gpio_led MR12_leds_gpio[] __initdata = { { @@ -90,8 +89,9 @@ static struct gpio_keys_button MR12_gpio_keys[] __initdata = { static void __init MR12_setup(void) { - u8 *mac = (u8 *) KSEG1ADDR(0xbfff); - + u8 *mac = (u8 *) KSEG1ADDR(0xbffd); + u8 wlan_mac[ETH_ALEN]; + ath79_register_mdio(0,0x0); ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); @@ -107,9 +107,9 @@ static void __init MR12_setup(void) ARRAY_SIZE(MR12_gpio_keys), MR12_gpio_keys); - ap91_pci_init(mac + MR12_CALDATA0_OFFSET, - mac + MR12_WMAC0_MAC_OFFSET); + ath79_init_mac(wlan_mac, mac, 1); + ap91_pci_init(mac + MR12_CALDATA0_OFFSET, wlan_mac); } -MIPS_MACHINE(ATH79_MACH_MR12, "MR12", "Meraki MR12", MR12_setup); \ No newline at end of file +MIPS_MACHINE(ATH79_MACH_MR12, "MR12", "Meraki MR12", MR12_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c index 9f08e3d..2897ee5 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr16.c @@ -42,10 +42,8 @@ #define MR16_WAN_PHYMASKBIT(0) -#define MR16_WMAC0_MAC_OFFSET 0x120c -#define MR16_WMAC1_MAC_OFFSET 0x520c -#define MR16_CALDATA0_OFFSET 0x1000 -#define MR16_CALDATA1_OFFSET 0x5000 +#define MR16_CALDATA0_OFFSET 0x21000 +#define MR16_CALDATA1_OFFSET 0x25000 static struct gpio_led MR16_leds_gpio[] __initdata = { { @@ -92,8 +90,10 @@ static struct gpio_keys_button MR16_gpio_keys[] __initdata = { static void __init MR16_setup(void) { - u8 *mac = (u8 *) KSEG1ADDR(0xbfff); - + u8 *mac = (u8 *) KSEG1ADDR(0xbffd); + u8 wlan0_mac[ETH_ALEN]; + u8 wlan1_mac[ETH_ALEN]; + ath79_register_mdio(0,0x0); ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); @@ -109,10 +109,10 @@ static void __init MR16_setup(void) ARRAY_SIZE(MR16_gpio_keys), MR16_gpio_keys); - ap94_pci_init(mac + MR16_CALDATA0_OFFSET, - mac + MR16_WMAC0_MAC_OFFSET, - mac + MR16_CALDATA1_OFFSET, - mac + MR16_WMAC1_MAC_OFFSET); + ath79_init_mac(wlan0_mac, mac, 1); + ath79_init_mac(wlan1_mac, mac, 2); + ap94_pci_init(mac + MR16_CALDATA0_OFFSET, wlan0_mac, + mac + MR16_CALDATA1_OFFSET, wlan1_mac); } -MIPS_MACHINE(ATH79_MACH_MR16, "MR16", "Meraki MR16", MR16_setup); \ No newline at end of file +MIPS_MACHINE(ATH79_MACH_MR16, "MR16", "Meraki MR16", MR16_setup); diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 04fed88..ee910af 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -102,7 +102,7 @@ define Device/mr12 DEVICE_PACKAGES := kmod-spi-gpio BOARDNAME = MR12 IMAGE_SIZE = 15744k - MTDPARTS = spi0.0:256k
[LEDE-DEV] [PATCH 1/3 v2] ar71xx: Move MR12 & MR16 from legacy to generic
This moves the Meraki MR12 and Meraki MR16 to the new generic target. Tested and verified working on both devices. Note that kernel/rootfs images are still generated. This is because they are used for the inital flashing process due to the fun pace at which UBoot erases/writes to SPI. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/ar71xx/image/generic.mk| 26 ++ target/linux/ar71xx/image/legacy-devices.mk | 12 target/linux/ar71xx/image/legacy.mk | 2 -- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 192f1a7..04fed88 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -97,6 +97,32 @@ define Device/gl-mifi endef TARGET_DEVICES += gl-mifi +define Device/mr12 + DEVICE_TITLE := Meraki MR12 + DEVICE_PACKAGES := kmod-spi-gpio + BOARDNAME = MR12 + IMAGE_SIZE = 15744k + MTDPARTS = spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x8(firmware) + IMAGE/kernel.bin = append-kernel + IMAGE/rootfs.bin = append-rootfs | pad-rootfs + IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | pad-to 13440k | append-kernel | check-size (IMAGE_SIZE) + IMAGES := kernel.bin rootfs.bin sysupgrade.bin +endef +TARGET_DEVICES += mr12 + +define Device/mr16 + DEVICE_TITLE := Meraki MR16 + DEVICE_PACKAGES := kmod-spi-gpio + BOARDNAME = MR16 + IMAGE_SIZE = 15744k + MTDPARTS = spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x8(firmware) + IMAGE/kernel.bin = append-kernel + IMAGE/rootfs.bin = append-rootfs | pad-rootfs + IMAGE/sysupgrade.bin = append-rootfs | pad-rootfs | pad-to 13440k | append-kernel | check-size (IMAGE_SIZE) + IMAGES := kernel.bin rootfs.bin sysupgrade.bin +endef +TARGET_DEVICES += mr16 + define Device/dr531 DEVICE_TITLE := Wallys DR531 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 diff --git a/target/linux/ar71xx/image/legacy-devices.mk b/target/linux/ar71xx/image/legacy-devices.mk index 2af7598..8522f9e 100644 --- a/target/linux/ar71xx/image/legacy-devices.mk +++ b/target/linux/ar71xx/image/legacy-devices.mk @@ -185,18 +185,6 @@ define LegacyDevice/HORNETUBx2 endef LEGACY_DEVICES += HORNETUBx2 -define LegacyDevice/MR12 - DEVICE_TITLE := Meraki MR12 - DEVICE_PACKAGES := kmod-spi-gpio -endef -LEGACY_DEVICES += MR12 - -define LegacyDevice/MR16 - DEVICE_TITLE := Meraki MR16 - DEVICE_PACKAGES := kmod-spi-gpio -endef -LEGACY_DEVICES += MR16 - define LegacyDevice/PB92 DEVICE_TITLE := Atheros PB92 reference board DEVICE_PACKAGES := kmod-usb-core kmod-usb2 diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index 14de229..5aff130 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -271,8 +271,6 @@ ew-dorin_mtdlayout_16M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),16000k(fir f9k1115v2_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),14464k(rootfs),1408k(kernel),64k(nvram)ro,64k(envram)ro,64k(art)ro,15872k@0x5(firmware) dlrtdev_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64k(caldata)ro,640k(certs),960k(unknown)ro,64k@0x7f(caldata_copy) dlrtdev_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7168k(firmware),640k(certs),64k(caldata)ro,64k@0x66(caldata_orig),6208k@0x5(firmware_orig) -mr12_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x8(firmware) -mr16_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,256k(u-boot-env)ro,13440k(rootfs),2304k(kernel),128k(art)ro,15744k@0x8(firmware) pb92_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs),896k(kernel),64k(nvram),64k(art)ro,3648k@0x5(firmware) planex_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),128k(art)ro ubntxm_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7552k(firmware),256k(cfg)ro,64k(EEPROM)ro -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 3/3 v2] ar71xx: Remove switch config for the MR12/MR16
These boards do not have a switch, so they should have never been added to this file in the first place. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- .../ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration index ee8f63b..c6b91b7 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration @@ -61,8 +61,6 @@ dir-615-c1|\ dir-615-e1|\ dir-615-e4|\ ja76pf|\ -mr-12|\ -mr-16|\ rb-750|\ rb-751|\ tew-632brp|\ -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH v2] base-files: ensure reset only works if an overlay exists
Hey Rafal, I agree that would work in terms of functionality, but the issue with that logic is if you hold the button over 5 seconds, the system LED will start flashing (as expected) but then no action is taken on the board. The reason for my logic change was just to ensure the board would reboot in that case. Regards, Chris Blake On Thu, Oct 20, 2016 at 1:05 AM, Rafał Miłecki <zaj...@gmail.com> wrote: > On 20 October 2016 at 07:37, Chris Blake <chrisrblak...@gmail.com> wrote: >> On Thu, Oct 20, 2016 at 12:29 AM, Rafał Miłecki <zaj...@gmail.com> wrote: >>> On 20 October 2016 at 05:23, Chris Blake <chrisrblak...@gmail.com> wrote: >>>> diff --git a/package/base-files/files/etc/rc.button/reset >>>> b/package/base-files/files/etc/rc.button/reset >>>> index c6dc7cf..fab9a6c 100755 >>>> --- a/package/base-files/files/etc/rc.button/reset >>>> +++ b/package/base-files/files/etc/rc.button/reset >>>> @@ -11,15 +11,16 @@ timeout) >>>> set_state failsafe >>>> ;; >>>> released) >>>> - if [ "$SEEN" -lt 1 ] >>>> + OVERLAY="$( grep ' /overlay ' /proc/mounts )" >>>> + if [ "$SEEN" -gt 5 -a -n "$OVERLAY" ] >>>> + then >>>> + echo "FACTORY RESET" > /dev/console >>>> + jffs2reset -y && reboot & >>>> + elif [ "$SEEN" ] >>>> then >>>> echo "REBOOT" > /dev/console >>>> sync >>>> reboot >>>> - elif [ "$SEEN" -gt 5 ] >>>> - then >>>> - echo "FACTORY RESET" > /dev/console >>>> - jffs2reset -y && reboot & >>>> fi >>>> ;; >>>> esac >>> >>> Before: >>> if $SEEN < 1 => reboot >>> if $SEEN > 5 => factory >>> >>> After >>> if $SEEN > 5 => factory >>> else => reboot >>> >>> Can you see that changed behavior now? >> >> Rafal, >> >> Indeed I do. If you have a better idea for implementation I am all >> ears on feedback to resolve this bug. > > Don't rework this script so much, just add: > OVERLAY="$( grep ' /overlay ' /proc/mounts )" > as you did and replace: > elif [ "$SEEN" -gt 5 ] > with: > elif [ "$SEEN" -gt 5 -a -n "$OVERLAY" ] ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH v2] base-files: ensure reset only works if an overlay exists
On Thu, Oct 20, 2016 at 12:29 AM, Rafał Miłecki <zaj...@gmail.com> wrote: > On 20 October 2016 at 05:23, Chris Blake <chrisrblak...@gmail.com> wrote: >> diff --git a/package/base-files/files/etc/rc.button/reset >> b/package/base-files/files/etc/rc.button/reset >> index c6dc7cf..fab9a6c 100755 >> --- a/package/base-files/files/etc/rc.button/reset >> +++ b/package/base-files/files/etc/rc.button/reset >> @@ -11,15 +11,16 @@ timeout) >> set_state failsafe >> ;; >> released) >> - if [ "$SEEN" -lt 1 ] >> + OVERLAY="$( grep ' /overlay ' /proc/mounts )" >> + if [ "$SEEN" -gt 5 -a -n "$OVERLAY" ] >> + then >> + echo "FACTORY RESET" > /dev/console >> + jffs2reset -y && reboot & >> + elif [ "$SEEN" ] >> then >> echo "REBOOT" > /dev/console >> sync >> reboot >> - elif [ "$SEEN" -gt 5 ] >> - then >> - echo "FACTORY RESET" > /dev/console >> - jffs2reset -y && reboot & >> fi >> ;; >> esac > > Before: > if $SEEN < 1 => reboot > if $SEEN > 5 => factory > > After > if $SEEN > 5 => factory > else => reboot > > Can you see that changed behavior now? Rafal, Indeed I do. If you have a better idea for implementation I am all ears on feedback to resolve this bug. Regards, Chris Blake On Thu, Oct 20, 2016 at 12:29 AM, Rafał Miłecki <zaj...@gmail.com> wrote: > On 20 October 2016 at 05:23, Chris Blake <chrisrblak...@gmail.com> wrote: >> diff --git a/package/base-files/files/etc/rc.button/reset >> b/package/base-files/files/etc/rc.button/reset >> index c6dc7cf..fab9a6c 100755 >> --- a/package/base-files/files/etc/rc.button/reset >> +++ b/package/base-files/files/etc/rc.button/reset >> @@ -11,15 +11,16 @@ timeout) >> set_state failsafe >> ;; >> released) >> - if [ "$SEEN" -lt 1 ] >> + OVERLAY="$( grep ' /overlay ' /proc/mounts )" >> + if [ "$SEEN" -gt 5 -a -n "$OVERLAY" ] >> + then >> + echo "FACTORY RESET" > /dev/console >> + jffs2reset -y && reboot & >> + elif [ "$SEEN" ] >> then >> echo "REBOOT" > /dev/console >> sync >> reboot >> - elif [ "$SEEN" -gt 5 ] >> - then >> - echo "FACTORY RESET" > /dev/console >> - jffs2reset -y && reboot & >> fi >> ;; >> esac > > Before: > if $SEEN < 1 => reboot > if $SEEN > 5 => factory > > After > if $SEEN > 5 => factory > else => reboot > > Can you see that changed behavior now? ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH v2] base-files: ensure reset only works if an overlay exists
Currently the reset script will try to run jffs2reset on boards that are running a rw ext4 or other rootfs, which will then cause jffs2reset to fail and the board to never reboot. This change ensures that jffs2reset is only ran if an overlay is mounted, and disables the "reset" feature if no /overlay is mounted on the device. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- package/base-files/files/etc/rc.button/reset | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/package/base-files/files/etc/rc.button/reset b/package/base-files/files/etc/rc.button/reset index c6dc7cf..fab9a6c 100755 --- a/package/base-files/files/etc/rc.button/reset +++ b/package/base-files/files/etc/rc.button/reset @@ -11,15 +11,16 @@ timeout) set_state failsafe ;; released) - if [ "$SEEN" -lt 1 ] + OVERLAY="$( grep ' /overlay ' /proc/mounts )" + if [ "$SEEN" -gt 5 -a -n "$OVERLAY" ] + then + echo "FACTORY RESET" > /dev/console + jffs2reset -y && reboot & + elif [ "$SEEN" ] then echo "REBOOT" > /dev/console sync reboot - elif [ "$SEEN" -gt 5 ] - then - echo "FACTORY RESET" > /dev/console - jffs2reset -y && reboot & fi ;; esac -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH] base-files: ensure reset only works if an overlay exists
Bastian, I will get that revised and push out a v2 of this patch. Thanks. On Wed, Oct 19, 2016 at 3:04 PM, Bastian Bittorf <b...@npl.de> wrote: > * Chris Blake <chrisrblak...@gmail.com> [19.10.2016 21:57]: >> + OVERLAY="$(cat /proc/mounts | grep ' /overlay ' 2>/dev/null)" > > please change to: > OVERLAY="$( grep ' /overlay ' /proc/mounts )" > > bye, bastian ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH] base-files: ensure reset only works if an overlay exists
Rafal, I am not sure I see the issue you are mentioning. The patch's goal is to disable the "reset" feature for devices that do not have an overlay, and instead just reboot the device. This patch does that, and was tested on an ar71xx and x86_64 ext4 platform. Regards, Chris Blake On Wed, Oct 19, 2016 at 4:33 PM, Rafał Miłecki <zaj...@gmail.com> wrote: > On 19 October 2016 at 16:54, Chris Blake <chrisrblak...@gmail.com> wrote: >> Currently the reset script will try to run jffs2reset on boards that are >> running a rw ext4 or other rootfs, which will then cause jffs2reset to >> fail and the board to never reboot. This change ensures that jffs2reset >> is only ran if an overlay is mounted. >> >> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> >> --- >> package/base-files/files/etc/rc.button/reset | 11 ++- >> 1 file changed, 6 insertions(+), 5 deletions(-) >> >> diff --git a/package/base-files/files/etc/rc.button/reset >> b/package/base-files/files/etc/rc.button/reset >> index c6dc7cf..fab9a6c 100755 >> --- a/package/base-files/files/etc/rc.button/reset >> +++ b/package/base-files/files/etc/rc.button/reset >> @@ -11,15 +11,16 @@ timeout) >> set_state failsafe >> ;; >> released) >> - if [ "$SEEN" -lt 1 ] >> + OVERLAY="$(cat /proc/mounts | grep ' /overlay ' 2>/dev/null)" >> + if [ "$SEEN" -gt 5 -a -n "$OVERLAY" ] >> + then >> + echo "FACTORY RESET" > /dev/console >> + jffs2reset -y && reboot & >> + elif [ "$SEEN" ] >> then >> echo "REBOOT" > /dev/console >> sync >> reboot >> - elif [ "$SEEN" -gt 5 ] >> - then >> - echo "FACTORY RESET" > /dev/console >> - jffs2reset -y && reboot & >> fi >> ;; >> esac > > It seems to me you just changed behavior for pressing button for time > between 1 and 5 seconds. Your commit message doesn't state you wanted > to do that and I don't think we should. ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 1/1] package/utils: Add beep package
This adds the "beep" binary as a package to LEDE. Note that busybox does have a beep option that can be built in, but it is disabled by default on all LEDE targets. This package gives users the option to manually install beep at a later time, or include it as a default for a device profile. This was based on the older PR at https://lists.openwrt.org/pipermail /openwrt-devel/2009-November/005226.html Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- package/utils/beep/Makefile | 50 + 1 file changed, 50 insertions(+) create mode 100644 package/utils/beep/Makefile diff --git a/package/utils/beep/Makefile b/package/utils/beep/Makefile new file mode 100644 index 000..b9bb4d80 --- /dev/null +++ b/package/utils/beep/Makefile @@ -0,0 +1,50 @@ +# +# Copyright (C) 2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=beep +PKG_REV:=0d790fa45777896749a885c3b93b2c1476d59f20 +PKG_VERSION:=1.3 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://github.com/johnath/beep.git +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=$(PKG_REV) + +PKG_LICENSE:=GPL +PKG_LICENSE_FILES:= + +include $(INCLUDE_DIR)/package.mk + +define Package/beep + SECTION:=sound + CATEGORY:=Sound + DEPENDS:=+kmod-pcspkr + TITLE:=Play beep sounds through a PC speaker + URL:=http://johnath.com/beep/README +endef + +define Package/beep/description + This program plays beeps through the PC speaker +endef + +CONFIGURE_ARGS += \ + --enable-static \ + --enable-shared + +MAKE_FLAGS += \ + CFLAGS="$(TARGET_CFLAGS)" + +define Package/beep/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/beep $(1)/usr/bin +endef + +$(eval $(call BuildPackage,beep)) -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [RFC 1/1] x86: Add support for the PC Engines APU2 Board
Hey Stijn, Thanks for the feedback, will get this fixed up for the next RFC as well. Please keep the feedback coming. :) - Chris B On Sat, Oct 15, 2016 at 9:41 AM, Stijn Tintel <st...@linux-ipv6.be> wrote: > On 14-10-16 20:19, Chris Blake wrote: >> The following patch adds support for the PC Engines APU2 Embedded Board >> as a profile under the X86_64 target. More information on this board can >> be found at www.pcengines.ch/apu2c4.htm >> >> Note that this patch is a part of an RFC, and should not be merged yet. >> >> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> >> --- >> target/linux/x86/64/config-default | 12 + >> target/linux/x86/64/profiles/001-PCEngines.mk | 20 + >> target/linux/x86/base-files/etc/board.d/01_leds| 22 ++ >> target/linux/x86/base-files/etc/board.d/02_network | 26 ++ >> target/linux/x86/base-files/etc/diag.sh| 37 ++ >> target/linux/x86/base-files/lib/x86.sh | 13 + >> target/linux/x86/config-4.4| 1 + >> .../linux/x86/files/drivers/gpio/gpio-nct5104d.c | 432 >> + >> target/linux/x86/files/drivers/leds/leds-apu2.c| 371 ++ >> target/linux/x86/modules.mk| 36 ++ >> .../x86/patches-4.4/800-add-apu2-led-driver.patch | 29 ++ >> .../801-sp5100_tco-add-apu2-support.patch | 91 + >> .../patches-4.4/802-add-nct5104d-gpio-driver.patch | 27 ++ >> 13 files changed, 1117 insertions(+) >> create mode 100644 target/linux/x86/64/profiles/001-PCEngines.mk >> create mode 100755 target/linux/x86/base-files/etc/board.d/01_leds >> create mode 100755 target/linux/x86/base-files/etc/board.d/02_network >> create mode 100755 target/linux/x86/base-files/etc/diag.sh >> create mode 100755 target/linux/x86/base-files/lib/x86.sh >> create mode 100644 target/linux/x86/files/drivers/gpio/gpio-nct5104d.c >> create mode 100644 target/linux/x86/files/drivers/leds/leds-apu2.c >> create mode 100644 target/linux/x86/modules.mk >> create mode 100644 >> target/linux/x86/patches-4.4/800-add-apu2-led-driver.patch >> create mode 100644 >> target/linux/x86/patches-4.4/801-sp5100_tco-add-apu2-support.patch >> create mode 100644 >> target/linux/x86/patches-4.4/802-add-nct5104d-gpio-driver.patch > Please use the correct prefix for patches, see > https://git.lede-project.org/?p=source.git;a=blob;f=target/linux/generic/PATCHES > I would add the watchdog patches like this instead of squashing them, > created with git format-patch: > target/linux/generic/patches-4.4/097-0001-sp5100_tco-Add-AMD-Mullins-platform-support.patch > target/linux/generic/patches-4.4/097-0002-sp5100_tco-Add-AMD-Mullins-platform-support.patch > target/linux/generic/patches-4.4/097-0003-sp5100_tco-fix-the-device-check-for-SB800-and-later-chipsets.patch > target/linux/generic/patches-4.4/097-0004-watchdog-sp5100_tco-properly-check-for-new-register-.patch > > Thanks, > Stijn ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [RFC 0/1] x86: Add support for the PC Engines APU2 Board
This is an RFC to port the PC Engines APU2 board to LEDE. Currently this is based on my unofficial repo at https://github.com/riptidewave93/LEDE-APU2 and after a discussion on the lede-dev IRC on the best plan of action, which was to move this device to a profile under x86_64. Things Working: - board detection - USB ports - LED/Button support - ath9k and ath10k - to support both wireless cards sold via PC Engines - SP5100 Watchdog - NCT5104D GPIO Driver Not Working: - AES-NI CPU Acceleration - PC Buzzer Default Packages: - flashrom - BIOS Upgrades - lm-sensors - Temp Monitoring - wpad-mini - Wireless AP support - hwclock - RTC support Things that still need working out: - AES-NI Kernel Support - Profile Specific Images - So far the ./image/Makefile does not seem to support 'profiles'. This will need to be fixed, so APU2 & Generic images can build without merging. - HWMon & ath10k - ath10k requires hwmon, but the module fails to build if hwmon was built as a module. Because if this, it's added to the kernel config. Is there a better way to do this, or a way around this problem? - pc buzzer/beep - Busybox has beep support, but I didn't find a way to build it without changing the default BusyBox config for all targets. Maybe "beep" should also be added as a standalone package? https://lists.openwrt.org/pipermail/openwrt-devel/2009-November/005227.html - x86_64 kernel config - Besudes hwmon, GPIO support had to be added. Should this be done here, or in the root target kernel config like other targets? Also, DEVMEM was added for flashrom. Is this an issue, or would it be OK to keep this in? - Default Packages - Currently the "goal" of my unofficial port was to make sure all features of the device were supported via my image. Is this the path LEDE wants to take, or should it be more of a "minimal" approach? AKA, no packages/ath*k If there are any comments, suggestions, or visible improvements please let me know/reply with some patches. Cc: Jo-Philipp Wich <j...@mein.io> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> Chris Blake (1): x86: Add support for the PC Engines APU2 Board target/linux/x86/64/config-default | 12 + target/linux/x86/64/profiles/001-PCEngines.mk | 20 + target/linux/x86/base-files/etc/board.d/01_leds| 22 ++ target/linux/x86/base-files/etc/board.d/02_network | 26 ++ target/linux/x86/base-files/etc/diag.sh| 37 ++ target/linux/x86/base-files/lib/x86.sh | 13 + target/linux/x86/config-4.4| 1 + .../linux/x86/files/drivers/gpio/gpio-nct5104d.c | 432 + target/linux/x86/files/drivers/leds/leds-apu2.c| 371 ++ target/linux/x86/modules.mk| 36 ++ .../x86/patches-4.4/800-add-apu2-led-driver.patch | 29 ++ .../801-sp5100_tco-add-apu2-support.patch | 91 + .../patches-4.4/802-add-nct5104d-gpio-driver.patch | 27 ++ 13 files changed, 1117 insertions(+) create mode 100644 target/linux/x86/64/profiles/001-PCEngines.mk create mode 100755 target/linux/x86/base-files/etc/board.d/01_leds create mode 100755 target/linux/x86/base-files/etc/board.d/02_network create mode 100755 target/linux/x86/base-files/etc/diag.sh create mode 100755 target/linux/x86/base-files/lib/x86.sh create mode 100644 target/linux/x86/files/drivers/gpio/gpio-nct5104d.c create mode 100644 target/linux/x86/files/drivers/leds/leds-apu2.c create mode 100644 target/linux/x86/modules.mk create mode 100644 target/linux/x86/patches-4.4/800-add-apu2-led-driver.patch create mode 100644 target/linux/x86/patches-4.4/801-sp5100_tco-add-apu2-support.patch create mode 100644 target/linux/x86/patches-4.4/802-add-nct5104d-gpio-driver.patch -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH v2 0/3] Add support for Cisco Meraki Z1
This patch group adds support for the Cisco Meraki Z1 Teleworker Gateway unit. More info can be found at https://wiki.openwrt.org/toh/meraki/z1 V2 changes, as requested: * Move owl-loader to package/kernel/linux/modules/other V1 discussions are at http://lists.infradead.org/pipermail/lede-dev/2016-September/002611.html Cc: Christian Lamparter Signed-off-by: Chris Blake Chris Blake (1): ar71xx: add support for Cisco Meraki Z1 Cloud Managed Teleworker Gateway Christian Lamparter (2): firmware-utils mkmerakifw-old: firmware generator for Z1 kernel: owl-loader for delayed Atheros ath9k fixup package/kernel/linux/modules/other.mk | 21 ++ target/linux/ar71xx/base-files/etc/board.d/01_leds | 4 + .../linux/ar71xx/base-files/etc/board.d/02_network | 6 + target/linux/ar71xx/base-files/etc/diag.sh | 3 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 20 ++ .../etc/uci-defaults/03_network-switchX-migration | 1 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 + .../base-files/lib/preinit/05_set_iface_mac_ar71xx | 4 + .../ar71xx/base-files/lib/upgrade/merakinand.sh| 61 +++- .../ar71xx/base-files/lib/upgrade/platform.sh | 6 +- target/linux/ar71xx/config-4.4 | 1 + .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt | 12 + target/linux/ar71xx/files/arch/mips/ath79/Makefile | 1 + .../linux/ar71xx/files/arch/mips/ath79/mach-z1.c | 164 + .../linux/ar71xx/files/arch/mips/ath79/machtypes.h | 1 + target/linux/ar71xx/image/nand.mk | 23 ++ .../818-MIPS-ath79-add-nu801-led-driver.patch | 2 +- .../linux/generic/files/drivers/misc/owl-loader.c | 246 ++ .../generic/patches-4.4/835-misc-owl_loader.patch | 31 ++ tools/firmware-utils/Makefile | 1 + tools/firmware-utils/src/mkmerakifw-old.c | 369 + 21 files changed, 961 insertions(+), 19 deletions(-) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-z1.c create mode 100644 target/linux/generic/files/drivers/misc/owl-loader.c create mode 100644 target/linux/generic/patches-4.4/835-misc-owl_loader.patch create mode 100644 tools/firmware-utils/src/mkmerakifw-old.c -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH v2 1/3] firmware-utils mkmerakifw-old: firmware generator for Z1
From: Christian Lamparter <chunk...@googlemail.com> This patch adds firmware generation tool for Cisco's Z1 Signed-off-by: Christian Lamparter <chunk...@googlemail.com> --- tools/firmware-utils/Makefile | 1 + tools/firmware-utils/src/mkmerakifw-old.c | 369 ++ 2 files changed, 370 insertions(+) create mode 100644 tools/firmware-utils/src/mkmerakifw-old.c diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index f4a5222..803ada4 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -74,6 +74,7 @@ define Host/Compile $(call cc,dgn3500sum) $(call cc,edimax_fw_header, -Wall) $(call cc,mkmerakifw sha1, -Wall) + $(call cc,mkmerakifw-old, -Wall) $(call cc,jcgimage, -lz -Wall) endef diff --git a/tools/firmware-utils/src/mkmerakifw-old.c b/tools/firmware-utils/src/mkmerakifw-old.c new file mode 100644 index 000..01b9b31 --- /dev/null +++ b/tools/firmware-utils/src/mkmerakifw-old.c @@ -0,0 +1,369 @@ +/* + * Copyright (C) 2015 Thomas Hebb <tommyh...@gmail.com> + * Copyright (C) 2016 Christian Lamparter <chunk...@googlemail.com> + * + * The format of the header this tool generates was first documented by + * Chris Blake in a shell script of the + * same purpose. I have created this reimplementation at his request. The + * original script can be found at: + * <https://github.com/riptidewave93/meraki-partbuilder> + * + * Support for the old header format, which is used by the Cisco Z1 AP + * has been reverse engineered from the nandloader's nand_load_bk function. + * The original code is part of Cisco's GPL code and can be found at: + * <https://github.com/riptidewave93/meraki-linux> + * + * 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. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PADDING_BYTE 0xff + +#define HDR_LENGTH 0x0020 +#define HDR_OFF_MAGIC1 0 +#define HDR_OFF_LOAD_ADDR 4 +#define HDR_OFF_IMAGELEN 8 +#define HDR_OFF_ENTRY 12 +#define HDR_OFF_CHECKSUM 16 +#define HDR_OFF_FILLER020 +#define HDR_OFF_FILLER124 +#define HDR_OFF_FILLER228 + +struct board_info { + char *id; + char *description; + uint32_t magic; + uint32_t imagelen; + uint32_t load_addr; + uint32_t entry; +}; + +/* + * Globals + */ +static char *progname; +static bool strip_padding; + +static char *board_id; +static const struct board_info *board; + +static const struct board_info boards[] = { + { + .id = "z1", + .description= "Meraki Z1 Access Point", + .magic = 0x4d495053, + .imagelen = 0x007e, + .load_addr = 0x8006, + .entry = 0x8006 + }, { + /* terminating entry */ + } +}; + +/* + * Message macros + */ +#define ERR(fmt, ...) do { \ + fflush(0); \ + fprintf(stderr, "[%s] *** error: " fmt "\n", \ + progname, ## __VA_ARGS__); \ +} while (0) + +#define ERRS(fmt, ...) do { \ + int save = errno; \ + fflush(0); \ + fprintf(stderr, "[%s] *** error: " fmt "\n", \ + progname, ## __VA_ARGS__, strerror(save)); \ +} while (0) + +static const struct board_info *find_board(const char *id) +{ + const struct board_info *ret; + const struct board_info *board; + + ret = NULL; + for (board = boards; board->id != NULL; board++) { + if (strcasecmp(id, board->id) == 0) { + ret = board; + break; + } + } + + return ret; +} + +static void usage(int status) +{ + FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout; + const struct board_info *board; + + fprintf(stream, "Usage: %s [OPTIONS...]\n", progname); + fprintf(stream, +"\n" +"Options:\n" +" -B create image for the board specified with \n" +" -iread kernel image from the file \n" +" -owrite output to the file \n" +" -s strip padding from the end of the image\n" +" -h show this screen\n" + ); + + fprintf(stream, "\nBoards:\n"); + for (board = boards; board->id != NULL; board++) + fprintf(stream, " %-16s%s\n", board->id, board->description); + + exit(status); +} + +static void writel(unsigned char *buf, size_t offset, uint32_t value) +{ + value = htobe32(value); + memcpy(
[LEDE-DEV] [PATCH 3/6] ar71xx: Add check-size when append-kernel is used
When append-kernel is used and a KERNEL_SIZE is defined, we need to make sure that our kernel fits within it's partition size. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/ar71xx/image/generic.mk | 4 ++-- target/linux/ar71xx/image/ubnt.mk| 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 10717cb..3aeff12 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -410,7 +410,7 @@ define Device/NBG6616 CMDLINE += mem=128M IMAGES := sysupgrade.bin KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 boot/vmlinux.lzma.uImage - IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size (IMAGE_SIZE) + IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | check-size $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size (IMAGE_SIZE) # We cannot currently build a factory image. It is the sysupgrade image # prefixed with a header (which is actually written into the MTD device). # The header is 2kiB and is filled with 0xff. The format seems to be: @@ -443,7 +443,7 @@ define Device/c-55 KERNEL_SIZE = 2048k IMAGE_SIZE = 15872k MTDPARTS = spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,2048k(kernel),13824k(rootfs),13824k(opt)ro,2624k(failsafe)ro,64k(art)ro,15872k@0x6(firmware) - IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size (IMAGE_SIZE) + IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | check-size $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size (IMAGE_SIZE) endef TARGET_DEVICES += c-55 diff --git a/target/linux/ar71xx/image/ubnt.mk b/target/linux/ar71xx/image/ubnt.mk index 99496f7..2d0d464 100644 --- a/target/linux/ar71xx/image/ubnt.mk +++ b/target/linux/ar71xx/image/ubnt.mk @@ -261,7 +261,7 @@ define Device/ubnt-uap-pro DEVICE_PROFILE := UBNT UAPPRO KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma | jffs2 kernel0 IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size (IMAGE_SIZE) + IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | check-size $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size (IMAGE_SIZE) IMAGE/factory.bin = $$(IMAGE/sysupgrade.bin) | mkubntimage2 endef -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 5/6] kirkwood: Add check-size when append-kernel is used
When append-kernel is used and a KERNEL_SIZE is defined, we need to make sure that our kernel fits within it's partition size. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/kirkwood/image/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 33eaa4f..92d32cb 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -59,7 +59,7 @@ define Device/linksys-audi FILESYSTEMS := squashfs PROFILES := Generic AUDI IMAGES += factory.bin - IMAGE/factory.bin := append-kernel (KERNEL_SIZE) | append-ubi + IMAGE/factory.bin := append-kernel (KERNEL_SIZE) | check-size $$(KERNEL_SIZE) | append-ubi endef define Device/linksys-viper @@ -68,7 +68,7 @@ define Device/linksys-viper FILESYSTEMS := squashfs PROFILES := Generic VIPER IMAGES += factory.bin - IMAGE/factory.bin := append-kernel (KERNEL_SIZE) | append-ubi + IMAGE/factory.bin := append-kernel (KERNEL_SIZE) | check-size $$(KERNEL_SIZE) | append-ubi endef define Image/BuildKernel/Template -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 1/6] apm821xx: Add default kernel size
Adding a default KERNEL_SIZE will ensure that we have an option for check-size when used on any future targets. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/apm821xx/image/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 607df06..7ab46f7 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -13,6 +13,7 @@ define Device/Default KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts) DEVICE_PROFILE := DEVICE_DTS := + KERNEL_SIZE := 2048k KERNEL_ENTRY := 0x KERNEL_LOADADDR := 0x DEVICE_DTS_DIR := ../dts -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 2/6] apm821xx: Add check-size when append-kernel is used
When append-kernel is used and a KERNEL_SIZE is defined, we need to make sure that our kernel fits within it's partition size. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/apm821xx/image/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 7ab46f7..cc145e3 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -158,8 +158,8 @@ define Device/WNDR4700 KERNEL_SIZE := 1920k KERNEL := dtb | kernel-bin | lzma | uImage lzma | pad-offset $$(BLOCKSIZE) 64 | append-fakerootfs KERNEL_INITRAMFS := kernel-bin | gzip | dtb | wndr4700-specialImage gzip - IMAGE/factory.img := create-uImage-dtb | append-kernel | pad-to 2M | append-ubi | \ - netgear-dni | check-size (IMAGE_SIZE) + IMAGE/factory.img := create-uImage-dtb | append-kernel | check-size $$(KERNEL_SIZE) | pad-to 2M | \ + append-ubi | netgear-dni | check-size (IMAGE_SIZE) IMAGE/sysupgrade.tar := sysupgrade-tar NETGEAR_BOARD_ID := WNDR4700 NETGEAR_HW_ID := 29763875+128+256 -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 4/6] ipq806x: Add check-size when append-kernel is used
When append-kernel is used and a KERNEL_SIZE is defined, we need to make sure that our kernel fits within it's partition size. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/ipq806x/image/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index daf910e..0fa881f 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -156,7 +156,7 @@ define Device/EA8500 PROFILES += $$(DEVICE_NAME) BOARD_NAME := ea8500 IMAGES := factory.bin sysupgrade.tar - IMAGE/factory.bin := append-kernel | pad-to {KERNEL_SIZE} | append-ubi + IMAGE/factory.bin := append-kernel | check-size $$(KERNEL_SIZE) | pad-to {KERNEL_SIZE} | append-ubi IMAGE/sysupgrade.tar := sysupgrade-tar DEVICE_TITLE := Linksys EA8500 DEVICE_PACKAGES := ath10k-firmware-qca99x0 -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 6/6] mvebu: Add check-size when append-kernel is used
When append-kernel is used and a KERNEL_SIZE is defined, we need to make sure that our kernel fits within it's partition size. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/mvebu/image/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index 7900fb9..b251834 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -72,7 +72,7 @@ endef define Device/UBI-factory $(Device/UBI) IMAGES += factory.img - IMAGE/factory.img := append-kernel (KERNEL_SIZE) | append-ubi | pad-to (PAGESIZE) + IMAGE/factory.img := append-kernel (KERNEL_SIZE) | check-size $$(KERNEL_SIZE) | append-ubi | pad-to (PAGESIZE) endef define Device/NAND-128K -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH] ar71xx: add check-size when append-kernel is used
@Mathias, Just to make sure, is check-size (IMAGE_SIZE) also affected by this bug as well? If so, let me know and I can rebase this patch again later tonight to fix that as well. - Chris Blake ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH] ar71xx: Fix sysupgrade for the Airtight Networks C-55
On Sun, Sep 11, 2016 at 10:40 AM, Chris Blake <chrisrblak...@gmail.com> wrote: > It appears that (KERNEL_SIZE) was not passing to append-kernel, > causing sysupgrade images to brick units due to the invalid rootfs > offset. This is fixed by removing the 2 extra $$'s in front of the > variables. Additionally, check-size was added to ensure that we don't > have a kernel larger than our partition. > > Before: kernel@0x0,rootfs@0x13EDF8 > After: kernel@0x0,rootfs@0x20 > > Signed-off-by: Chris Blake <chrisrblak...@gmail.com> > --- > target/linux/ar71xx/image/generic.mk | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/target/linux/ar71xx/image/generic.mk > b/target/linux/ar71xx/image/generic.mk > index bd92a84..5144334 100644 > --- a/target/linux/ar71xx/image/generic.mk > +++ b/target/linux/ar71xx/image/generic.mk > @@ -443,7 +443,7 @@ define Device/c-55 >KERNEL_SIZE = 2048k >IMAGE_SIZE = 15872k >MTDPARTS = > spi0.0:256k(u-boot)ro,128k(u-boot-env)ro,2048k(kernel),13824k(rootfs),13824k(opt)ro,2624k(failsafe)ro,64k(art)ro,15872k@0x6(firmware) > - IMAGE/sysupgrade.bin = append-kernel (KERNEL_SIZE) | append-rootfs | > pad-rootfs | check-size (IMAGE_SIZE) > + IMAGE/sysupgrade.bin = append-kernel $$(KERNEL_SIZE) | check-size > $$(KERNEL_SIZE) | append-rootfs | pad-rootfs | check-size $$(IMAGE_SIZE) > endef > > TARGET_DEVICES += c-55 > -- > 2.7.4 > Additionally, it appears that other devices like the ZyXEL NBG6616 may be affected by this. - Chris Blake ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 0/3] Add support for Cisco Meraki Z1
This patch group adds support for the Cisco Meraki Z1 Teleworker Gateway unit. More info can be found at https://wiki.openwrt.org/toh/meraki/z1 Cc: Christian Lamparter <chunk...@googlemail.com> Signed-off-by: Chris Blake <chrisrblak...@gmail.com> Chris Blake (1): ar71xx: add support for Cisco Meraki Z1 Cloud Managed Teleworker Gateway Christian Lamparter (2): firmware-utils mkmerakifw-old: firmware generator for Z1 kernel: owl-loader for delayed Atheros ath9k fixup package/kernel/owl-loader/Makefile | 59 package/kernel/owl-loader/src/Makefile | 1 + package/kernel/owl-loader/src/owl-loader.c | 246 ++ target/linux/ar71xx/base-files/etc/board.d/01_leds | 4 + .../linux/ar71xx/base-files/etc/board.d/02_network | 6 + target/linux/ar71xx/base-files/etc/diag.sh | 3 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 20 ++ .../etc/uci-defaults/03_network-switchX-migration | 1 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 + .../base-files/lib/preinit/05_set_iface_mac_ar71xx | 4 + .../ar71xx/base-files/lib/upgrade/merakinand.sh| 61 +++- .../ar71xx/base-files/lib/upgrade/platform.sh | 6 +- target/linux/ar71xx/config-4.4 | 1 + .../ar71xx/files/arch/mips/ath79/Kconfig.openwrt | 12 + target/linux/ar71xx/files/arch/mips/ath79/Makefile | 1 + .../linux/ar71xx/files/arch/mips/ath79/mach-z1.c | 164 + .../linux/ar71xx/files/arch/mips/ath79/machtypes.h | 1 + target/linux/ar71xx/image/nand.mk | 23 ++ .../818-MIPS-ath79-add-nu801-led-driver.patch | 2 +- tools/firmware-utils/Makefile | 1 + tools/firmware-utils/src/mkmerakifw-old.c | 369 + 21 files changed, 969 insertions(+), 19 deletions(-) create mode 100644 package/kernel/owl-loader/Makefile create mode 100644 package/kernel/owl-loader/src/Makefile create mode 100644 package/kernel/owl-loader/src/owl-loader.c create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-z1.c create mode 100644 tools/firmware-utils/src/mkmerakifw-old.c -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] [PATCH 2/3] kernel: owl-loader for delayed Atheros ath9k fixup
From: Christian LamparterSome devices (like the Cisco Meraki Z1 Cloud Managed Teleworker Gateway) need to be able to initialize the PCIe wifi device. Normally, this is done during the early stages of booting linux, because the necessary init code is read from the memory mapped SPI and passed to pci_enable_ath9k_fixup. However,this isn't possible for devices which have the init code for the Atheros chip stored on NAND in an UBI volume. Hence, this module can be used to initialze the chip when the user-space is ready to extract the init code. Martin Blumenstingl made a few fixes and added support for lantiq: kernel: owl-loader: add support for OWL emulation PCI devices kernel: owl-loader: don't re-scan the bus when ath9k_pci_fixup failed kernel: owl-loader: use dev_* instead of pr_* logging functions kernel: owl-loader: auto-generate the eeprom filename as fallback kernel: owl-loader: add a debug message when swapping the eeprom data kernel: owl-loader: add missing newlines in log messages kernel: owl-loader: add support for the lantiq platform These patches have been integrated. Thanks! Signed-off-by: Martin Blumenstingl Signed-off-by: Christian Lamparter --- package/kernel/owl-loader/Makefile | 59 +++ package/kernel/owl-loader/src/Makefile | 1 + package/kernel/owl-loader/src/owl-loader.c | 246 + 3 files changed, 306 insertions(+) create mode 100644 package/kernel/owl-loader/Makefile create mode 100644 package/kernel/owl-loader/src/Makefile create mode 100644 package/kernel/owl-loader/src/owl-loader.c diff --git a/package/kernel/owl-loader/Makefile b/package/kernel/owl-loader/Makefile new file mode 100644 index 000..b6c58de --- /dev/null +++ b/package/kernel/owl-loader/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (C) 2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=owl-loader +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define KernelPackage/owl-loader + SUBMENU:=Network Support + TITLE:=Owl loader for initializing Atheros PCI(e) Wifi chips + DEPENDS:=@PCI_SUPPORT +kmod-ath9k + FILES:=$(PKG_BUILD_DIR)/owl-loader.ko + AUTOLOAD:=$(call AutoProbe,owl-loader) + KCONFIG:= +endef + +define KernelPackage/owl-loader/description + Kernel module that helps to initialize certain Qualcomm + Atheros' PCI(e) Wifi chips, which have the init data + (which contains the PCI device ID for example) stored + together with the calibration data in the file system. + + This is necessary for devices like the Cisco Meraki Z1. +endef + +EXTRA_KCONFIG:= \ + CONFIG_OWL_LOADER=m + +EXTRA_CFLAGS:= \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(EXTRA_KCONFIG \ + $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG \ + +MAKE_OPTS:= \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + SUBDIRS="$(PKG_BUILD_DIR)" \ + EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ + $(EXTRA_KCONFIG) + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Build/Compile + $(MAKE) -C "$(LINUX_DIR)" \ + $(MAKE_OPTS) \ + modules +endef + +$(eval $(call KernelPackage,owl-loader)) diff --git a/package/kernel/owl-loader/src/Makefile b/package/kernel/owl-loader/src/Makefile new file mode 100644 index 000..6b58276 --- /dev/null +++ b/package/kernel/owl-loader/src/Makefile @@ -0,0 +1 @@ +obj-${CONFIG_OWL_LOADER} += owl-loader.o diff --git a/package/kernel/owl-loader/src/owl-loader.c b/package/kernel/owl-loader/src/owl-loader.c new file mode 100644 index 000..30340da --- /dev/null +++ b/package/kernel/owl-loader/src/owl-loader.c @@ -0,0 +1,246 @@ +/* + * Initialize Owl Emulation Devices + * + * Copyright (C) 2016 Christian Lamparter + * Copyright (C) 2016 Martin Blumenstingl + * + * 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. + * + * Some devices (like the Cisco Meraki Z1 Cloud Managed Teleworker Gateway) + * need to be able to initialize the PCIe wifi device. Normally, this is done + * during the early stages of booting linux, because the necessary init code + * is read from the memory mapped SPI and passed to pci_enable_ath9k_fixup. + * However,this isn't possible for devices which have the init code for the + * Atheros chip stored on NAND. Hence, this module can be used to initialze + * the chip when the user-space is ready to extract the init code. + */ +#include +#include +#include +#include +#include +#include
[LEDE-DEV] [PATCH 1/3] firmware-utils mkmerakifw-old: firmware generator for Z1
From: Christian Lamparter <chunk...@googlemail.com> This patch adds firmware generation tool for Cisco's Z1 Signed-off-by: Christian Lamparter <chunk...@googlemail.com> --- tools/firmware-utils/Makefile | 1 + tools/firmware-utils/src/mkmerakifw-old.c | 369 ++ 2 files changed, 370 insertions(+) create mode 100644 tools/firmware-utils/src/mkmerakifw-old.c diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index f4a5222..803ada4 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -74,6 +74,7 @@ define Host/Compile $(call cc,dgn3500sum) $(call cc,edimax_fw_header, -Wall) $(call cc,mkmerakifw sha1, -Wall) + $(call cc,mkmerakifw-old, -Wall) $(call cc,jcgimage, -lz -Wall) endef diff --git a/tools/firmware-utils/src/mkmerakifw-old.c b/tools/firmware-utils/src/mkmerakifw-old.c new file mode 100644 index 000..01b9b31 --- /dev/null +++ b/tools/firmware-utils/src/mkmerakifw-old.c @@ -0,0 +1,369 @@ +/* + * Copyright (C) 2015 Thomas Hebb <tommyh...@gmail.com> + * Copyright (C) 2016 Christian Lamparter <chunk...@googlemail.com> + * + * The format of the header this tool generates was first documented by + * Chris Blake in a shell script of the + * same purpose. I have created this reimplementation at his request. The + * original script can be found at: + * <https://github.com/riptidewave93/meraki-partbuilder> + * + * Support for the old header format, which is used by the Cisco Z1 AP + * has been reverse engineered from the nandloader's nand_load_bk function. + * The original code is part of Cisco's GPL code and can be found at: + * <https://github.com/riptidewave93/meraki-linux> + * + * 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. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PADDING_BYTE 0xff + +#define HDR_LENGTH 0x0020 +#define HDR_OFF_MAGIC1 0 +#define HDR_OFF_LOAD_ADDR 4 +#define HDR_OFF_IMAGELEN 8 +#define HDR_OFF_ENTRY 12 +#define HDR_OFF_CHECKSUM 16 +#define HDR_OFF_FILLER020 +#define HDR_OFF_FILLER124 +#define HDR_OFF_FILLER228 + +struct board_info { + char *id; + char *description; + uint32_t magic; + uint32_t imagelen; + uint32_t load_addr; + uint32_t entry; +}; + +/* + * Globals + */ +static char *progname; +static bool strip_padding; + +static char *board_id; +static const struct board_info *board; + +static const struct board_info boards[] = { + { + .id = "z1", + .description= "Meraki Z1 Access Point", + .magic = 0x4d495053, + .imagelen = 0x007e, + .load_addr = 0x8006, + .entry = 0x8006 + }, { + /* terminating entry */ + } +}; + +/* + * Message macros + */ +#define ERR(fmt, ...) do { \ + fflush(0); \ + fprintf(stderr, "[%s] *** error: " fmt "\n", \ + progname, ## __VA_ARGS__); \ +} while (0) + +#define ERRS(fmt, ...) do { \ + int save = errno; \ + fflush(0); \ + fprintf(stderr, "[%s] *** error: " fmt "\n", \ + progname, ## __VA_ARGS__, strerror(save)); \ +} while (0) + +static const struct board_info *find_board(const char *id) +{ + const struct board_info *ret; + const struct board_info *board; + + ret = NULL; + for (board = boards; board->id != NULL; board++) { + if (strcasecmp(id, board->id) == 0) { + ret = board; + break; + } + } + + return ret; +} + +static void usage(int status) +{ + FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout; + const struct board_info *board; + + fprintf(stream, "Usage: %s [OPTIONS...]\n", progname); + fprintf(stream, +"\n" +"Options:\n" +" -B create image for the board specified with \n" +" -iread kernel image from the file \n" +" -owrite output to the file \n" +" -s strip padding from the end of the image\n" +" -h show this screen\n" + ); + + fprintf(stream, "\nBoards:\n"); + for (board = boards; board->id != NULL; board++) + fprintf(stream, " %-16s%s\n", board->id, board->description); + + exit(status); +} + +static void writel(unsigned char *buf, size_t offset, uint32_t value) +{ + value = htobe32(value); + memcpy(
[LEDE-DEV] [PATCH] apm821xx: Fix initramfs image for the Meraki MR24
From: riptidewave93 <chrisrblak...@gmail.com> When gzip is used, our kernel is too large and this causes the ramdisk to be at the wrong offset. Fix by moving to lzma. Signed-off-by: Chris Blake <chrisrblak...@gmail.com> --- target/linux/apm821xx/image/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 100db56..8edd578 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -75,7 +75,7 @@ define Device/mr24 KERNEL_SIZE := 2048k IMAGE_SIZE := 8191k KERNEL := kernel-bin | lzma | uImage lzma | MerakiAdd-dtb | MerakiNAND - KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux | gzip | uImage gzip | MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | MerakiNAND + KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux | lzma | uImage lzma | MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | MerakiNAND IMAGE/sysupgrade.tar := sysupgrade-tar endef TARGET_DEVICES += mr24 -- 2.7.4 ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
Re: [LEDE-DEV] [PATCH v2 0/8] apm821xx: apm821xx platform
I can confirm that these patches work to make functional images for the Meraki MR24, as expected. Regards, Chris Blake On Wed, Jul 13, 2016 at 2:23 PM, Christian Lamparter <chunk...@googlemail.com> wrote: > This series was initially posted to OpenWRT List back in March, > April 2016 for inclusion [0]. The APM821XX target will add support for: > - Cisco Meraki MR24 > - Western Digital MyBook Live and MyBook Live Duo > - Netgear Centria N900 WNDR4700 / WNDR4720 > > The SATA backports were split into separate patches as they became too > big for the mailing list (also, it's a backport, so people might want > to skip it). The driver for the tc654 will be submitted to upstream. > > Information and pre-compiled images can be found in the project's > wiki [1]. > > [0] <https://lists.openwrt.org/pipermail/openwrt-devel/2016-April/040678.html> > [1] <https://github.com/chunkeey/apm82181-lede/wiki> > [2] <https://github.com/chunkeey/apm82181-lede/releases> > > BTW: LG N1T3 and the Monoprice 4-Bay NAS have an APM82181 too. > If someone has them and is interested, please feel free to > contact us. > > Chris Blake (2): > apm821xx: add support for the apm821xx device target > apm821xx: add support for the Cisco Meraki MR24 > > Christian Lamparter (6): > apm821xx: dw_dmac: backport fixes and cleanups from 4.7 > apm821xx: sata_dwc_460ex: backport fixes and cleanups from 4.7 > apm821xx: add support for the Western Digital MyBook Live Series > apm821xx: tc654: add driver for Microchip TC654/TC655 PWM fan > controllers > apm821xx: lm90 add thermal sensor interface support for device tree > apm821xx: add support for the Netgear Centria N900 WNDR4700/WNDR4720 > > include/target.mk |1 + > package/firmware/uPD72020x-firmware/Makefile | 45 + > package/kernel/linux/modules/other.mk |2 +- > target/linux/apm821xx/Makefile | 29 + > .../linux/apm821xx/base-files/etc/board.d/01_leds | 36 + > .../apm821xx/base-files/etc/board.d/02_network | 29 + > target/linux/apm821xx/base-files/etc/diag.sh | 45 + > .../etc/hotplug.d/firmware/10-ath9k-eeprom | 89 ++ > target/linux/apm821xx/base-files/etc/inittab |4 + > target/linux/apm821xx/base-files/lib/apm821xx.sh | 48 + > .../lib/preinit/03_preinit_do_apm821xx.sh |9 + > .../lib/preinit/05_set_iface_mac_apm821xx | 14 + > .../lib/preinit/05_set_preinit_iface_apm821xx |9 + > .../apm821xx/base-files/lib/preinit/79_move_config | 13 + > .../apm821xx/base-files/lib/upgrade/merakinand.sh | 65 + > .../apm821xx/base-files/lib/upgrade/platform.sh| 89 ++ > .../apm821xx/base-files/lib/upgrade/wdbook.sh | 36 + > target/linux/apm821xx/cisco/config-default | 15 + > target/linux/apm821xx/cisco/target.mk | 11 + > target/linux/apm821xx/config-4.4 | 331 + > target/linux/apm821xx/dts/MR24.dts | 433 ++ > target/linux/apm821xx/dts/apollo3g-duo.dts | 18 + > target/linux/apm821xx/dts/apollo3g.dts | 34 + > target/linux/apm821xx/dts/apollo3g.dtsi| 489 +++ > target/linux/apm821xx/dts/wndr4700.dts | 762 ++ > .../files/arch/powerpc/platforms/44x/wndr4700.c| 96 ++ > target/linux/apm821xx/image/Makefile | 247 > target/linux/apm821xx/image/mbl_boot.scr |6 + > target/linux/apm821xx/image/mbl_gen_hdd_img.sh | 27 + > .../linux/apm821xx/image/mbl_gen_recovery_tar.sh | 92 ++ > target/linux/apm821xx/mbl/config-default | 44 + > target/linux/apm821xx/mbl/target.mk| 11 + > target/linux/apm821xx/netgear/config-default | 45 + > target/linux/apm821xx/netgear/target.mk|8 + > ...to4xx-integrate-ppc4xx-rng-into-crypto4xx.patch | 507 +++ > .../002-powerpc_ibm_phy_add_ar8035.patch | 62 + > ...dd-transfer-termination-synchronization-s.patch | 143 ++ > ...ore-Introduce-new-universal-API-to-reques.patch | 345 + > ...dd-transfer-termination-synchronization-s.patch | 293 > .../patches-4.4/015-dmaengine-dw-fixed.patch | 1522 > > .../linux/apm821xx/patches-4.4/020-sata-dwc.patch | 1088 ++ > .../patches-4.4/030-usb-dwc2-endian-fix.patch | 95 ++ > .../200-add-meraki-mr24-ikarem-support.patch | 31 + > .../201-add-amcc-apollo3g-support.patch| 30 + > .../202-add-netgear-wndr4700-support.patch | 32 + > .../300-fix-atheros-nics-on-apm82181.patch | 51 + > .../patches-4.4/301-fix-memory-map-wndr4700
Re: [LEDE-DEV] Mirror Hosting Offer
Hello Jo, >Hi Chris, > >first off, thank you for the offer - we're always interested in hosting >donations :) > >In anticipation of the upcoming release we will need to increase the >number of build slaves to be able to process multiple branches in >parallel, for that a few instances with lots of disk space (1-2TB) would >be quite useful. > >Another thing which we could need help with is rsync mirrors in north >america and asia. > >How would such a donation from Digital Ocean look like in practice? Will >we basically get instances for free or will there be some kind of free >credits for a selected account? Plan was to help you get an account setup that would be powered by account credits, and if you ever run out you could just let us know and we could re-top it up. The main purpose for this would be for mirror hosting, but if you would like I can try to get approval for compile/compute node hosting as well. > >Regards, >Jo-Philipp Regards, Chris Blake DigitalOcean CloudOps On Mon, Jul 4, 2016 at 4:50 PM, Etienne Champetier <champetier.etie...@gmail.com> wrote: > Hi Chris, > > 2016-07-04 18:36 GMT+02:00 Chris Blake <cbl...@digitalocean.com>: >> Hello LEDE Project, >> >> I am reaching out to see if there is any interest for mirror hosting >> as my employer, DigitalOcean, would love to help support the LEDE >> Project. If you (LEDE Maintainers) have an account on our platform >> currently, or are interested in the offer, let me know. > > Your email was in my spam folder (on gmail) so I'm not sure everyone saw it. > > See this page to setup a mirror > https://www.lede-project.org/downloads.html > > Even better than mirror hosting would be to provide build VM i think > (or both :) ) > (but i will let "core" devs confirm that) > > Regards, > Etienne > >> >> Regards, >> Chris Blake >> DigitalOcean CloudOps >> ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev
[LEDE-DEV] Mirror Hosting Offer
Hello LEDE Project, I am reaching out to see if there is any interest for mirror hosting as my employer, DigitalOcean, would love to help support the LEDE Project. If you (LEDE Maintainers) have an account on our platform currently, or are interested in the offer, let me know. Regards, Chris Blake DigitalOcean CloudOps ___ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev