Re: [LEDE-DEV] [PATCH v2 1/8] apm821xx: add support for the apm821xx device target

2016-07-14 Thread Christian Lamparter
On Thursday, July 14, 2016 12:25:58 PM CEST Felix Fietkau wrote:
> On 2016-07-13 21:23, Christian Lamparter wrote:
> > From: Chris Blake 
> > 
> > This adds a new target for PowerPC APM82181 and APM82161
> > (464-based) boards, as well as adds support for the booke-wdt
> > watchdog package.
> > 
> > Signed-off-by: Chris Blake 
> > ---
> > [...]
> > diff --git a/package/kernel/linux/modules/other.mk 
> > b/package/kernel/linux/modules/other.mk
> > index a1fce48..ee1ee06 100644
> > --- a/package/kernel/linux/modules/other.mk
> > +++ b/package/kernel/linux/modules/other.mk
> > @@ -517,7 +517,7 @@ $(eval $(call KernelPackage,wdt-orion))
> >  define KernelPackage/booke-wdt
> >SUBMENU:=$(OTHER_MENU)
> >TITLE:=PowerPC Book-E Watchdog Timer
> > -  DEPENDS:=@(TARGET_mpc85xx||TARGET_ppc40x||TARGET_ppc44x)
> > +  DEPENDS:=@(TARGET_apm821xx||TARGET_mpc85xx||TARGET_ppc40x||TARGET_ppc44x)
> >KCONFIG:=CONFIG_BOOKE_WDT
> >FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/booke_wdt.ko
> >AUTOLOAD:=$(call AutoLoad,50,booke_wdt,1)
> Is there any reason to keep this as module? Unless there's a good reason
> to do it this way, I would like to make this built-in in the kernel
> config on all relevant targets and get rid of the kmod package.
Probably not [0]. I've made a patch which removes the module and
enables the watchdog in the kernel configs for the affected boards.

Regards,
Christian

[0] One issue I can think of: limited "kernel image" space in the
mtd partition. The only apm821xx board which could develop a problem
would be the WNDR4700. Netgear's uboot has fixed the kernel partition
to 2M and the lzma -9 compressed kernel image with 4.4.15 is 1.5M.
The MR24 has proper ubi support in the bootloader, so the kernel can
be as big as needed. For the WD MyBook Live Series this isn't a issue
either since the kernel is loaded from the HDD (boot partition, still
there is plenty of space there).
---
>From a7aaadfe488d806efe1f3aa58f45fe8c2afa3423 Mon Sep 17 00:00:00 2001
From: Christian Lamparter 
Date: Thu, 14 Jul 2016 16:22:51 +0200
Subject: [PATCH] ppc4xx: remove booke-wdt watchdog package

This patch gets rid of the booke watchdog kmod package.
Instead the affected boards will enable it in their
kernel configs.

Signed-off-by: Christian Lamparter 
---
 package/kernel/linux/modules/other.mk | 16 
 target/linux/apm821xx/Makefile|  2 +-
 target/linux/apm821xx/config-4.4  |  1 +
 target/linux/mpc85xx/Makefile |  3 +--
 target/linux/mpc85xx/config-4.4   |  1 +
 target/linux/ppc40x/config-3.18   |  1 +
 target/linux/ppc44x/config-3.18   |  1 +
 7 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/package/kernel/linux/modules/other.mk 
b/package/kernel/linux/modules/other.mk
index ee1ee06..3f7a3ee 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -514,22 +514,6 @@ endef
 $(eval $(call KernelPackage,wdt-orion))
 
 
-define KernelPackage/booke-wdt
-  SUBMENU:=$(OTHER_MENU)
-  TITLE:=PowerPC Book-E Watchdog Timer
-  DEPENDS:=@(TARGET_apm821xx||TARGET_mpc85xx||TARGET_ppc40x||TARGET_ppc44x)
-  KCONFIG:=CONFIG_BOOKE_WDT
-  FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/booke_wdt.ko
-  AUTOLOAD:=$(call AutoLoad,50,booke_wdt,1)
-endef
-
-define KernelPackage/booke-wdt/description
- Kernel module for PowerPC Book-E Watchdog Timer
-endef
-
-$(eval $(call KernelPackage,booke-wdt))
-
-
 define KernelPackage/rtc-ds1307
   SUBMENU:=$(OTHER_MENU)
   TITLE:=Dallas/Maxim DS1307 (and compatible) RTC support
diff --git a/target/linux/apm821xx/Makefile b/target/linux/apm821xx/Makefile
index f8246c4..d52829e 100644
--- a/target/linux/apm821xx/Makefile
+++ b/target/linux/apm821xx/Makefile
@@ -20,7 +20,7 @@ include $(INCLUDE_DIR)/target.mk
 KERNELNAME:=uImage
 
 DEFAULT_PACKAGES += \
-   kmod-leds-gpio kmod-booke-wdt kmod-i2c-core kmod-gpio-button-hotplug
+   kmod-leds-gpio kmod-i2c-core kmod-gpio-button-hotplug
 
 define Target/Description
Build images for AppliedMicro APM821xx based boards.
diff --git a/target/linux/apm821xx/config-4.4 b/target/linux/apm821xx/config-4.4
index 858952c..1515dda 100644
--- a/target/linux/apm821xx/config-4.4
+++ b/target/linux/apm821xx/config-4.4
@@ -36,6 +36,7 @@ CONFIG_AUDIT_ARCH=y
 CONFIG_BCH=y
 # CONFIG_BLUESTONE is not set
 CONFIG_BOOKE=y
+CONFIG_BOOKE_WDT=y
 CONFIG_BOUNCE=y
 # CONFIG_CANYONLANDS is not set
 # CONFIG_IKAREM is not set
diff --git a/target/linux/mpc85xx/Makefile b/target/linux/mpc85xx/Makefile
index a32be90..efd48d7 100644
--- a/target/linux/mpc85xx/Makefile
+++ b/target/linux/mpc85xx/Makefile
@@ -25,8 +25,7 @@ endif
 
 DEFAULT_PACKAGES += \
kmod-input-core kmod-input-gpio-keys kmod-button-hotplug \
-   kmod-leds-gpio kmod-booke-wdt \
-   swconfig kmod-ath9k wpad-mini
+   kmod-leds-gpio swconfig kmod-ath9k wpad-mini
 
 define Target/Description
Build images for the Freescale MPC85xx based boards.
diff --git a/target/linux/mpc85xx/config-4.4 b/t

Re: [LEDE-DEV] [PATCH v2 1/8] apm821xx: add support for the apm821xx device target

2016-07-14 Thread Felix Fietkau
On 2016-07-13 21:23, Christian Lamparter wrote:
> From: Chris Blake 
> 
> This adds a new target for PowerPC APM82181 and APM82161
> (464-based) boards, as well as adds support for the booke-wdt
> watchdog package.
> 
> Signed-off-by: Chris Blake 
> ---
>  include/target.mk  |   1 +
>  package/kernel/linux/modules/other.mk  |   2 +-
>  target/linux/apm821xx/Makefile |  28 ++
>  .../linux/apm821xx/base-files/etc/board.d/01_leds  |  17 +
>  .../apm821xx/base-files/etc/board.d/02_network |  19 +
>  target/linux/apm821xx/base-files/etc/diag.sh   |  33 ++
>  target/linux/apm821xx/base-files/etc/inittab   |   4 +
>  target/linux/apm821xx/base-files/lib/apm821xx.sh   |  36 ++
>  .../lib/preinit/03_preinit_do_apm821xx.sh  |   9 +
>  .../lib/preinit/05_set_preinit_iface_apm821xx  |   9 +
>  .../apm821xx/base-files/lib/upgrade/platform.sh|  58 +++
>  target/linux/apm821xx/config-4.4   | 327 +
>  target/linux/apm821xx/image/Makefile   |  22 +
>  ...to4xx-integrate-ppc4xx-rng-into-crypto4xx.patch | 507 
> +
>  .../300-fix-atheros-nics-on-apm82181.patch |  51 +++
>  .../701-powerpc_ibm_apm82181_phyclk_fix.patch  |  56 +++
>  16 files changed, 1178 insertions(+), 1 deletion(-)
>  create mode 100644 target/linux/apm821xx/Makefile
>  create mode 100755 target/linux/apm821xx/base-files/etc/board.d/01_leds
>  create mode 100755 target/linux/apm821xx/base-files/etc/board.d/02_network
>  create mode 100755 target/linux/apm821xx/base-files/etc/diag.sh
>  create mode 100644 target/linux/apm821xx/base-files/etc/inittab
>  create mode 100755 target/linux/apm821xx/base-files/lib/apm821xx.sh
>  create mode 100644 
> target/linux/apm821xx/base-files/lib/preinit/03_preinit_do_apm821xx.sh
>  create mode 100644 
> target/linux/apm821xx/base-files/lib/preinit/05_set_preinit_iface_apm821xx
>  create mode 100755 target/linux/apm821xx/base-files/lib/upgrade/platform.sh
>  create mode 100644 target/linux/apm821xx/config-4.4
>  create mode 100644 target/linux/apm821xx/image/Makefile
>  create mode 100644 
> target/linux/apm821xx/patches-4.4/001-crypto4xx-integrate-ppc4xx-rng-into-crypto4xx.patch
>  create mode 100644 
> target/linux/apm821xx/patches-4.4/300-fix-atheros-nics-on-apm82181.patch
>  create mode 100644 
> target/linux/apm821xx/patches-4.4/701-powerpc_ibm_apm82181_phyclk_fix.patch
> 
> diff --git a/include/target.mk b/include/target.mk
> index b5153ff..7fb298a 100644
> --- a/include/target.mk
> +++ b/include/target.mk
> @@ -208,6 +208,7 @@ ifeq ($(DUMP),1)
>  CPU_CFLAGS_8540:=-mcpu=8540
>  CPU_CFLAGS_405:=-mcpu=405
>  CPU_CFLAGS_440:=-mcpu=440
> +CPU_CFLAGS_464fp:=-mcpu=464fp
>endif
>ifeq ($(ARCH),sparc)
>  CPU_TYPE = sparc
> diff --git a/package/kernel/linux/modules/other.mk 
> b/package/kernel/linux/modules/other.mk
> index a1fce48..ee1ee06 100644
> --- a/package/kernel/linux/modules/other.mk
> +++ b/package/kernel/linux/modules/other.mk
> @@ -517,7 +517,7 @@ $(eval $(call KernelPackage,wdt-orion))
>  define KernelPackage/booke-wdt
>SUBMENU:=$(OTHER_MENU)
>TITLE:=PowerPC Book-E Watchdog Timer
> -  DEPENDS:=@(TARGET_mpc85xx||TARGET_ppc40x||TARGET_ppc44x)
> +  DEPENDS:=@(TARGET_apm821xx||TARGET_mpc85xx||TARGET_ppc40x||TARGET_ppc44x)
>KCONFIG:=CONFIG_BOOKE_WDT
>FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/booke_wdt.ko
>AUTOLOAD:=$(call AutoLoad,50,booke_wdt,1)
Is there any reason to keep this as module? Unless there's a good reason
to do it this way, I would like to make this built-in in the kernel
config on all relevant targets and get rid of the kmod package.

- Felix

___
Lede-dev mailing list
Lede-dev@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/lede-dev


[LEDE-DEV] [PATCH v2 1/8] apm821xx: add support for the apm821xx device target

2016-07-13 Thread Christian Lamparter
From: Chris Blake 

This adds a new target for PowerPC APM82181 and APM82161
(464-based) boards, as well as adds support for the booke-wdt
watchdog package.

Signed-off-by: Chris Blake 
---
 include/target.mk  |   1 +
 package/kernel/linux/modules/other.mk  |   2 +-
 target/linux/apm821xx/Makefile |  28 ++
 .../linux/apm821xx/base-files/etc/board.d/01_leds  |  17 +
 .../apm821xx/base-files/etc/board.d/02_network |  19 +
 target/linux/apm821xx/base-files/etc/diag.sh   |  33 ++
 target/linux/apm821xx/base-files/etc/inittab   |   4 +
 target/linux/apm821xx/base-files/lib/apm821xx.sh   |  36 ++
 .../lib/preinit/03_preinit_do_apm821xx.sh  |   9 +
 .../lib/preinit/05_set_preinit_iface_apm821xx  |   9 +
 .../apm821xx/base-files/lib/upgrade/platform.sh|  58 +++
 target/linux/apm821xx/config-4.4   | 327 +
 target/linux/apm821xx/image/Makefile   |  22 +
 ...to4xx-integrate-ppc4xx-rng-into-crypto4xx.patch | 507 +
 .../300-fix-atheros-nics-on-apm82181.patch |  51 +++
 .../701-powerpc_ibm_apm82181_phyclk_fix.patch  |  56 +++
 16 files changed, 1178 insertions(+), 1 deletion(-)
 create mode 100644 target/linux/apm821xx/Makefile
 create mode 100755 target/linux/apm821xx/base-files/etc/board.d/01_leds
 create mode 100755 target/linux/apm821xx/base-files/etc/board.d/02_network
 create mode 100755 target/linux/apm821xx/base-files/etc/diag.sh
 create mode 100644 target/linux/apm821xx/base-files/etc/inittab
 create mode 100755 target/linux/apm821xx/base-files/lib/apm821xx.sh
 create mode 100644 
target/linux/apm821xx/base-files/lib/preinit/03_preinit_do_apm821xx.sh
 create mode 100644 
target/linux/apm821xx/base-files/lib/preinit/05_set_preinit_iface_apm821xx
 create mode 100755 target/linux/apm821xx/base-files/lib/upgrade/platform.sh
 create mode 100644 target/linux/apm821xx/config-4.4
 create mode 100644 target/linux/apm821xx/image/Makefile
 create mode 100644 
target/linux/apm821xx/patches-4.4/001-crypto4xx-integrate-ppc4xx-rng-into-crypto4xx.patch
 create mode 100644 
target/linux/apm821xx/patches-4.4/300-fix-atheros-nics-on-apm82181.patch
 create mode 100644 
target/linux/apm821xx/patches-4.4/701-powerpc_ibm_apm82181_phyclk_fix.patch

diff --git a/include/target.mk b/include/target.mk
index b5153ff..7fb298a 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -208,6 +208,7 @@ ifeq ($(DUMP),1)
 CPU_CFLAGS_8540:=-mcpu=8540
 CPU_CFLAGS_405:=-mcpu=405
 CPU_CFLAGS_440:=-mcpu=440
+CPU_CFLAGS_464fp:=-mcpu=464fp
   endif
   ifeq ($(ARCH),sparc)
 CPU_TYPE = sparc
diff --git a/package/kernel/linux/modules/other.mk 
b/package/kernel/linux/modules/other.mk
index a1fce48..ee1ee06 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -517,7 +517,7 @@ $(eval $(call KernelPackage,wdt-orion))
 define KernelPackage/booke-wdt
   SUBMENU:=$(OTHER_MENU)
   TITLE:=PowerPC Book-E Watchdog Timer
-  DEPENDS:=@(TARGET_mpc85xx||TARGET_ppc40x||TARGET_ppc44x)
+  DEPENDS:=@(TARGET_apm821xx||TARGET_mpc85xx||TARGET_ppc40x||TARGET_ppc44x)
   KCONFIG:=CONFIG_BOOKE_WDT
   FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/booke_wdt.ko
   AUTOLOAD:=$(call AutoLoad,50,booke_wdt,1)
diff --git a/target/linux/apm821xx/Makefile b/target/linux/apm821xx/Makefile
new file mode 100644
index 000..ba3b179
--- /dev/null
+++ b/target/linux/apm821xx/Makefile
@@ -0,0 +1,28 @@
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+ARCH:=powerpc
+BOARD:=apm821xx
+BOARDNAME:=AppliedMicro APM821xx
+CPU_TYPE:=464fp
+FEATURES:=fpu dt gpio
+MAINTAINER:=Chris Blake , \
+   Christian Lamparter 
+
+KERNEL_PATCHVER:=4.4
+
+include $(INCLUDE_DIR)/target.mk
+
+KERNELNAME:=uImage
+
+DEFAULT_PACKAGES += \
+   kmod-leds-gpio kmod-booke-wdt kmod-i2c-core kmod-gpio-button-hotplug
+
+define Target/Description
+   Build images for AppliedMicro APM821xx based boards.
+endef
+
+$(eval $(call BuildTarget))
diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds 
b/target/linux/apm821xx/base-files/etc/board.d/01_leds
new file mode 100755
index 000..eab8b59
--- /dev/null
+++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+. /lib/functions/uci-defaults.sh
+. /lib/apm821xx.sh
+
+board_config_update
+
+board=$(apm821xx_board_name)
+
+case "$board" in
+*)
+   ;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/apm821xx/base-files/etc/board.d/02_network 
b/target/linux/apm821xx/base-files/etc/board.d/02_network
new file mode 100755
index 000..7dbabec
--- /dev/null
+++ b/target/linux/apm821xx/base-files/etc/board.d/02_network
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+. /lib/functions/system.sh
+. /lib/functions/uci-defaults.sh
+. /lib/apm821xx.sh
+
+board_config_update
+
+board=$(apm821xx_board_name)
+