[OpenWrt-Devel] [PATCH] build: don't call prereq for any package/symlinks rules

2015-04-27 Thread Mathieu Olivari
Most of the time, we want to make sure OpenWrt has been configured and
setup before start running make. However, in case of package/symlinks,
forcing prereq as a dependency creates multiple issues:
*when executed on a clean workspace, it will prompt for user input
 and open a menuconfig window before executing the feeds command
*the only way around that is to provide a .config. However, the "prereq"
 target would then run a "make defconfig", which will remove all the
 packages in the .config but from external feeds, as feeds have not been
 installed yet.

The only way to currently work around this, is to generate a fake config
by running "make defconfig", then "make package/symlinks", copy the real
config (which at this point disregards the previously generated config),
and run make defconfig again. Something like this:

make defconfig
make package/symlinks
cp real.config .config
make defconfig

This change is removing the need for the first defconfig, making the
process more logical for OpenWrt users using the package/symlinks target.

Signed-off-by: Mathieu Olivari 
---
 include/toplevel.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/toplevel.mk b/include/toplevel.mk
index d8651d9..b3b344d 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -178,6 +178,7 @@ ifeq ($(SDK),1)
 else
 
 %::
+ifeq ($(filter package/symlinks%,$(MAKECMDGOALS)),)
@+$(PREP_MK) $(NO_TRACE_MAKE) -r -s prereq
@( \
cp .config tmp/.config; \
@@ -186,6 +187,7 @@ else
printf "$(_R)WARNING: your configuration is out of 
sync. Please run make menuconfig, oldconfig or defconfig!$(_N)\n" >&2; \
fi \
)
+endif
@+$(ULIMIT_FIX) $(SUBMAKE) -r $@ $(if $(WARN_PARALLEL_ERROR), || { \
printf "$(_R)Build failed - please re-run with -j1 to see the 
real error message$(_N)\n" >&2; \
false; \
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: don't call prereq for any package/symlinks rules

2015-04-27 Thread Mathieu Olivari
I'm actually talking about the command below:
$ make package/symlinks

Right after the git clone, it does open the menuconfig. Which ends-up in
generating a .config, which has to be deleted anyway as any package from
feed would get removed.

Thanks,
Mathieu

-Original Message-
From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On
Behalf Of Toerless Eckert
Sent: Monday, April 27, 2015 4:59 PM
To: Mathieu Olivari
Cc: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH] build: don't call prereq for any
package/symlinks rules


Mathieu:

I can't quite follow your explanations. I ahve been building what looks to
me perfectly well working 14.07 images by just doing:

git clone git://git.openwrt.org/openwrt.git cd openwrt # Clean workspace now

cp real.config .config
make defconfig
make

Your mail seems to indicate that that supposedly does not work. Can you
please tell me what exactly is breaking when i do that ?

Thanks
Toerless

On Mon, Apr 27, 2015 at 04:46:49PM -0700, Mathieu Olivari wrote:
> Most of the time, we want to make sure OpenWrt has been configured and 
> setup before start running make. However, in case of package/symlinks, 
> forcing prereq as a dependency creates multiple issues:
> *when executed on a clean workspace, it will prompt for user input  
> and open a menuconfig window before executing the feeds command *the 
> only way around that is to provide a .config. However, the "prereq"
>  target would then run a "make defconfig", which will remove all the  
> packages in the .config but from external feeds, as feeds have not 
> been  installed yet.
> 
> The only way to currently work around this, is to generate a fake 
> config by running "make defconfig", then "make package/symlinks", copy 
> the real config (which at this point disregards the previously 
> generated config), and run make defconfig again. Something like this:
> 
> make defconfig
> make package/symlinks
> cp real.config .config
> make defconfig
> 
> This change is removing the need for the first defconfig, making the 
> process more logical for OpenWrt users using the package/symlinks target.
> 
> Signed-off-by: Mathieu Olivari 
> ---
>  include/toplevel.mk | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/toplevel.mk b/include/toplevel.mk index 
> d8651d9..b3b344d 100644
> --- a/include/toplevel.mk
> +++ b/include/toplevel.mk
> @@ -178,6 +178,7 @@ ifeq ($(SDK),1)
>  else
>  
>  %::
> +ifeq ($(filter package/symlinks%,$(MAKECMDGOALS)),)
>   @+$(PREP_MK) $(NO_TRACE_MAKE) -r -s prereq
>   @( \
>   cp .config tmp/.config; \
> @@ -186,6 +187,7 @@ else
>   printf "$(_R)WARNING: your configuration is out of
sync. Please run make menuconfig, oldconfig or defconfig!$(_N)\n" >&2; \
>   fi \
>   )
> +endif
>   @+$(ULIMIT_FIX) $(SUBMAKE) -r $@ $(if $(WARN_PARALLEL_ERROR), || { \
>   printf "$(_R)Build failed - please re-run with -j1 to see
the real error message$(_N)\n" >&2; \
>   false; \
> --
> 1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] build: don't call prereq for any package/symlinks rules

2015-04-28 Thread Mathieu Olivari
make package/symlinks can be used as an alternative to the ./scripts/feeds
command to update & install all feeds available in feeds.conf

Here is the code from the top Makefile:
# update all feeds, re-create index files, install symlinks
package/symlinks:
$(SCRIPT_DIR)/feeds update -a
$(SCRIPT_DIR)/feeds install -a

# re-create index files, install symlinks
package/symlinks-install:
$(SCRIPT_DIR)/feeds update -i
$(SCRIPT_DIR)/feeds install -a

# remove all symlinks, don't touch ./feeds
package/symlinks-clean:
$(SCRIPT_DIR)/feeds uninstall -a

Thanks,
Mathieu

-Original Message-
From: 'Toerless Eckert' [mailto:t...@cs.fau.de] 
Sent: Monday, April 27, 2015 6:46 PM
To: Mathieu Olivari
Cc: 'Mathieu Olivari'; openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH] build: don't call prereq for any
package/symlinks rules

So if "make package/symlinks" is optional, when is it needed ?

Sorry for the beginner q.

On Mon, Apr 27, 2015 at 05:15:36PM -0700, Mathieu Olivari wrote:
> I'm actually talking about the command below:
> $ make package/symlinks
> 
> Right after the git clone, it does open the menuconfig. Which ends-up 
> in generating a .config, which has to be deleted anyway as any package 
> from feed would get removed.
> 
> Thanks,
> Mathieu
> 
> -Original Message-
> From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] 
> On Behalf Of Toerless Eckert
> Sent: Monday, April 27, 2015 4:59 PM
> To: Mathieu Olivari
> Cc: openwrt-devel@lists.openwrt.org
> Subject: Re: [OpenWrt-Devel] [PATCH] build: don't call prereq for any 
> package/symlinks rules
> 
> 
> Mathieu:
> 
> I can't quite follow your explanations. I ahve been building what 
> looks to me perfectly well working 14.07 images by just doing:
> 
> git clone git://git.openwrt.org/openwrt.git cd openwrt # Clean 
> workspace now
> 
> cp real.config .config
> make defconfig
> make
> 
> Your mail seems to indicate that that supposedly does not work. Can 
> you please tell me what exactly is breaking when i do that ?
> 
> Thanks
> Toerless
> 
> On Mon, Apr 27, 2015 at 04:46:49PM -0700, Mathieu Olivari wrote:
> > Most of the time, we want to make sure OpenWrt has been configured 
> > and setup before start running make. However, in case of 
> > package/symlinks, forcing prereq as a dependency creates multiple
issues:
> > *when executed on a clean workspace, it will prompt for user input 
> > and open a menuconfig window before executing the feeds command *the 
> > only way around that is to provide a .config. However, the "prereq"
> >  target would then run a "make defconfig", which will remove all the 
> > packages in the .config but from external feeds, as feeds have not 
> > been  installed yet.
> > 
> > The only way to currently work around this, is to generate a fake 
> > config by running "make defconfig", then "make package/symlinks", 
> > copy the real config (which at this point disregards the previously 
> > generated config), and run make defconfig again. Something like this:
> > 
> > make defconfig
> > make package/symlinks
> > cp real.config .config
> > make defconfig
> > 
> > This change is removing the need for the first defconfig, making the 
> > process more logical for OpenWrt users using the package/symlinks
target.
> > 
> > Signed-off-by: Mathieu Olivari 
> > ---
> >  include/toplevel.mk | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/include/toplevel.mk b/include/toplevel.mk index 
> > d8651d9..b3b344d 100644
> > --- a/include/toplevel.mk
> > +++ b/include/toplevel.mk
> > @@ -178,6 +178,7 @@ ifeq ($(SDK),1)
> >  else
> >  
> >  %::
> > +ifeq ($(filter package/symlinks%,$(MAKECMDGOALS)),)
> > @+$(PREP_MK) $(NO_TRACE_MAKE) -r -s prereq
> > @( \
> > cp .config tmp/.config; \
> > @@ -186,6 +187,7 @@ else
> > printf "$(_R)WARNING: your configuration is out of
> sync. Please run make menuconfig, oldconfig or defconfig!$(_N)\n" >&2; 
> \
> > fi \
> > )
> > +endif
> > @+$(ULIMIT_FIX) $(SUBMAKE) -r $@ $(if $(WARN_PARALLEL_ERROR), || {
\
> > printf "$(_R)Build failed - please re-run with -j1 to see
> the real error message$(_N)\n" >&2; \
> > false; \
> > --
> > 1.9.1
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

--
---
toerless.eck...@informatik.uni-erlangen.de
/C=de/A=d400/P=uni-erlangen/OU=informatik/S=Eckert/G=Toerless/
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] generic: add CRYPTO_DEV_QCE option to default config

2015-04-30 Thread Mathieu Olivari
This option has been added in kernel 3.17. It shows-up only when both
ARCH_QCOM and CRYPTO are enabled. So we'll disable these two by default
to avoid stalling the build when these conditions are met.

Signed-off-by: Mathieu Olivari 
---
 target/linux/generic/config-3.18 | 1 +
 target/linux/generic/config-4.0  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18
index 8cc909f..13e172f 100644
--- a/target/linux/generic/config-3.18
+++ b/target/linux/generic/config-3.18
@@ -727,6 +727,7 @@ CONFIG_CRYPTO_ALGAPI2=y
 # CONFIG_CRYPTO_DEV_HIFN_795X is not set
 # CONFIG_CRYPTO_DEV_MV_CESA is not set
 # CONFIG_CRYPTO_DEV_QAT_DH895xCC is not set
+# CONFIG_CRYPTO_DEV_QCE is not set
 # CONFIG_CRYPTO_DEV_SAHARA is not set
 # CONFIG_CRYPTO_DEV_TALITOS is not set
 # CONFIG_CRYPTO_DRBG_MENU is not set
diff --git a/target/linux/generic/config-4.0 b/target/linux/generic/config-4.0
index b5c952e..c3bb7fc 100644
--- a/target/linux/generic/config-4.0
+++ b/target/linux/generic/config-4.0
@@ -737,6 +737,7 @@ CONFIG_CRYPTO_ALGAPI2=y
 # CONFIG_CRYPTO_DEV_HIFN_795X is not set
 # CONFIG_CRYPTO_DEV_MV_CESA is not set
 # CONFIG_CRYPTO_DEV_QAT_DH895xCC is not set
+# CONFIG_CRYPTO_DEV_QCE is not set
 # CONFIG_CRYPTO_DEV_SAHARA is not set
 # CONFIG_CRYPTO_DEV_TALITOS is not set
 # CONFIG_CRYPTO_DRBG_MENU is not set
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] build: make device-tree arg optional in mkits.sh

2015-04-30 Thread Mathieu Olivari
mkits.sh help currently shows dtb file as optional, but generates an
invalid its file when this option is unspecified.

We're fixing this problem by removing the use of the sed command and
just including variables instead.

Signed-off-by: Mathieu Olivari 
---
 scripts/mkits.sh | 40 +---
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git a/scripts/mkits.sh b/scripts/mkits.sh
index c360c73..6b5100e 100755
--- a/scripts/mkits.sh
+++ b/scripts/mkits.sh
@@ -55,6 +55,25 @@ fi
 
 ARCH_UPPER=`echo $ARCH | tr '[:lower:]' '[:upper:]'`
 
+# Conditionally create fdt information
+if [ -n "${DTB}" ]; then
+   FDT="
+   fdt@1 {
+   description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device 
tree blob\";
+   data = /incbin/(\"${DTB}\");
+   type = \"flat_dt\";
+   arch = \"${ARCH}\";
+   compression = \"none\";
+   hash@1 {
+   algo = \"crc32\";
+   };
+   hash@2 {
+   algo = \"sha1\";
+   };
+   };
+"
+fi
+
 # Create a default, fully populated DTS file
 DATA="/dts-v1/;
 
@@ -80,19 +99,8 @@ DATA="/dts-v1/;
};
};
 
-   fdt@1 {
-   description = \"${ARCH_UPPER} OpenWrt ${DEVICE} device 
tree blob\";
-   data = /incbin/(\"${DTB}\");
-   type = \"flat_dt\";
-   arch = \"${ARCH}\";
-   compression = \"none\";
-   hash@1 {
-   algo = \"crc32\";
-   };
-   hash@2 {
-   algo = \"sha1\";
-   };
-   };
+${FDT}
+
};
 
configurations {
@@ -105,11 +113,5 @@ DATA="/dts-v1/;
};
 };"
 
-# Conditionally strip fdt information out of tree
-if [ -z "${DTB}" ]; then
-   DATA=`echo "$DATA" | sed '/start fdt/,/end fdt/d'`
-   DATA=`echo "$DATA" | sed '/fdt/d'`
-fi
-
 # Write .its file to disk
 echo "$DATA" > ${OUTPUT}
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2] include: make dtb argument optional in MkFIT

2015-04-30 Thread Mathieu Olivari
As mkits.sh makes the -d argument optional, we'll make this same
argument optional in the MkFIT function as well.

With this change, MkFIT can be used both to generate FIT images with DT,
and without DT.

Signed-off-by: Mathieu Olivari 
---
 include/image.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/image.mk b/include/image.mk
index 788d593..a6237ff 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -121,7 +121,7 @@ endef
 
 define Image/BuildKernel/MkFIT
$(TOPDIR)/scripts/mkits.sh \
-   -D $(1) -o $(KDIR)/fit-$(1).its -k $(2) -d $(3) -C $(4) -a $(5) 
-e $(6) \
+   -D $(1) -o $(KDIR)/fit-$(1).its -k $(2) $(if $(3),-d $(3)) -C 
$(4) -a $(5) -e $(6) \
-A $(ARCH) -v $(LINUX_VERSION)
PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/fit-$(1).its 
$(KDIR)/fit-$(1)$(7).itb
 endef
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2] ipq806x: add support for zImage kernel

2015-04-30 Thread Mathieu Olivari
This change enable ATAGS support in ipq806x kernel options, and generate
the zImage as part of the kernel binaries.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/Makefile  |  2 +-
 target/linux/ipq806x/config-3.18   |  7 ++-
 target/linux/ipq806x/config-4.0|  8 ++-
 .../300-arch-arm-force-ZRELADDR-on-arch-qcom.patch | 72 ++
 4 files changed, 84 insertions(+), 5 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-4.0/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch

diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile
index 1512b30..f97db74 100644
--- a/target/linux/ipq806x/Makefile
+++ b/target/linux/ipq806x/Makefile
@@ -11,7 +11,7 @@ MAINTAINER:=John Crispin 
 
 KERNEL_PATCHVER:=3.18
 
-KERNELNAME:=Image dtbs
+KERNELNAME:=zImage Image dtbs
 
 include $(INCLUDE_DIR)/target.mk
 DEFAULT_PACKAGES += \
diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 8de4cb4..219e2c7 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -33,8 +33,12 @@ CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
 CONFIG_ARM=y
 CONFIG_ARM_AMBA=y
+CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ARCH_TIMER=y
 CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
 CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_GIC=y
 CONFIG_ARM_HAS_SG_CHAIN=y
@@ -48,7 +52,7 @@ CONFIG_ARM_THUMB=y
 CONFIG_ARM_UNWIND=y
 CONFIG_ARM_VIRT_EXT=y
 CONFIG_AT803X_PHY=y
-CONFIG_AUTO_ZRELADDR=y
+CONFIG_ATAGS=y
 # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
 CONFIG_BOUNCE=y
@@ -92,6 +96,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DEBUG_GPIO=y
 CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
 CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_QCOM_UARTDM is not set
 # CONFIG_DEBUG_UART_8250 is not set
 # CONFIG_DEBUG_UART_PL01X is not set
 # CONFIG_DEBUG_USER is not set
diff --git a/target/linux/ipq806x/config-4.0 b/target/linux/ipq806x/config-4.0
index c7bbcd9..7136424 100644
--- a/target/linux/ipq806x/config-4.0
+++ b/target/linux/ipq806x/config-4.0
@@ -34,8 +34,12 @@ CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
 CONFIG_ARM=y
 CONFIG_ARM_AMBA=y
+CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ARCH_TIMER=y
 CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
 CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_GIC=y
 CONFIG_ARM_HAS_SG_CHAIN=y
@@ -50,8 +54,7 @@ CONFIG_ARM_THUMB=y
 CONFIG_ARM_UNWIND=y
 CONFIG_ARM_VIRT_EXT=y
 CONFIG_AT803X_PHY=y
-CONFIG_AUTO_ZRELADDR=y
-# CONFIG_BATTERY_GAUGE_LTC2941 is not set
+CONFIG_ATAGS=y
 # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
 CONFIG_BOUNCE=y
@@ -348,7 +351,6 @@ CONFIG_SWCONFIG=y
 CONFIG_SWIOTLB=y
 CONFIG_SWP_EMULATE=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-# CONFIG_TEGRA_AHB is not set
 CONFIG_THERMAL=y
 # CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
 CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
diff --git 
a/target/linux/ipq806x/patches-4.0/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
 
b/target/linux/ipq806x/patches-4.0/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
new file mode 100644
index 000..82170cd
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-4.0/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
@@ -0,0 +1,72 @@
+From b12e230f09d4481424e6a5d7e2ae566b6954e83f Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari 
+Date: Wed, 29 Apr 2015 15:21:46 -0700
+Subject: [PATCH] HACK: arch: arm: force ZRELADDR on arch-qcom
+
+ARCH_QCOM is using the ARCH_MULTIPLATFORM option, as now recommended
+on most ARM architectures. This automatically calculate ZRELADDR by
+masking PHYS_OFFSET with 0xf800.
+
+However, on IPQ806x, the first ~20MB of RAM is reserved for the hardware
+network accelerators, and the bootloader removes this section from the
+layout passed from the ATAGS (when used).
+
+For newer bootloader, when DT is used, this is not a problem, we just
+reserve this memory in the device tree. But if the bootloader doesn't
+have DT support, then ATAGS have to be used. In this case, the ARM
+decompressor will position the kernel in this low mem, which will not be
+in the RAM section mapped by the bootloader, which means the kernel will
+freeze in the middle of the boot process trying to map the memory.
+
+As a work around, this patch allows disabling AUTO_ZRELADDR when
+ARCH_QCOM is selected. It makes the zImage usage possible on bootloaders
+which don't support device-tree, which is the case on certain early
+IPQ806x based designs.
+
+Signed-off-by: Mathieu Olivari 
+---
+ arch/arm/Kconfig | 2 +-
+ arch/arm/Makefile| 2 ++
+ arch/arm/mach-qcom/Makefile.boot | 1 +

[OpenWrt-Devel] [PATCH 1/2] ipq806x: fix boot freeze on zImage kernel

2015-04-30 Thread Mathieu Olivari
ARCH_QCOM is using the ARCH_MULTIPLATFORM option, as now recommended
on most ARM architectures. This automatically calculate ZRELADDR by
masking PHYS_OFFSET with 0xf800.

On IPQ806x though, the first ~20MB of RAM is reserved for the hardware.
In newer bootloader, when DT is used, this is not a problem, we just
reserve this memory in the device tree. But if the bootloader doesn't
have DT support, then ATAGS have to be used. In this case, the ARM
decompressor will position the kernel in this low mem, which will not be
in the RAM section mapped by the bootloader, which means the kernel will
freeze in the middle of the boot process trying to map the memory.

As a work around, this patch allows disabling AUTO_ZRELADDR when
ARCH_QCOM is selected. It makes the zImage usage possible on bootloaders
which don't support device-tree, which is the case on certain early
IPQ806x based designs.

Signed-off-by: Mathieu Olivari 
---
 .../300-arch-arm-force-ZRELADDR-on-arch-qcom.patch | 72 ++
 1 file changed, 72 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-3.18/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
 
b/target/linux/ipq806x/patches-3.18/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
new file mode 100644
index 000..82170cd
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
@@ -0,0 +1,72 @@
+From b12e230f09d4481424e6a5d7e2ae566b6954e83f Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari 
+Date: Wed, 29 Apr 2015 15:21:46 -0700
+Subject: [PATCH] HACK: arch: arm: force ZRELADDR on arch-qcom
+
+ARCH_QCOM is using the ARCH_MULTIPLATFORM option, as now recommended
+on most ARM architectures. This automatically calculate ZRELADDR by
+masking PHYS_OFFSET with 0xf800.
+
+However, on IPQ806x, the first ~20MB of RAM is reserved for the hardware
+network accelerators, and the bootloader removes this section from the
+layout passed from the ATAGS (when used).
+
+For newer bootloader, when DT is used, this is not a problem, we just
+reserve this memory in the device tree. But if the bootloader doesn't
+have DT support, then ATAGS have to be used. In this case, the ARM
+decompressor will position the kernel in this low mem, which will not be
+in the RAM section mapped by the bootloader, which means the kernel will
+freeze in the middle of the boot process trying to map the memory.
+
+As a work around, this patch allows disabling AUTO_ZRELADDR when
+ARCH_QCOM is selected. It makes the zImage usage possible on bootloaders
+which don't support device-tree, which is the case on certain early
+IPQ806x based designs.
+
+Signed-off-by: Mathieu Olivari 
+---
+ arch/arm/Kconfig | 2 +-
+ arch/arm/Makefile| 2 ++
+ arch/arm/mach-qcom/Makefile.boot | 1 +
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+ create mode 100644 arch/arm/mach-qcom/Makefile.boot
+
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 89c4b5c..4583ea5 100644
+--- a/arch/arm/Kconfig
 b/arch/arm/Kconfig
+@@ -311,7 +311,7 @@ config ARCH_MULTIPLATFORM
+   select ARCH_WANT_OPTIONAL_GPIOLIB
+   select ARM_HAS_SG_CHAIN
+   select ARM_PATCH_PHYS_VIRT
+-  select AUTO_ZRELADDR
++  select AUTO_ZRELADDR if !ARCH_QCOM
+   select CLKSRC_OF
+   select COMMON_CLK
+   select GENERIC_CLOCKEVENTS
+diff --git a/arch/arm/Makefile b/arch/arm/Makefile
+index 7453352..5d6f8ac 100644
+--- a/arch/arm/Makefile
 b/arch/arm/Makefile
+@@ -240,9 +240,11 @@ MACHINE  := arch/arm/mach-$(word 1,$(machine-y))/
+ else
+ MACHINE  :=
+ endif
++ifeq ($(CONFIG_ARCH_QCOM),)
+ ifeq ($(CONFIG_ARCH_MULTIPLATFORM),y)
+ MACHINE  :=
+ endif
++endif
+ 
+ machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
+ platdirs := $(patsubst %,arch/arm/plat-%/,$(sort $(plat-y)))
+diff --git a/arch/arm/mach-qcom/Makefile.boot 
b/arch/arm/mach-qcom/Makefile.boot
+new file mode 100644
+index 000..67a6d5a
+--- /dev/null
 b/arch/arm/mach-qcom/Makefile.boot
+@@ -0,0 +1 @@
++zreladdr-y+= 0x42208000
+-- 
+1.9.1
+
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [Patch V2 1/2] ipq806x: fix boot freeze on zImage kernel

2015-05-04 Thread Mathieu Olivari
ARCH_QCOM is using the ARCH_MULTIPLATFORM option, as now recommended
on most ARM architectures. This automatically calculate ZRELADDR by
masking PHYS_OFFSET with 0xf800.

On IPQ806x though, the first ~20MB of RAM is reserved for the hardware.
In newer bootloader, when DT is used, this is not a problem, we just
reserve this memory in the device tree. But if the bootloader doesn't
have DT support, then ATAGS have to be used. In this case, the ARM
decompressor will position the kernel in this low mem, which will not be
in the RAM section mapped by the bootloader, which means the kernel will
freeze in the middle of the boot process trying to map the memory.

As a work around, this patch allows disabling AUTO_ZRELADDR when
ARCH_QCOM is selected. It makes the zImage usage possible on bootloaders
which don't support device-tree, which is the case on certain early
IPQ806x based designs.

Signed-off-by: Mathieu Olivari 
---

Notes:
v2:
 *add the patch for kernel 4.0

 .../300-arch-arm-force-ZRELADDR-on-arch-qcom.patch | 72 ++
 .../300-arch-arm-force-ZRELADDR-on-arch-qcom.patch | 72 ++
 2 files changed, 144 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-3.18/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
 
b/target/linux/ipq806x/patches-3.18/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
new file mode 100644
index 000..82170cd
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
@@ -0,0 +1,72 @@
+From b12e230f09d4481424e6a5d7e2ae566b6954e83f Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari 
+Date: Wed, 29 Apr 2015 15:21:46 -0700
+Subject: [PATCH] HACK: arch: arm: force ZRELADDR on arch-qcom
+
+ARCH_QCOM is using the ARCH_MULTIPLATFORM option, as now recommended
+on most ARM architectures. This automatically calculate ZRELADDR by
+masking PHYS_OFFSET with 0xf800.
+
+However, on IPQ806x, the first ~20MB of RAM is reserved for the hardware
+network accelerators, and the bootloader removes this section from the
+layout passed from the ATAGS (when used).
+
+For newer bootloader, when DT is used, this is not a problem, we just
+reserve this memory in the device tree. But if the bootloader doesn't
+have DT support, then ATAGS have to be used. In this case, the ARM
+decompressor will position the kernel in this low mem, which will not be
+in the RAM section mapped by the bootloader, which means the kernel will
+freeze in the middle of the boot process trying to map the memory.
+
+As a work around, this patch allows disabling AUTO_ZRELADDR when
+ARCH_QCOM is selected. It makes the zImage usage possible on bootloaders
+which don't support device-tree, which is the case on certain early
+IPQ806x based designs.
+
+Signed-off-by: Mathieu Olivari 
+---
+ arch/arm/Kconfig | 2 +-
+ arch/arm/Makefile| 2 ++
+ arch/arm/mach-qcom/Makefile.boot | 1 +
+ 3 files changed, 4 insertions(+), 1 deletion(-)
+ create mode 100644 arch/arm/mach-qcom/Makefile.boot
+
+diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
+index 89c4b5c..4583ea5 100644
+--- a/arch/arm/Kconfig
 b/arch/arm/Kconfig
+@@ -311,7 +311,7 @@ config ARCH_MULTIPLATFORM
+   select ARCH_WANT_OPTIONAL_GPIOLIB
+   select ARM_HAS_SG_CHAIN
+   select ARM_PATCH_PHYS_VIRT
+-  select AUTO_ZRELADDR
++  select AUTO_ZRELADDR if !ARCH_QCOM
+   select CLKSRC_OF
+   select COMMON_CLK
+   select GENERIC_CLOCKEVENTS
+diff --git a/arch/arm/Makefile b/arch/arm/Makefile
+index 7453352..5d6f8ac 100644
+--- a/arch/arm/Makefile
 b/arch/arm/Makefile
+@@ -240,9 +240,11 @@ MACHINE  := arch/arm/mach-$(word 1,$(machine-y))/
+ else
+ MACHINE  :=
+ endif
++ifeq ($(CONFIG_ARCH_QCOM),)
+ ifeq ($(CONFIG_ARCH_MULTIPLATFORM),y)
+ MACHINE  :=
+ endif
++endif
+ 
+ machdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
+ platdirs := $(patsubst %,arch/arm/plat-%/,$(sort $(plat-y)))
+diff --git a/arch/arm/mach-qcom/Makefile.boot 
b/arch/arm/mach-qcom/Makefile.boot
+new file mode 100644
+index 000..67a6d5a
+--- /dev/null
 b/arch/arm/mach-qcom/Makefile.boot
+@@ -0,0 +1 @@
++zreladdr-y+= 0x42208000
+-- 
+1.9.1
+
diff --git 
a/target/linux/ipq806x/patches-4.0/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
 
b/target/linux/ipq806x/patches-4.0/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
new file mode 100644
index 000..82170cd
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-4.0/300-arch-arm-force-ZRELADDR-on-arch-qcom.patch
@@ -0,0 +1,72 @@
+From b12e230f09d4481424e6a5d7e2ae566b6954e83f Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari 
+Date: Wed, 29 Apr 2015 15:21:46 -0700
+Subject: [PATCH] HACK: arch: arm: force ZRELADDR on arch-qcom
+
+ARCH_QCOM is using the ARCH_MULTIPLATFORM option, as now reco

[OpenWrt-Devel] [Patch V2 2/2] ipq806x: add support for zImage kernel

2015-05-04 Thread Mathieu Olivari
This change enable zImage+appended dtb support in ipq806x kernel
options. The zImage will now be generated as part of the kernel
binaries. Platforms which do not have DT support enabled in U-boot
can now make use of it by generating zImage files and appending dtb
to it.

It is not used yet but it is done as a stepping stone for early IPQ806x
platforms, which did not include DT support in U-boot.

Signed-off-by: Mathieu Olivari 
---

Notes:
v2:
 Addressing jogo comments about DTB compat. Current platforms set
 the console bootargs to an incorrect value in the bootloader. So
 we'll disable these options in order to get them from the chosen node
 and have a kernel boot 100% isolated from the bootloader.
 We also disable CONFIG_ATAGS, as we don't need it.

 Disables the following configs:
 *CONFIG_ARM_ATAG_DTB_COMPAT
 *CONFIG_ATAGS

 target/linux/ipq806x/Makefile| 2 +-
 target/linux/ipq806x/config-3.18 | 3 ++-
 target/linux/ipq806x/config-4.0  | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile
index 1512b30..f97db74 100644
--- a/target/linux/ipq806x/Makefile
+++ b/target/linux/ipq806x/Makefile
@@ -11,7 +11,7 @@ MAINTAINER:=John Crispin 
 
 KERNEL_PATCHVER:=3.18
 
-KERNELNAME:=Image dtbs
+KERNELNAME:=zImage Image dtbs
 
 include $(INCLUDE_DIR)/target.mk
 DEFAULT_PACKAGES += \
diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 8de4cb4..48a7374 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -33,8 +33,10 @@ CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
 CONFIG_ARM=y
 CONFIG_ARM_AMBA=y
+CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ARCH_TIMER=y
 CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+# CONFIG_ARM_ATAG_DTB_COMPAT is not set
 CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_GIC=y
 CONFIG_ARM_HAS_SG_CHAIN=y
@@ -48,7 +50,6 @@ CONFIG_ARM_THUMB=y
 CONFIG_ARM_UNWIND=y
 CONFIG_ARM_VIRT_EXT=y
 CONFIG_AT803X_PHY=y
-CONFIG_AUTO_ZRELADDR=y
 # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
 CONFIG_BOUNCE=y
diff --git a/target/linux/ipq806x/config-4.0 b/target/linux/ipq806x/config-4.0
index c7bbcd9..9d8ff65 100644
--- a/target/linux/ipq806x/config-4.0
+++ b/target/linux/ipq806x/config-4.0
@@ -34,8 +34,10 @@ CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
 CONFIG_ARM=y
 CONFIG_ARM_AMBA=y
+CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ARCH_TIMER=y
 CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+# CONFIG_ARM_ATAG_DTB_COMPAT is not set
 CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_GIC=y
 CONFIG_ARM_HAS_SG_CHAIN=y
@@ -50,7 +52,6 @@ CONFIG_ARM_THUMB=y
 CONFIG_ARM_UNWIND=y
 CONFIG_ARM_VIRT_EXT=y
 CONFIG_AT803X_PHY=y
-CONFIG_AUTO_ZRELADDR=y
 # CONFIG_BATTERY_GAUGE_LTC2941 is not set
 # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ipq806x: add pcie support to ipq806x based platforms

2015-05-05 Thread Mathieu Olivari
This change adds PCIe support to IPQ806x based platforms. The driver is
actually cherry-picked from the following LKML thread:
*https://lwn.net/Articles/643086/ (patches 110-111)

We also add here an additional fix to support multiple PCI controllers
on the same platform (patch 112), and to patch the ap148 & dbs149 DTS
files (patch 113).

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.18   |   6 +
 target/linux/ipq806x/config-4.0|  10 +-
 ...CI-qcom-Document-PCIe-devicetree-bindings.patch | 266 
 ...-qcom-Add-Qualcomm-PCIe-controller-driver.patch | 753 +
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch | 268 
 ...tomatically-select-PCI_DOMAINS-if-PCI-is-.patch |  29 +
 .../patches-3.18/700-add-gmac-dts-suport.patch |  19 +-
 ...CI-qcom-Document-PCIe-devicetree-bindings.patch | 266 
 ...-qcom-Add-Qualcomm-PCIe-controller-driver.patch | 753 +
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch | 260 +++
 ...tomatically-select-PCI_DOMAINS-if-PCI-is-.patch |  29 +
 .../patches-4.0/700-add-gmac-dts-suport.patch  |  26 +-
 12 files changed, 2662 insertions(+), 23 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/111-PCI-qcom-Add-Qualcomm-PCIe-controller-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/113-ARM-qcom-automatically-select-PCI_DOMAINS-if-PCI-is-.patch

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 8de4cb4..32f4b67 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -257,6 +257,11 @@ CONFIG_OLD_SIGSUSPEND3=y
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_PAGE_OFFSET=0xC000
 CONFIG_PCI=y
+CONFIG_PCIEAER=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIE_DW=y
+CONFIG_PCIE_QCOM=y
+CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_MSI=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_USE_VMALLOC=y
@@ -294,6 +299,7 @@ CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_SCM=y
 CONFIG_QCOM_WDT=y
+CONFIG_RAS=y
 # CONFIG_RCU_BOOST is not set
 CONFIG_RCU_CPU_STALL_TIMEOUT=21
 CONFIG_RCU_CPU_STALL_VERBOSE=y
diff --git a/target/linux/ipq806x/config-4.0 b/target/linux/ipq806x/config-4.0
index c7bbcd9..1786abb 100644
--- a/target/linux/ipq806x/config-4.0
+++ b/target/linux/ipq806x/config-4.0
@@ -266,7 +266,14 @@ CONFIG_OLD_SIGSUSPEND3=y
 CONFIG_PAGEFLAGS_EXTENDED=y
 CONFIG_PAGE_OFFSET=0xC000
 CONFIG_PCI=y
-# CONFIG_PCI_DOMAINS_GENERIC is not set
+CONFIG_PCIEAER=y
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIE_DW=y
+CONFIG_PCIE_PME=y
+CONFIG_PCIE_QCOM=y
+CONFIG_PCI_DEBUG=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_DOMAINS_GENERIC=y
 CONFIG_PCI_MSI=y
 CONFIG_PERF_EVENTS=y
 CONFIG_PERF_USE_VMALLOC=y
@@ -306,6 +313,7 @@ CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_SCM=y
 CONFIG_QCOM_WDT=y
+CONFIG_RAS=y
 # CONFIG_RCU_BOOST is not set
 CONFIG_RCU_CPU_STALL_TIMEOUT=21
 CONFIG_RCU_STALL_COMMON=y
diff --git 
a/target/linux/ipq806x/patches-3.18/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
 
b/target/linux/ipq806x/patches-3.18/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
new file mode 100644
index 000..95398e0
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/110-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch
@@ -0,0 +1,266 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,3/5] DT: PCI: qcom: Document PCIe devicetree bindings
+From: Stanimir Varbanov 
+X-Patchwork-Id: 6326181
+Message-Id: <1430743338-10441-4-git-send-email-svarba...@mm-sol.com>
+To: Rob Herring , Kumar Gala ,
+   Mark Rutland ,
+   Grant Likely ,
+   Bjorn Helgaas ,
+   Kishon Vijay Abraham I ,
+   Russell King , Arnd Bergmann 
+Cc: linux-arm-...@vger.kernel.org, linux-ker...@vger.kernel.org,
+   linux-arm-ker...@lists.infradead.org, devicet...@vger.kernel.org,
+   linux-...@vger.kernel.org, Mathieu Olivari ,
+   Srinivas Kandagatla ,
+   Stanimir Varbanov 
+Date: Mon,  4 May 2015 15:42:16 +0300
+
+Document Qualcomm PCIe driver devicetree bindings.
+
+Signed-off-by: Stanimir Varbanov 
+
+---
+.../devicetree/bindings/pci/qcom,pcie.txt  |  231 
+ 1 files changed, 231 insertions(+), 0 deletions(-)
+ create mode 100644 Docu

[OpenWrt-Devel] [Patch V2] build: don't call prereq for any package/symlinks rules

2015-05-08 Thread Mathieu Olivari
Most of the time, we want to make sure OpenWrt has been configured and
setup before start running make. However, in case of package/symlinks,
forcing prereq as a dependency creates multiple issues:
*when executed on a clean workspace, it will prompt for user input
 and open a menuconfig window before executing the feeds command
*the only way around that is to provide a .config. However, the "prereq"
 target would then run a "make defconfig", which will remove all the
 packages in the .config but from external feeds, as feeds have not been
 installed yet.

The only way to currently work around this, is to generate a fake config
by running "make defconfig", then "make package/symlinks", copy the real
config (which at this point disregards the previously generated config),
and run make defconfig again. Something like this:

make defconfig
make package/symlinks
cp real.config .config
make defconfig

This change is removing the need for the first defconfig, making the
process more logical for OpenWrt users using the package/symlinks target.

Signed-off-by: Mathieu Olivari 
---
 Makefile| 14 --
 include/toplevel.mk | 14 ++
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index 2b08d30..2499304 100644
--- a/Makefile
+++ b/Makefile
@@ -86,20 +86,6 @@ prepare: .config $(tools/stamp-install) 
$(toolchain/stamp-install)
 world: prepare $(target/stamp-compile) $(package/stamp-compile) 
$(package/stamp-install) $(target/stamp-install) FORCE
$(_SINGLE)$(SUBMAKE) -r package/index
 
-# update all feeds, re-create index files, install symlinks
-package/symlinks:
-   $(SCRIPT_DIR)/feeds update -a
-   $(SCRIPT_DIR)/feeds install -a
-
-# re-create index files, install symlinks
-package/symlinks-install:
-   $(SCRIPT_DIR)/feeds update -i
-   $(SCRIPT_DIR)/feeds install -a
-
-# remove all symlinks, don't touch ./feeds
-package/symlinks-clean:
-   $(SCRIPT_DIR)/feeds uninstall -a
-
 .PHONY: clean dirclean prereq prepare world package/symlinks 
package/symlinks-install package/symlinks-clean
 
 endif
diff --git a/include/toplevel.mk b/include/toplevel.mk
index d8651d9..bbeb7eb 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -193,6 +193,20 @@ else
 
 endif
 
+# update all feeds, re-create index files, install symlinks
+package/symlinks:
+   ./scripts/feeds update -a
+   ./scripts/feeds install -a
+
+# re-create index files, install symlinks
+package/symlinks-install:
+   ./scripts/feeds update -i
+   ./scripts/feeds install -a
+
+# remove all symlinks, don't touch ./feeds
+package/symlinks-clean:
+   ./scripts/feeds uninstall -a
+
 help:
cat README
 
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/5] argp-standalone: import package from packages.git

2015-05-18 Thread Mathieu Olivari
argp-standalone is required by elfutils, itself required by perf. So
we'll move this package from packages.git and make it part of the core
distribution.

Signed-off-by: Mathieu Olivari 
---
 package/libs/argp-standalone/Makefile  | 48 +
 .../patches/001-throw-in-funcdef.patch | 79 ++
 2 files changed, 127 insertions(+)
 create mode 100644 package/libs/argp-standalone/Makefile
 create mode 100644 
package/libs/argp-standalone/patches/001-throw-in-funcdef.patch

diff --git a/package/libs/argp-standalone/Makefile 
b/package/libs/argp-standalone/Makefile
new file mode 100644
index 000..8cf23fe
--- /dev/null
+++ b/package/libs/argp-standalone/Makefile
@@ -0,0 +1,48 @@
+#
+# Copyright (C) 2007-2014 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:=argp-standalone
+PKG_VERSION:=1.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.lysator.liu.se/~nisse/misc/
+PKG_MD5SUM:=720704bac078d067111b32444e24ba69
+PKG_MAINTAINER:=Ted Hess 
+
+PKG_LICENSE:=LGPL-2.1
+PKG_LICENSE:=Makefile.am
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/argp-standalone
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Hierarchial argument parsing broken out from glibc
+  URL:=http://www.lysator.liu.se/~nisse/misc/
+endef
+
+define Package/argp-standalone/description
+  GNU libc hierarchial argument parsing library broken out from glibc.
+endef
+
+MAKE_FLAGS += \
+   CFLAGS="$(TARGET_CFLAGS) $(FPIC)"
+
+
+define Build/InstallDev
+   $(INSTALL_DIR) $(1)/usr/include
+   $(CP)   $(PKG_BUILD_DIR)/argp.h \
+   $(1)/usr/include/
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP)   $(PKG_BUILD_DIR)/libargp.a \
+   $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,argp-standalone))
diff --git a/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch 
b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch
new file mode 100644
index 000..4a90751
--- /dev/null
+++ b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch
@@ -0,0 +1,79 @@
+# --- T2-COPYRIGHT-NOTE-BEGIN ---
+# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
+# 
+# T2 SDE: package/.../rng-tools/throw-in-funcdef.patch.argp-standalone
+# Copyright (C) 2006 The T2 SDE Project
+# 
+# More information can be found in the files COPYING and README.
+# 
+# This patch file is dual-licensed. It is available under the license the
+# patched project is licensed under, as long as it is an OpenSource license
+# as defined at http://www.opensource.org/ (e.g. BSD, X11) or 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.
+# --- T2-COPYRIGHT-NOTE-END ---
+
+
+No __THROW in function implementation.
+   --jsaw
+
+--- argp-standalone-1.4-test2/argp.h.orig  2006-01-06 02:29:59.0 
+0100
 argp-standalone-1.4-test2/argp.h   2006-01-06 02:41:10.0 +0100
+@@ -560,17 +560,17 @@
+ # endif
+ 
+ # ifndef ARGP_EI
+-#  define ARGP_EI extern __inline__
++#  define ARGP_EI extern inline
+ # endif
+ 
+ ARGP_EI void
+-__argp_usage (__const struct argp_state *__state) __THROW
++__argp_usage (__const struct argp_state *__state)
+ {
+   __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+ }
+ 
+ ARGP_EI int
+-__option_is_short (__const struct argp_option *__opt) __THROW
++__option_is_short (__const struct argp_option *__opt)
+ {
+   if (__opt->flags & OPTION_DOC)
+ return 0;
+@@ -582,7 +582,7 @@
+ }
+ 
+ ARGP_EI int
+-__option_is_end (__const struct argp_option *__opt) __THROW
++__option_is_end (__const struct argp_option *__opt)
+ {
+   return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+ }
+--- argp-standalone-1.4-test2/argp-parse.c.orig2006-01-06 
02:47:48.0 +0100
 argp-standalone-1.4-test2/argp-parse.c 2006-01-06 02:48:16.0 
+0100
+@@ -1290,13 +1290,13 @@
+ /* Defined here, in case a user is not inlining the definitions in
+  * argp.h */
+ void
+-__argp_usage (__const struct argp_state *__state) __THROW
++__argp_usage (__const struct argp_state *__state)
+ {
+   __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+ }
+ 
+ int
+-__option_is_short (__const struct argp_option *__opt) __THROW
++__option_is_short (__const struct argp_option *__opt) 
+ {
+   if (__opt->flags & OPTION_DOC)
+ return 0;
+@@ -1310,7 +1310,7 @@
+ }
+ 
+ int
+-__option_is_end (__const struct argp_option *__opt) __THROW
++__option_is_end (__const struct argp_option *__opt) 
+ {
+   return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+ }
-- 
2.1.4
___

[OpenWrt-Devel] [PATCH 0/5] perf: fix dependencies & restore uClibc compatibility

2015-05-18 Thread Mathieu Olivari
Commit 9cddeba3a4eb00e85233f0b8ac84b8e8492822ef was removing uClibc
support from perf because it didn't build anymore.
The root cause of this failure was multiple:
*perf needs a uClibc patch to define STT_GNU_IFUNC. Patch has been done
 already to the uClibc project, and just needs to be cherry-picked to
 OpenWrt.
*perf was moved to openwrt.git, but libelf1 (in its dependencies) is
 still located in packages.git. So it ends-up compiling without libelf
 support.

This change set fixes these issues by adding the patch and importing the
missing packages, which allows us to remove the dependency perf has on
eglibc.

Mathieu Olivari (5):
  uClibc: elf: Add STT_GNU_IFUNC from glibc
  argp-standalone: import package from packages.git
  elfutils: import package from packages.git
  bzip2: import package from packages.git
  perf: remove EGLIBC dependency

 package/devel/perf/Makefile|2 +-
 package/libs/argp-standalone/Makefile  |   48 +
 .../patches/001-throw-in-funcdef.patch |   79 +
 package/libs/elfutils/Makefile |   97 +
 .../patches/001-elfutils-portability.patch | 1871 
 .../elfutils/patches/002-argp_standalone.patch |   14 +
 .../libs/elfutils/patches/003-libint-stub.patch|   49 +
 .../elfutils/patches/004-maybe-uninitialized.patch |   11 +
 package/libs/elfutils/patches/004-memcpy_def.patch |   14 +
 .../elfutils/patches/005-build_only_libs.patch |   24 +
 package/libs/elfutils/patches/006-libdw_LIBS.patch |   11 +
 .../libs/elfutils/patches/100-musl-compat.patch|  788 +
 package/libs/elfutils/patches/101-no-fts.patch |  109 ++
 package/utils/bzip2/Makefile   |   87 +
 .../012-elf-Add-STT_GNU_IFUNC-from-glibc.patch |   37 +
 15 files changed, 3240 insertions(+), 1 deletion(-)
 create mode 100644 package/libs/argp-standalone/Makefile
 create mode 100644 
package/libs/argp-standalone/patches/001-throw-in-funcdef.patch
 create mode 100644 package/libs/elfutils/Makefile
 create mode 100644 package/libs/elfutils/patches/001-elfutils-portability.patch
 create mode 100644 package/libs/elfutils/patches/002-argp_standalone.patch
 create mode 100644 package/libs/elfutils/patches/003-libint-stub.patch
 create mode 100644 package/libs/elfutils/patches/004-maybe-uninitialized.patch
 create mode 100644 package/libs/elfutils/patches/004-memcpy_def.patch
 create mode 100644 package/libs/elfutils/patches/005-build_only_libs.patch
 create mode 100644 package/libs/elfutils/patches/006-libdw_LIBS.patch
 create mode 100644 package/libs/elfutils/patches/100-musl-compat.patch
 create mode 100644 package/libs/elfutils/patches/101-no-fts.patch
 create mode 100644 package/utils/bzip2/Makefile
 create mode 100644 
toolchain/uClibc/patches-0.9.33.2/012-elf-Add-STT_GNU_IFUNC-from-glibc.patch

-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 5/5] perf: remove EGLIBC dependency

2015-05-18 Thread Mathieu Olivari
EGLIBC dependency was required as libelf was not found. But we now fixed
the root cause, so we can remove it. perf works with uClibc again.

Signed-off-by: Mathieu Olivari 
---
 package/devel/perf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile
index b77e29a..86363ee 100644
--- a/package/devel/perf/Makefile
+++ b/package/devel/perf/Makefile
@@ -19,7 +19,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/perf
   SECTION:=devel
   CATEGORY:=Development
-  DEPENDS:= @USE_GLIBC +libelf1 +libdw +libpthread +librt +binutils
+  DEPENDS:= +libelf1 +libdw +libpthread +librt +binutils
   TITLE:=Linux performance monitoring tool
   VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
   URL:=http://www.kernel.org
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/5] uClibc: elf: Add STT_GNU_IFUNC from glibc

2015-05-18 Thread Mathieu Olivari
perf in upstream Linux kernel 3.17 onwards expects STT_GNU_IFUNC
replicate it from glibc

Patch cherry-picked from:
http://lists.busybox.net/pipermail/uclibc/2015-February/048825.html

Signed-off-by: Mathieu Olivari 
---
 .../012-elf-Add-STT_GNU_IFUNC-from-glibc.patch | 37 ++
 1 file changed, 37 insertions(+)
 create mode 100644 
toolchain/uClibc/patches-0.9.33.2/012-elf-Add-STT_GNU_IFUNC-from-glibc.patch

diff --git 
a/toolchain/uClibc/patches-0.9.33.2/012-elf-Add-STT_GNU_IFUNC-from-glibc.patch 
b/toolchain/uClibc/patches-0.9.33.2/012-elf-Add-STT_GNU_IFUNC-from-glibc.patch
new file mode 100644
index 000..6cecfaa
--- /dev/null
+++ 
b/toolchain/uClibc/patches-0.9.33.2/012-elf-Add-STT_GNU_IFUNC-from-glibc.patch
@@ -0,0 +1,37 @@
+From be58779614b2fe9aa57a9315be9dc004dfd77b3b Mon Sep 17 00:00:00 2001
+From: Vineet Gupta 
+Date: Fri, 20 Feb 2015 15:27:08 +0530
+Subject: [PATCH] elf: Add STT_GNU_IFUNC from glibc
+
+perf in upstream Linux kernel 3.17 onwards expects STT_GNU_IFUNC
+replicate it from glibc
+
+Signed-off-by: Vineet Gupta 
+Signed-off-by: Bernhard Reutner-Fischer 
+---
+ include/elf.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/elf.h b/include/elf.h
+index facf09c..917930b 100644
+--- a/include/elf.h
 b/include/elf.h
+@@ -566,6 +566,7 @@ typedef struct
+ #define STB_WEAK  2   /* Weak symbol */
+ #define   STB_NUM 3   /* Number of defined types.  */
+ #define STB_LOOS  10  /* Start of OS-specific */
++#define STB_GNU_UNIQUE10  /* Unique symbol.  */
+ #define STB_HIOS  12  /* End of OS-specific */
+ #define STB_LOPROC13  /* Start of processor-specific */
+ #define STB_HIPROC15  /* End of processor-specific */
+@@ -581,6 +582,7 @@ typedef struct
+ #define STT_TLS   6   /* Symbol is thread-local data 
object*/
+ #define   STT_NUM 7   /* Number of defined types.  */
+ #define STT_LOOS  10  /* Start of OS-specific */
++#define STT_GNU_IFUNC 10  /* Symbol is indirect code object */
+ #define STT_HIOS  12  /* End of OS-specific */
+ #define STT_LOPROC13  /* Start of processor-specific */
+ #define STT_HIPROC15  /* End of processor-specific */
+-- 
+2.1.4
+
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/5] bzip2: import package from packages.git

2015-05-18 Thread Mathieu Olivari
bzip2 is required by elfutils, itself required by perf. So we'll move
this package from packages.git and make it part of the core
distribution.

Signed-off-by: Mathieu Olivari 
---
 package/utils/bzip2/Makefile | 87 
 1 file changed, 87 insertions(+)
 create mode 100644 package/utils/bzip2/Makefile

diff --git a/package/utils/bzip2/Makefile b/package/utils/bzip2/Makefile
new file mode 100644
index 000..493ccc9
--- /dev/null
+++ b/package/utils/bzip2/Makefile
@@ -0,0 +1,87 @@
+#
+# Copyright (C) 2007-2008 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:=bzip2
+PKG_VERSION:=1.0.6
+PKG_RELEASE:=2
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=http://www.bzip.org/$(PKG_VERSION)
+PKG_MD5SUM:=00b516f4704d4a7cb50a1d97e6e8e15b
+PKG_MAINTAINER:=Steven Barth 
+
+PKG_LICENSE:=BZIP2
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/bzip2/Default
+  SUBMENU:=Compression
+  URL:=http://www.bzip.org/
+endef
+
+define Package/libbz2
+$(call Package/bzip2/Default)
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=
+  TITLE:=bzip2 library.
+endef
+
+define Package/libbz2/description
+   bzip2 is a freely available, patent free, high-quality
+   data compressor. This packages provides libbz2 library.
+endef
+
+define Package/bzip2
+$(call Package/bzip2/Default)
+  SECTION:=utils
+  CATEGORY:=Utilities
+  DEPENDS:=+libbz2
+  TITLE:=bzip2 is a compression utility.
+endef
+
+define Package/bzip2/description
+   bzip2 is a freely available, patent free, high-quality
+   data compressor. This package provides the binary.
+endef
+
+TARGET_CFLAGS += \
+   $(FPIC) \
+   $(TARGET_LDFLAGS)
+
+CONFIGURE_ARGS += --prefix=/usr
+
+MAKE_FLAGS += \
+   -f Makefile-libbz2_so \
+   CFLAGS="$(TARGET_CFLAGS)" \
+   all
+
+define Build/InstallDev
+   $(INSTALL_DIR) $(1)/usr/include
+   $(CP) $(PKG_BUILD_DIR)/bzlib.h $(1)/usr/include/
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) $(PKG_BUILD_DIR)/libbz2.so.$(PKG_VERSION) $(1)/usr/lib/
+   $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so.1.0
+   $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so
+endef
+
+define Package/libbz2/install
+   $(INSTALL_DIR) $(1)/usr/lib/
+   $(CP) $(PKG_BUILD_DIR)/libbz2.so.$(PKG_VERSION) $(1)/usr/lib/
+   $(LN) libbz2.so.$(PKG_VERSION) $(1)/usr/lib/libbz2.so.1.0
+endef
+
+define Package/bzip2/install
+   $(INSTALL_DIR) $(1)/usr/bin/
+   $(INSTALL_BIN) $(PKG_BUILD_DIR)/bzip2-shared $(1)/usr/bin/bzip2
+endef
+
+$(eval $(call BuildPackage,libbz2))
+$(eval $(call BuildPackage,bzip2))
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/5] elfutils: import package from packages.git

2015-05-18 Thread Mathieu Olivari
elfutils is required by perf. So we'll move this package from
packages.git and make it part of the core distribution.

Signed-off-by: Mathieu Olivari 
---
 package/libs/elfutils/Makefile |   97 +
 .../patches/001-elfutils-portability.patch | 1871 
 .../elfutils/patches/002-argp_standalone.patch |   14 +
 .../libs/elfutils/patches/003-libint-stub.patch|   49 +
 .../elfutils/patches/004-maybe-uninitialized.patch |   11 +
 package/libs/elfutils/patches/004-memcpy_def.patch |   14 +
 .../elfutils/patches/005-build_only_libs.patch |   24 +
 package/libs/elfutils/patches/006-libdw_LIBS.patch |   11 +
 .../libs/elfutils/patches/100-musl-compat.patch|  788 +
 package/libs/elfutils/patches/101-no-fts.patch |  109 ++
 10 files changed, 2988 insertions(+)
 create mode 100644 package/libs/elfutils/Makefile
 create mode 100644 package/libs/elfutils/patches/001-elfutils-portability.patch
 create mode 100644 package/libs/elfutils/patches/002-argp_standalone.patch
 create mode 100644 package/libs/elfutils/patches/003-libint-stub.patch
 create mode 100644 package/libs/elfutils/patches/004-maybe-uninitialized.patch
 create mode 100644 package/libs/elfutils/patches/004-memcpy_def.patch
 create mode 100644 package/libs/elfutils/patches/005-build_only_libs.patch
 create mode 100644 package/libs/elfutils/patches/006-libdw_LIBS.patch
 create mode 100644 package/libs/elfutils/patches/100-musl-compat.patch
 create mode 100644 package/libs/elfutils/patches/101-no-fts.patch

diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile
new file mode 100644
index 000..d3e1552
--- /dev/null
+++ b/package/libs/elfutils/Makefile
@@ -0,0 +1,97 @@
+#
+# Copyright (C) 2010-2014 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:=elfutils
+PKG_VERSION:=0.161
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://fedorahosted.org/releases/e/l/$(PKG_NAME)/$(PKG_VERSION)
+PKG_MD5SUM:=e1b9847c9a6a1ad340de8d47a863ec52
+PKG_MAINTAINER:=Luiz Angelo Daros de Luca 
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3
+
+PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
+
+PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/elfutils/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=$(INTL_DEPENDS)
+  TITLE:=ELF manipulation libraries
+  URL:=https://fedorahosted.org/elfutils/
+endef
+
+define Package/libasm
+  $(call Package/elfutils/Default)
+  TITLE+= (libasm)
+  DEPENDS:=libelf1
+endef
+
+define Package/libdw
+  $(call Package/elfutils/Default)
+  DEPENDS:=libelf1 +zlib +libbz2
+  TITLE+= (libdw)
+endef
+
+define Package/libelf1
+  $(call Package/elfutils/Default)
+  TITLE+= (libelf)
+endef
+
+ifeq ($(CONFIG_BUILD_NLS),y)
+TARGET_LDFLAGS += "-lintl"
+endif
+
+ifdef CONFIG_USE_UCLIBC
+CONFIGURE_VARS += \
+   LIBS="-largp"
+endif
+
+ifdef CONFIG_USE_MUSL
+CONFIGURE_VARS += \
+   LIBS="-largp"
+endif
+
+CONFIGURE_ARGS += \
+   --disable-werror \
+   --without-lzma
+
+define Build/InstallDev
+   $(INSTALL_DIR) $(1)/usr/include
+   $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) $(PKG_BUILD_DIR)/libasm/libasm.{a,so*} $(1)/usr/lib/
+   $(CP) $(PKG_BUILD_DIR)/libdw/libdw.{a,so*} $(1)/usr/lib/
+   $(CP) $(PKG_BUILD_DIR)/libelf/libelf.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libasm/install
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) $(PKG_BUILD_DIR)/libasm/libasm.so* $(1)/usr/lib/
+endef
+
+define Package/libdw/install
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) $(PKG_BUILD_DIR)/libdw/libdw.so* $(1)/usr/lib/
+endef
+
+define Package/libelf1/install
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) $(PKG_BUILD_DIR)/libelf/libelf.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libasm))
+$(eval $(call BuildPackage,libdw))
+$(eval $(call BuildPackage,libelf1))
diff --git a/package/libs/elfutils/patches/001-elfutils-portability.patch 
b/package/libs/elfutils/patches/001-elfutils-portability.patch
new file mode 100644
index 000..7539f8b
--- /dev/null
+++ b/package/libs/elfutils/patches/001-elfutils-portability.patch
@@ -0,0 +1,1871 @@
+--- elfutils/backends/ChangeLog
 elfutils/backends/ChangeLog
+@@ -433,6 +433,10 @@
+   * ppc_attrs.c (ppc_check_object_attribute): Handle tag
+   GNU_Power_ABI_Struct_Return.
+ 
++2009-01-23  Roland McGrath  
++
++  * Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
++
+ 2008-10-04  Ulrich Drepper  
+ 
+   * i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
+@@ -760,6 +764,11 @@
+   * sparc_init.c: Likewise.
+   * x86_64_init.c: Likewise.
+ 
++2005-11-22  Roland

Re: [OpenWrt-Devel] [PATCH 3/5] elfutils: import package from packages.git

2015-05-18 Thread Mathieu Olivari
Yeah; I actually wondered the same question. I’m not sure what we should happen 
in this case.
I’ll let blogic replied as he’s the one who moved perf into openwrt.git.
If these packages are required by the OpenWrt core, then one of the openwrt.git 
maintainer would probably own it. I’m not sure :s
Thanks,
Mathieu


From: Luiz Angelo Daros de Luca [mailto:luizl...@gmail.com] 
Sent: Monday, May 18, 2015 6:43 PM
To: Mathieu Olivari; blo...@openwrt.org
Cc: mmccl...@codeaurora.org; openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH 3/5] elfutils: import package from 
packages.git

I'm curious, as current elfutils packager, how I should play in this import?
Should this package be removed from package.git (but there is no PR for it)?
Or will it be periodically synchronized with packages.git?
Also, as I'm not a core developer, maybe it would be better to a core developer 
to take its maintainance.
Regards,

Em seg, 18 de mai de 2015 20:45, Mathieu Olivari  
escreveu:
elfutils is required by perf. So we'll move this package from
packages.git and make it part of the core distribution.

Signed-off-by: Mathieu Olivari 
---
 package/libs/elfutils/Makefile |   97 +
 .../patches/001-elfutils-portability.patch | 1871 
 .../elfutils/patches/002-argp_standalone.patch |   14 +
 .../libs/elfutils/patches/003-libint-stub.patch|   49 +
 .../elfutils/patches/004-maybe-uninitialized.patch |   11 +
 package/libs/elfutils/patches/004-memcpy_def.patch |   14 +
 .../elfutils/patches/005-build_only_libs.patch |   24 +
 package/libs/elfutils/patches/006-libdw_LIBS.patch |   11 +
 .../libs/elfutils/patches/100-musl-compat.patch|  788 +
 package/libs/elfutils/patches/101-no-fts.patch |  109 ++
 10 files changed, 2988 insertions(+)
 create mode 100644 package/libs/elfutils/Makefile
 create mode 100644 package/libs/elfutils/patches/001-elfutils-portability.patch
 create mode 100644 package/libs/elfutils/patches/002-argp_standalone.patch
 create mode 100644 package/libs/elfutils/patches/003-libint-stub.patch
 create mode 100644 package/libs/elfutils/patches/004-maybe-uninitialized.patch
 create mode 100644 package/libs/elfutils/patches/004-memcpy_def.patch
 create mode 100644 package/libs/elfutils/patches/005-build_only_libs.patch
 create mode 100644 package/libs/elfutils/patches/006-libdw_LIBS.patch
 create mode 100644 package/libs/elfutils/patches/100-musl-compat.patch
 create mode 100644 package/libs/elfutils/patches/101-no-fts.patch

diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile
new file mode 100644
index 000..d3e1552
--- /dev/null
+++ b/package/libs/elfutils/Makefile
@@ -0,0 +1,97 @@
+#
+# Copyright (C) 2010-2014 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:=elfutils
+PKG_VERSION:=0.161
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://fedorahosted.org/releases/e/l/$(PKG_NAME)/$(PKG_VERSION)
+PKG_MD5SUM:=e1b9847c9a6a1ad340de8d47a863ec52
+PKG_MAINTAINER:=Luiz Angelo Daros de Luca 
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3
+
+PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
+
+PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/elfutils/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=$(INTL_DEPENDS)
+  TITLE:=ELF manipulation libraries
+  URL:=https://fedorahosted.org/elfutils/
+endef
+
+define Package/libasm
+  $(call Package/elfutils/Default)
+  TITLE+= (libasm)
+  DEPENDS:=libelf1
+endef
+
+define Package/libdw
+  $(call Package/elfutils/Default)
+  DEPENDS:=libelf1 +zlib +libbz2
+  TITLE+= (libdw)
+endef
+
+define Package/libelf1
+  $(call Package/elfutils/Default)
+  TITLE+= (libelf)
+endef
+
+ifeq ($(CONFIG_BUILD_NLS),y)
+TARGET_LDFLAGS += "-lintl"
+endif
+
+ifdef CONFIG_USE_UCLIBC
+CONFIGURE_VARS += \
+   LIBS="-largp"
+endif
+
+ifdef CONFIG_USE_MUSL
+CONFIGURE_VARS += \
+   LIBS="-largp"
+endif
+
+CONFIGURE_ARGS += \
+   --disable-werror \
+   --without-lzma
+
+define Build/InstallDev
+   $(INSTALL_DIR) $(1)/usr/include
+   $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) $(PKG_BUILD_DIR)/libasm/libasm.{a,so*} $(1)/usr/lib/
+   $(CP) $(PKG_BUILD_DIR)/libdw/libdw.{a,so*} $(1)/usr/lib/
+   $(CP) $(PKG_BUILD_DIR)/libelf/libelf.{a,so*} $(1)/usr/lib/
+endef
+
+define Package/libasm/install
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) $(PKG_BUILD_DIR)/libasm/libasm.so* $(1)/usr/lib/
+endef
+
+define Package/libdw/install
+   $(INSTALL_DIR) $(1)/usr/lib
+   $(CP) $(PKG_BUILD_DIR)/libdw/libdw.so* $(1)/usr/lib/
+endef
+
+define Package/libelf1/install
+  

Re: [OpenWrt-Devel] [PATCH 3/5] elfutils: import package from packages.git

2015-05-18 Thread Mathieu Olivari
I just realized I only replied to part of the question. They should also 
probably be deleted from packages.git.
OpenWrt will ignore them anyway unless the override mechanism is used when 
installing the feeds. 

-Original Message-
From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On Behalf 
Of Mathieu Olivari
Sent: Monday, May 18, 2015 7:32 PM
To: 'Luiz Angelo Daros de Luca'; blo...@openwrt.org
Cc: mmccl...@codeaurora.org; openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH 3/5] elfutils: import package from 
packages.git

Yeah; I actually wondered the same question. I’m not sure what we should happen 
in this case.
I’ll let blogic replied as he’s the one who moved perf into openwrt.git.
If these packages are required by the OpenWrt core, then one of the openwrt.git 
maintainer would probably own it. I’m not sure :s
Thanks,
Mathieu


From: Luiz Angelo Daros de Luca [mailto:luizl...@gmail.com] 
Sent: Monday, May 18, 2015 6:43 PM
To: Mathieu Olivari; blo...@openwrt.org
Cc: mmccl...@codeaurora.org; openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH 3/5] elfutils: import package from 
packages.git

I'm curious, as current elfutils packager, how I should play in this import?
Should this package be removed from package.git (but there is no PR for it)?
Or will it be periodically synchronized with packages.git?
Also, as I'm not a core developer, maybe it would be better to a core developer 
to take its maintainance.
Regards,

Em seg, 18 de mai de 2015 20:45, Mathieu Olivari  
escreveu:
elfutils is required by perf. So we'll move this package from
packages.git and make it part of the core distribution.

Signed-off-by: Mathieu Olivari 
---
 package/libs/elfutils/Makefile |   97 +
 .../patches/001-elfutils-portability.patch | 1871 
 .../elfutils/patches/002-argp_standalone.patch |   14 +
 .../libs/elfutils/patches/003-libint-stub.patch|   49 +
 .../elfutils/patches/004-maybe-uninitialized.patch |   11 +
 package/libs/elfutils/patches/004-memcpy_def.patch |   14 +
 .../elfutils/patches/005-build_only_libs.patch |   24 +
 package/libs/elfutils/patches/006-libdw_LIBS.patch |   11 +
 .../libs/elfutils/patches/100-musl-compat.patch|  788 +
 package/libs/elfutils/patches/101-no-fts.patch |  109 ++
 10 files changed, 2988 insertions(+)
 create mode 100644 package/libs/elfutils/Makefile
 create mode 100644 package/libs/elfutils/patches/001-elfutils-portability.patch
 create mode 100644 package/libs/elfutils/patches/002-argp_standalone.patch
 create mode 100644 package/libs/elfutils/patches/003-libint-stub.patch
 create mode 100644 package/libs/elfutils/patches/004-maybe-uninitialized.patch
 create mode 100644 package/libs/elfutils/patches/004-memcpy_def.patch
 create mode 100644 package/libs/elfutils/patches/005-build_only_libs.patch
 create mode 100644 package/libs/elfutils/patches/006-libdw_LIBS.patch
 create mode 100644 package/libs/elfutils/patches/100-musl-compat.patch
 create mode 100644 package/libs/elfutils/patches/101-no-fts.patch

diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile
new file mode 100644
index 000..d3e1552
--- /dev/null
+++ b/package/libs/elfutils/Makefile
@@ -0,0 +1,97 @@
+#
+# Copyright (C) 2010-2014 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:=elfutils
+PKG_VERSION:=0.161
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=http://fedorahosted.org/releases/e/l/$(PKG_NAME)/$(PKG_VERSION)
+PKG_MD5SUM:=e1b9847c9a6a1ad340de8d47a863ec52
+PKG_MAINTAINER:=Luiz Angelo Daros de Luca 
+PKG_LICENSE:=GPL-3.0+
+PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3
+
+PKG_INSTALL:=1
+PKG_USE_MIPS16:=0
+
+PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/nls.mk
+
+define Package/elfutils/Default
+  SECTION:=libs
+  CATEGORY:=Libraries
+  DEPENDS:=$(INTL_DEPENDS)
+  TITLE:=ELF manipulation libraries
+  URL:=https://fedorahosted.org/elfutils/
+endef
+
+define Package/libasm
+  $(call Package/elfutils/Default)
+  TITLE+= (libasm)
+  DEPENDS:=libelf1
+endef
+
+define Package/libdw
+  $(call Package/elfutils/Default)
+  DEPENDS:=libelf1 +zlib +libbz2
+  TITLE+= (libdw)
+endef
+
+define Package/libelf1
+  $(call Package/elfutils/Default)
+  TITLE+= (libelf)
+endef
+
+ifeq ($(CONFIG_BUILD_NLS),y)
+TARGET_LDFLAGS += "-lintl"
+endif
+
+ifdef CONFIG_USE_UCLIBC
+CONFIGURE_VARS += \
+   LIBS="-largp"
+endif
+
+ifdef CONFIG_USE_MUSL
+CONFIGURE_VARS += \
+   LIBS="-largp"
+endif
+
+CONFIGURE_ARGS += \
+   --disable-werror \
+   --without-lzma
+
+define Build/InstallDev
+   $(INSTALL_DIR) $(1)/usr/include
+   $(CP) $(PKG_INSTALL_DIR)/usr/include/

[OpenWrt-Devel] [PATCH] generic/4.0: fix error during kernel patch application

2015-05-20 Thread Mathieu Olivari
Commit 5168c9a5702648eb690d32ec821647aca80aeba9 introduced a regression
during patch application on the 4.0 kernel. Some of the patched content
doesn't match the actual code, therefore leading to the following error:
  Applying patch 
generic/667-ipv6-Fixed-source-specific-default-route-handling.patch
  patching file net/ipv6/ip6_output.c
  Hunk #1 FAILED at 886.
  1 out of 1 hunk FAILED -- rejects in file net/ipv6/ip6_output.c
  patching file net/ipv6/route.c
  Hunk #1 succeeded at 2247 (offset 2 lines).
  Patch generic/667-ipv6-Fixed-source-specific-default-route-handling.patch 
does not apply (enforce with -f)

This change just adapts the actual patch to fix what is in kernel 4.0
and make it apply cleanly.

Signed-off-by: Mathieu Olivari 
---
 ...-ipv6-Fixed-source-specific-default-route-handling.patch | 13 +++--
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git 
a/target/linux/generic/patches-4.0/667-ipv6-Fixed-source-specific-default-route-handling.patch
 
b/target/linux/generic/patches-4.0/667-ipv6-Fixed-source-specific-default-route-handling.patch
index b5cc76d..50ac1db 100644
--- 
a/target/linux/generic/patches-4.0/667-ipv6-Fixed-source-specific-default-route-handling.patch
+++ 
b/target/linux/generic/patches-4.0/667-ipv6-Fixed-source-specific-default-route-handling.patch
@@ -24,15 +24,13 @@ Signed-off-by: David S. Miller 
  net/ipv6/route.c  |  5 +++--
  2 files changed, 34 insertions(+), 10 deletions(-)
 
-diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
-index 7fde1f2..c217775 100644
 --- a/net/ipv6/ip6_output.c
 +++ b/net/ipv6/ip6_output.c
-@@ -886,22 +886,45 @@ static int ip6_dst_lookup_tail(struct sock *sk,
+@@ -883,22 +883,45 @@ static int ip6_dst_lookup_tail(struct so
  #endif
int err;
  
--  if (!*dst)
+-  if (*dst == NULL)
 -  *dst = ip6_route_output(net, sk, fl6);
 -
 -  err = (*dst)->error;
@@ -82,11 +80,9 @@ index 7fde1f2..c217775 100644
  #ifdef CONFIG_IPV6_OPTIMISTIC_DAD
/*
 * Here if the dst entry we've looked up
-diff --git a/net/ipv6/route.c b/net/ipv6/route.c
-index 5c48293..d35 100644
 --- a/net/ipv6/route.c
 +++ b/net/ipv6/route.c
-@@ -2245,9 +2245,10 @@ int ip6_route_get_saddr(struct net *net,
+@@ -2247,9 +2247,10 @@ int ip6_route_get_saddr(struct net *net,
unsigned int prefs,
struct in6_addr *saddr)
  {
@@ -99,6 +95,3 @@ index 5c48293..d35 100644
*saddr = rt->rt6i_prefsrc.addr;
else
err = ipv6_dev_get_saddr(net, idev ? idev->dev : NULL,
--- 
-2.1.4
-
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/5] ipq806x: add frequency scaling support

2015-05-20 Thread Mathieu Olivari
Currently, the IPQ is underclocked and running at whatever frequency was
previously set in the bootloader. This change is done to get it to run
up to max speed (1.4GHz). Different speed requiring different voltage,
we also add support for the power regulators.

Most of these patches are cherry-picked from linux-next and LKML, with a
couple of fixes and backports here and there.

Mathieu Olivari (5):
  ipq806x: refresh kernel patches
  ipq806x: disable i2c device on gsbi4
  ipq806x: add power regulators support
  ipq806x: add & enable cpufreq support
  ipq806x: enable cpu idle support in kernel conf

 target/linux/ipq806x/config-3.18   |  33 +-
 target/linux/ipq806x/config-4.0|  33 +-
 ...atchdog-qcom-use-timer-devicetree-binding.patch |  11 +-
 ...m-add-description-of-KPSS-WDT-for-IPQ8064.patch |   5 -
 .../ipq806x/patches-3.18/022-add-db149-dts.patch   |   8 -
 ...M-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch |  53 ++
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   2 +-
 ...qcom-gsbi-Add-support-for-ADM-CRCI-muxing.patch |  15 +-
 ...CI-qcom-Document-PCIe-devicetree-bindings.patch |   3 -
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   2 +-
 ...-mfd-qcom-rpm-Driver-for-the-Qualcomm-RPM.patch | 654 +
 .../121-mfd-qcom_rpm-Add-support-for-IPQ8064.patch |  71 +++
 ...tree-bindings-Add-Qualcomm-RPM-DT-binding.patch | 256 
 ...etree-qcom_rpm-Document-IPQ8064-resources.patch |  42 ++
 ...rpm-add-support-for-RPM-controller-SMB208.patch |  63 ++
 ...com-rpm-Add-missing-state-flag-in-call-to.patch |  30 +
 .../patches-3.18/126-add-rpm-to-ipq8064-dts.patch  |  87 +++
 ...-set_parent-doing-the-wrong-thing-when-IN.patch |  60 ++
 ...-clk-Add-__clk_mux_determine_rate_closest.patch | 120 
 ..._unregister_-divider-gate-mux-to-close-me.patch | 115 
 ...-Add-Krait-L2-register-accessor-functions.patch | 144 +
 ...ux-Split-out-register-accessors-for-reuse.patch | 192 ++
 ...ates-to-downstream-clocks-during-set_rate.patch | 129 
 .../136-clk-Add-safe-switch-hook.patch | 170 ++
 ...dd-support-for-High-Frequency-PLLs-HFPLLs.patch | 351 +++
 .../138-clk-qcom-Add-HFPLL-driver.patch| 206 +++
 .../139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch| 127 
 ...140-clk-qcom-Add-support-for-Krait-clocks.patch | 271 +
 .../141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch | 205 +++
 ...lk-qcom-Add-Krait-clock-controller-driver.patch | 435 ++
 ...-module-to-register-cpufreq-on-Krait-CPUs.patch | 304 ++
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch | 100 
 ...ufreq-Add-a-cpufreq-krait-based-on-cpufre.patch | 461 +++
 .../300-arch-arm-force-ZRELADDR-on-arch-qcom.patch |  12 +-
 .../patches-3.18/700-add-gmac-dts-suport.patch |  10 +-
 .../001-spi-qup-Add-DMA-capabilities.patch |  12 +-
 ...atchdog-qcom-use-timer-devicetree-binding.patch |  11 +-
 ...m-add-description-of-KPSS-WDT-for-IPQ8064.patch |   5 -
 .../ipq806x/patches-4.0/022-add-db149-dts.patch|  10 +-
 ...M-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch |  53 ++
 ...CI-qcom-Document-PCIe-devicetree-bindings.patch |   3 -
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   2 +-
 .../121-mfd-qcom_rpm-Add-support-for-IPQ8064.patch |  71 +++
 ...etree-qcom_rpm-Document-IPQ8064-resources.patch |  42 ++
 .../patches-4.0/126-add-rpm-to-ipq8064-dts.patch   |  87 +++
 ...-Add-Krait-L2-register-accessor-functions.patch | 144 +
 ...ux-Split-out-register-accessors-for-reuse.patch | 192 ++
 ...ates-to-downstream-clocks-during-set_rate.patch | 130 
 .../patches-4.0/136-clk-Add-safe-switch-hook.patch | 164 ++
 ...dd-support-for-High-Frequency-PLLs-HFPLLs.patch | 351 +++
 .../138-clk-qcom-Add-HFPLL-driver.patch| 206 +++
 .../139-clk-qcom-Add-IPQ806X-s-HFPLLs.patch| 127 
 ...140-clk-qcom-Add-support-for-Krait-clocks.patch | 271 +
 .../141-clk-qcom-Add-KPSS-ACC-GCC-driver.patch | 205 +++
 ...lk-qcom-Add-Krait-clock-controller-driver.patch | 435 ++
 ...-module-to-register-cpufreq-on-Krait-CPUs.patch | 304 ++
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch | 100 
 ...ufreq-Add-a-cpufreq-krait-based-on-cpufre.patch | 461 +++
 .../300-arch-arm-force-ZRELADDR-on-arch-qcom.patch |  14 +-
 .../patches-4.0/700-add-gmac-dts-suport.patch  |  10 +-
 60 files changed, 8082 insertions(+), 108 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/120-mfd-qcom-rpm-Driver-for-the-Qualcomm-RPM.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/121-mfd-qcom_rpm-Add-support-for-IPQ8064.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/122-mfd-devicetree-bindings-Add-Qualcomm-RPM-DT-binding.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/123

[OpenWrt-Devel] [PATCH 2/5] ipq806x: disable i2c device on gsbi4

2015-05-20 Thread Mathieu Olivari
Patch cherry-picked from the following location:
https://chromium-review.googlesource.com/#/c/269931/

Disable the i2c device on gsbi4 and mark gsbi4_h and gsbi4_qup clks as
unused. If they are enabled, clock framework will turn them off at end
of probe. On ipq806x by design gsbi4_qup, gsbi4_h clks and i2c on gsbi4
are meant for RPM usage. So turning them off in kernel is incorrect.

Signed-off-by: Mathieu Olivari 
---
 ...M-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch | 53 ++
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |  2 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  2 +-
 .../patches-3.18/700-add-gmac-dts-suport.patch |  4 +-
 ...M-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch | 53 ++
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  2 +-
 .../patches-4.0/700-add-gmac-dts-suport.patch  |  4 +-
 7 files changed, 113 insertions(+), 7 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
 
b/target/linux/ipq806x/patches-3.18/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
new file mode 100644
index 000..319859b
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/023-ARM-dts-ipq806x-Disable-i2c-device-on-gsbi4.patch
@@ -0,0 +1,53 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -46,15 +46,12 @@
+   serial@1634 {
+   status = "ok";
+   };
+-
+-  i2c4: i2c@1638 {
+-  status = "ok";
+-
+-  clock-frequency = <20>;
+-
+-  pinctrl-0 = <&i2c4_pins>;
+-  pinctrl-names = "default";
+-  };
++  /*
++   * The i2c device on gsbi4 should not be enabled.
++   * On ipq806x designs gsbi4 i2c is meant for exclusive
++   * RPM usage. Turning this on in kernel manifests as
++   * i2c failure for the RPM.
++   */
+   };
+ 
+   gsbi5: gsbi@1a20 {
+--- a/drivers/clk/qcom/gcc-ipq806x.c
 b/drivers/clk/qcom/gcc-ipq806x.c
+@@ -794,7 +794,7 @@ static struct clk_rcg gsbi7_qup_src = {
+   .parent_names = gcc_pxo_pll8,
+   .num_parents = 2,
+   .ops = &clk_rcg_ops,
+-  .flags = CLK_SET_PARENT_GATE,
++  .flags = CLK_SET_PARENT_GATE | CLK_IGNORE_UNUSED,
+   },
+   },
+ };
+@@ -810,7 +810,7 @@ static struct clk_branch gsbi7_qup_clk =
+   .parent_names = (const char *[]){ "gsbi7_qup_src" },
+   .num_parents = 1,
+   .ops = &clk_branch_ops,
+-  .flags = CLK_SET_RATE_PARENT,
++  .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
+   },
+   },
+ };
+@@ -858,7 +858,7 @@ static struct clk_branch gsbi4_h_clk = {
+   .hw.init = &(struct clk_init_data){
+   .name = "gsbi4_h_clk",
+   .ops = &clk_branch_ops,
+-  .flags = CLK_IS_ROOT,
++  .flags = CLK_IS_ROOT | CLK_IGNORE_UNUSED,
+   },
+   },
+ };
diff --git 
a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
 
b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
index f1b4164..8f17397 100644
--- 
a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
+++ 
b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -112,5 +112,29 @@
+@@ -109,5 +109,29 @@
sata@2900 {
status = "ok";
};
diff --git 
a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
 
b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index 2613dff..3c1ae61 100644
--- 
a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ 
b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari 
spi_pins: spi_pins {
mux {
pins = "

[OpenWrt-Devel] [PATCH 5/5] ipq806x: enable cpu idle support in kernel conf

2015-05-20 Thread Mathieu Olivari
Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.18 | 3 +++
 target/linux/ipq806x/config-4.0  | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 2f5954c..814f142 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -91,6 +91,9 @@ CONFIG_CPU_FREQ_STAT=y
 # CONFIG_CPU_FREQ_STAT_DETAILS is not set
 CONFIG_CPU_HAS_ASID=y
 # CONFIG_CPU_ICACHE_DISABLE is not set
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
 CONFIG_CPU_PABRT_V7=y
 CONFIG_CPU_PM=y
 CONFIG_CPU_RMAP=y
diff --git a/target/linux/ipq806x/config-4.0 b/target/linux/ipq806x/config-4.0
index 3c739e6..9ce342b 100644
--- a/target/linux/ipq806x/config-4.0
+++ b/target/linux/ipq806x/config-4.0
@@ -94,6 +94,9 @@ CONFIG_CPU_FREQ_STAT=y
 # CONFIG_CPU_FREQ_STAT_DETAILS is not set
 CONFIG_CPU_HAS_ASID=y
 # CONFIG_CPU_ICACHE_DISABLE is not set
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_IDLE_GOV_MENU=y
 CONFIG_CPU_PABRT_V7=y
 CONFIG_CPU_PM=y
 CONFIG_CPU_RMAP=y
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/5] ipq806x: add power regulators support

2015-05-20 Thread Mathieu Olivari
Patches are cherry-picked from linux-next. We're also adding the
corresponding config option to the kernel.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.18   |   6 +-
 target/linux/ipq806x/config-4.0|   5 +-
 ...-mfd-qcom-rpm-Driver-for-the-Qualcomm-RPM.patch | 654 +
 .../121-mfd-qcom_rpm-Add-support-for-IPQ8064.patch |  71 +++
 ...tree-bindings-Add-Qualcomm-RPM-DT-binding.patch | 256 
 ...etree-qcom_rpm-Document-IPQ8064-resources.patch |  42 ++
 ...rpm-add-support-for-RPM-controller-SMB208.patch |  63 ++
 ...com-rpm-Add-missing-state-flag-in-call-to.patch |  30 +
 .../patches-3.18/126-add-rpm-to-ipq8064-dts.patch  |  87 +++
 .../patches-3.18/700-add-gmac-dts-suport.patch |   6 +-
 .../121-mfd-qcom_rpm-Add-support-for-IPQ8064.patch |  71 +++
 ...etree-qcom_rpm-Document-IPQ8064-resources.patch |  42 ++
 .../patches-4.0/126-add-rpm-to-ipq8064-dts.patch   |  87 +++
 .../patches-4.0/700-add-gmac-dts-suport.patch  |   6 +-
 14 files changed, 1415 insertions(+), 11 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/120-mfd-qcom-rpm-Driver-for-the-Qualcomm-RPM.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/121-mfd-qcom_rpm-Add-support-for-IPQ8064.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/122-mfd-devicetree-bindings-Add-Qualcomm-RPM-DT-binding.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/123-mfd-devicetree-qcom_rpm-Document-IPQ8064-resources.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/124-regulator-rpm-add-support-for-RPM-controller-SMB208.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/125-regulator-qcom-rpm-Add-missing-state-flag-in-call-to.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/126-add-rpm-to-ipq8064-dts.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/121-mfd-qcom_rpm-Add-support-for-IPQ8064.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/123-mfd-devicetree-qcom_rpm-Document-IPQ8064-resources.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/126-add-rpm-to-ipq8064-dts.patch

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index d32e989..1e08f36 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -84,7 +84,6 @@ CONFIG_CRC16=y
 # CONFIG_CRC32_SARWATE is not set
 CONFIG_CRC32_SLICEBY8=y
 CONFIG_CROSS_MEMORY_ATTACH=y
-# CONFIG_CRYPTO_DEV_QCE is not set
 # CONFIG_CRYPTO_SHA1_ARM_NEON is not set
 # CONFIG_CRYPTO_SHA512_ARM_NEON is not set
 CONFIG_CRYPTO_XZ=y
@@ -191,6 +190,7 @@ CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_COMPAT=y
 CONFIG_I2C_HELPER_AUTO=y
 CONFIG_I2C_QUP=y
+# CONFIG_IEEE802154 is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_INITRAMFS_SOURCE=""
@@ -211,11 +211,12 @@ CONFIG_LZO_DECOMPRESS=y
 CONFIG_MDIO_BITBANG=y
 CONFIG_MDIO_BOARDINFO=y
 CONFIG_MDIO_GPIO=y
+CONFIG_MFD_QCOM_RPM=y
 # CONFIG_MFD_SPMI_PMIC is not set
+CONFIG_MFD_SYSCON=y
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
 CONFIG_MIGHT_HAVE_PCI=y
 CONFIG_MIGRATION=y
-# CONFIG_MMC_SDHCI_MSM is not set
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MSM_GCC_8660=y
 CONFIG_MSM_GCC_8960=y
@@ -310,6 +311,7 @@ CONFIG_REGMAP=y
 CONFIG_REGMAP_MMIO=y
 CONFIG_REGULATOR=y
 # CONFIG_REGULATOR_DEBUG is not set
+CONFIG_REGULATOR_QCOM_RPM=y
 # CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
 CONFIG_RESET_CONTROLLER=y
 CONFIG_RFS_ACCEL=y
diff --git a/target/linux/ipq806x/config-4.0 b/target/linux/ipq806x/config-4.0
index 96644cf..61535da 100644
--- a/target/linux/ipq806x/config-4.0
+++ b/target/linux/ipq806x/config-4.0
@@ -52,7 +52,6 @@ CONFIG_ARM_THUMB=y
 CONFIG_ARM_UNWIND=y
 CONFIG_ARM_VIRT_EXT=y
 CONFIG_AT803X_PHY=y
-# CONFIG_BATTERY_GAUGE_LTC2941 is not set
 # CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
 CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
 CONFIG_BOUNCE=y
@@ -221,7 +220,7 @@ CONFIG_LZO_DECOMPRESS=y
 CONFIG_MDIO_BITBANG=y
 CONFIG_MDIO_BOARDINFO=y
 CONFIG_MDIO_GPIO=y
-# CONFIG_MFD_QCOM_RPM is not set
+CONFIG_MFD_QCOM_RPM=y
 # CONFIG_MFD_SPMI_PMIC is not set
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
 CONFIG_MIGHT_HAVE_PCI=y
@@ -323,6 +322,7 @@ CONFIG_REGMAP=y
 CONFIG_REGMAP_MMIO=y
 CONFIG_REGULATOR=y
 # CONFIG_REGULATOR_DEBUG is not set
+CONFIG_REGULATOR_QCOM_RPM=y
 # CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
 CONFIG_RESET_CONTROLLER=y
 CONFIG_RFS_ACCEL=y
@@ -357,7 +357,6 @@ CONFIG_SWCONFIG=y
 CONFIG_SWIOTLB=y
 CONFIG_SWP_EMULATE=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
-# CONFIG_TEGRA_AHB is not set
 CONFIG_THERMAL=y
 # CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set
 CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
diff --git 
a/target/linux/ipq806x/patches-3.18/120-mfd-qcom-rpm-Driver-for-the-Qualcomm-RPM.patch
 
b/target/linux/ipq806x/patches-3.18/120-mfd-qcom-rpm-Driver-for-the-Qualcomm-RPM.patch
new file mode 100644
index 000..d819142
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/120-mfd-qcom-rpm-Driver-for-the-Qualcomm-RPM.patch
@@ -0,0 

[OpenWrt-Devel] [PATCH 1/5] ipq806x: refresh kernel patches

2015-05-20 Thread Mathieu Olivari
Signed-off-by: Mathieu Olivari 
---
 .../011-watchdog-qcom-use-timer-devicetree-binding.patch  | 11 +++
 ...ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch |  5 -
 target/linux/ipq806x/patches-3.18/022-add-db149-dts.patch |  8 
 ...02-soc-qcom-gsbi-Add-support-for-ADM-CRCI-muxing.patch | 15 +++
 ...10-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch |  3 ---
 .../300-arch-arm-force-ZRELADDR-on-arch-qcom.patch| 12 +---
 .../patches-4.0/001-spi-qup-Add-DMA-capabilities.patch| 12 ++--
 .../011-watchdog-qcom-use-timer-devicetree-binding.patch  | 11 +++
 ...ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch |  5 -
 target/linux/ipq806x/patches-4.0/022-add-db149-dts.patch  | 10 +-
 ...10-DT-PCI-qcom-Document-PCIe-devicetree-bindings.patch |  3 ---
 .../300-arch-arm-force-ZRELADDR-on-arch-qcom.patch| 14 ++
 12 files changed, 19 insertions(+), 90 deletions(-)

diff --git 
a/target/linux/ipq806x/patches-3.18/011-watchdog-qcom-use-timer-devicetree-binding.patch
 
b/target/linux/ipq806x/patches-3.18/011-watchdog-qcom-use-timer-devicetree-binding.patch
index 0cd7da1..68489a8 100644
--- 
a/target/linux/ipq806x/patches-3.18/011-watchdog-qcom-use-timer-devicetree-binding.patch
+++ 
b/target/linux/ipq806x/patches-3.18/011-watchdog-qcom-use-timer-devicetree-binding.patch
@@ -14,8 +14,6 @@ Signed-off-by: Mathieu Olivari 
  drivers/watchdog/qcom-wdt.c | 21 +++--
  1 file changed, 15 insertions(+), 6 deletions(-)
 
-diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
-index aa85618..aa03ca8 100644
 --- a/drivers/watchdog/qcom-wdt.c
 +++ b/drivers/watchdog/qcom-wdt.c
 @@ -20,9 +20,9 @@
@@ -31,7 +29,7 @@ index aa85618..aa03ca8 100644
  
  struct qcom_wdt {
struct watchdog_device  wdd;
-@@ -117,6 +117,8 @@ static int qcom_wdt_probe(struct platform_device *pdev)
+@@ -117,6 +117,8 @@ static int qcom_wdt_probe(struct platfor
  {
struct qcom_wdt *wdt;
struct resource *res;
@@ -40,7 +38,7 @@ index aa85618..aa03ca8 100644
int ret;
  
wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
-@@ -124,6 +126,14 @@ static int qcom_wdt_probe(struct platform_device *pdev)
+@@ -124,6 +126,14 @@ static int qcom_wdt_probe(struct platfor
return -ENOMEM;
  
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -55,7 +53,7 @@ index aa85618..aa03ca8 100644
wdt->base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(wdt->base))
return PTR_ERR(wdt->base);
-@@ -203,9 +213,8 @@ static int qcom_wdt_remove(struct platform_device *pdev)
+@@ -203,9 +213,8 @@ static int qcom_wdt_remove(struct platfo
  }
  
  static const struct of_device_id qcom_wdt_of_table[] = {
@@ -67,6 +65,3 @@ index aa85618..aa03ca8 100644
{ },
  };
  MODULE_DEVICE_TABLE(of, qcom_wdt_of_table);
--- 
-1.9.1
-
diff --git 
a/target/linux/ipq806x/patches-3.18/012-ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch
 
b/target/linux/ipq806x/patches-3.18/012-ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch
index 24a093a..ae96776 100644
--- 
a/target/linux/ipq806x/patches-3.18/012-ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch
+++ 
b/target/linux/ipq806x/patches-3.18/012-ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch
@@ -13,8 +13,6 @@ Signed-off-by: Mathieu Olivari 
  arch/arm/boot/dts/qcom-ipq8064.dtsi | 14 +-
  1 file changed, 13 insertions(+), 1 deletion(-)
 
-diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi 
b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-index cb225da..d01f618 100644
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
 @@ -60,6 +60,14 @@
@@ -48,6 +46,3 @@ index cb225da..d01f618 100644
cpu-offset = <0x8>;
};
  
--- 
-1.9.1
-
diff --git a/target/linux/ipq806x/patches-3.18/022-add-db149-dts.patch 
b/target/linux/ipq806x/patches-3.18/022-add-db149-dts.patch
index 9a036fb..85a0f72 100644
--- a/target/linux/ipq806x/patches-3.18/022-add-db149-dts.patch
+++ b/target/linux/ipq806x/patches-3.18/022-add-db149-dts.patch
@@ -13,8 +13,6 @@ Signed-off-by: Mathieu Olivari 
  2 files changed, 258 insertions(+)
  create mode 100644 arch/arm/boot/dts/qcom-ipq8064-db149.dts
 
-diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
-index 38c89ca..745360a 100644
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
 @@ -360,6 +360,7 @@ dtb-$(CONFIG_ARCH_QCOM) += \
@@ -25,9 +23,6 @@ index 38c89ca..745360a 100644
qcom-msm8660-surf.dtb \
qcom-msm8960-cdp.dtb \
qcom-msm8974-sony-xperia-honami.dtb
-diff --git a/arch/arm/boot/dts/qcom-ipq8064-db149.dts 
b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-new file mode 100644
-index 000..224c54f
 --- /dev/null
 +++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 @@ -0,0 +1,257 @@
@@ -288,6 +28

[OpenWrt-Devel] [PATCH] perf: replace libelf1 select by a depend

2015-05-26 Thread Mathieu Olivari
perf has libelf1 marked as a select, but this package is actually
located in packages.git. As such, the dependency is ignored unless
libelf1 package has been manually installed previously.

To avoid any missing dependency, we'll mark it as a regular depend.
This will make sure the dependency check doesn't silently fail.

Signed-off-by: Mathieu Olivari 
---
 package/devel/perf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile
index b77e29a..e31a693 100644
--- a/package/devel/perf/Makefile
+++ b/package/devel/perf/Makefile
@@ -19,7 +19,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/perf
   SECTION:=devel
   CATEGORY:=Development
-  DEPENDS:= @USE_GLIBC +libelf1 +libdw +libpthread +librt +binutils
+  DEPENDS:= libelf1 +libdw +libpthread +librt +binutils
   TITLE:=Linux performance monitoring tool
   VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
   URL:=http://www.kernel.org
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/6] ipq806x: replace qca-nss-gmac by stmmac

2015-05-26 Thread Mathieu Olivari
This patch serie replaces the previously used qca-nss-gmac driver by its
upstream counterpart cherry-picked from the following LKML thread:
*https://lkml.org/lkml/2015/5/26/744

Mathieu Olivari (6):
  ipq806x: move arm-gic include into pcie patch
  kernel: add missing STMMAC options in generic configs
  kernel: add stmmac as a new kernel package
  ipq806x: enable kernel support for Fixed PHY emulation
  ipq806x: replace caf nss-gmac driver by upstream stmmac
  qca-nss-gmac: delete package

 package/kernel/linux/modules/netdevices.mk |  21 +
 package/kernel/qca-nss-gmac/Makefile   |  50 --
 ...01-nss-gmac-remove-IRQ-flag-IRQF_DISABLED.patch |  15 -
 target/linux/generic/config-3.18   |   2 +
 target/linux/generic/config-4.0|   2 +
 target/linux/ipq806x/Makefile  |   2 +-
 target/linux/ipq806x/config-3.18   |   1 +
 target/linux/ipq806x/config-4.0|   1 +
 .../ipq806x/patches-3.18/022-add-db149-dts.patch   | 127 +---
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  20 +-
 ...rpm-add-support-for-RPM-controller-SMB208.patch |  11 +-
 ...com-rpm-Add-missing-state-flag-in-call-to.patch |   7 +-
 .../patches-3.18/126-add-rpm-to-ipq8064-dts.patch  |   6 +-
 ...-set_parent-doing-the-wrong-thing-when-IN.patch |   7 +-
 ..._unregister_-divider-gate-mux-to-close-me.patch |   2 +-
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch |   8 +-
 .../patches-3.18/700-add-gmac-dts-suport.patch | 172 -
 ...dd-support-for-NSS-GMAC-clocks-and-resets.patch | 733 +
 ...-phy-handle-support-to-the-platform-layer.patch | 105 +++
 ...-error-path-at-the-end-of-stmmac_probe_co.patch |  65 ++
 ...stmmac-add-fixed-link-device-tree-support.patch |  64 ++
 .../704-stmmac-add-ipq806x-glue-layer.patch| 427 
 ...mac-ipq806x-document-device-tree-bindings.patch |  52 ++
 ...mac-create-one-debugfs-dir-per-net-device.patch | 171 +
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch | 145 
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch | 210 ++
 .../ipq806x/patches-4.0/022-add-db149-dts.patch| 133 +---
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  18 +-
 .../patches-4.0/700-add-gmac-dts-suport.patch  | 172 -
 ...dd-support-for-NSS-GMAC-clocks-and-resets.patch | 733 +
 ...-phy-handle-support-to-the-platform-layer.patch | 105 +++
 ...-error-path-at-the-end-of-stmmac_probe_co.patch |  65 ++
 ...stmmac-add-fixed-link-device-tree-support.patch |  64 ++
 .../704-stmmac-add-ipq806x-glue-layer.patch| 407 
 ...mac-ipq806x-document-device-tree-bindings.patch |  52 ++
 ...mac-create-one-debugfs-dir-per-net-device.patch | 175 +
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch | 145 
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch | 210 ++
 38 files changed, 3993 insertions(+), 712 deletions(-)
 delete mode 100644 package/kernel/qca-nss-gmac/Makefile
 delete mode 100644 
package/kernel/qca-nss-gmac/patches/001-nss-gmac-remove-IRQ-flag-IRQF_DISABLED.patch
 delete mode 100644 
target/linux/ipq806x/patches-3.18/700-add-gmac-dts-suport.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/701-stmmac-add-phy-handle-support-to-the-platform-layer.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/702-stmmac-move-error-path-at-the-end-of-stmmac_probe_co.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/703-stmmac-add-fixed-link-device-tree-support.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/704-stmmac-add-ipq806x-glue-layer.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/705-net-stmmac-ipq806x-document-device-tree-bindings.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/706-net-stmmac-create-one-debugfs-dir-per-net-device.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
 delete mode 100644 
target/linux/ipq806x/patches-4.0/700-add-gmac-dts-suport.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/700-clk-qcom-Add-support-for-NSS-GMAC-clocks-and-resets.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/701-stmmac-add-phy-handle-support-to-the-platform-layer.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/702-stmmac-move-error-path-at-the-end-of-stmmac_probe_co.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/703-stmmac-add-fixed-link-device-tree-support.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/704-stmmac-add-ipq806x-glue-layer.patch
 create mode 100644 
target/linux/ipq806x/patches-4.0/705-net-stmmac-ipq806x-document-device-tree-bindings.patch
 create mode 100644 
target/linux/ipq806x/patches

[OpenWrt-Devel] [PATCH 2/6] kernel: add missing STMMAC options in generic configs

2015-05-26 Thread Mathieu Olivari
STMMAC_PLATFORM and STMMAC_PCI have been added recently in the kernel,
but show up only when STMMAC driver is enabled. So se'll add it in the
generic config, so the kernel build doesn't stall whenever we enable
this driver.

Signed-off-by: Mathieu Olivari 
---
 target/linux/generic/config-3.18 | 2 ++
 target/linux/generic/config-4.0  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18
index 7a38dee..31bac92 100644
--- a/target/linux/generic/config-3.18
+++ b/target/linux/generic/config-3.18
@@ -3837,6 +3837,8 @@ CONFIG_STDBINUTILS=y
 # CONFIG_STE10XP is not set
 # CONFIG_STE_MODEM_RPROC is not set
 # CONFIG_STMMAC_ETH is not set
+# CONFIG_STMMAC_PLATFORM is not set
+# CONFIG_STMMAC_PCI is not set
 CONFIG_STP=y
 # CONFIG_STRICT_DEVMEM is not set
 CONFIG_STRIP_ASM_SYMS=y
diff --git a/target/linux/generic/config-4.0 b/target/linux/generic/config-4.0
index c3bb7fc..8a9cf33 100644
--- a/target/linux/generic/config-4.0
+++ b/target/linux/generic/config-4.0
@@ -3913,6 +3913,8 @@ CONFIG_STDBINUTILS=y
 # CONFIG_STE10XP is not set
 # CONFIG_STE_MODEM_RPROC is not set
 # CONFIG_STMMAC_ETH is not set
+# CONFIG_STMMAC_PLATFORM is not set
+# CONFIG_STMMAC_PCI is not set
 CONFIG_STP=y
 # CONFIG_STRICT_DEVMEM is not set
 CONFIG_STRIP_ASM_SYMS=y
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/6] ipq806x: enable kernel support for Fixed PHY emulation

2015-05-26 Thread Mathieu Olivari
Most ipq806x platforms use an ethernet switch, and the new upstream
GMAC driver makes use of the Fixed PHY emulation to force the link
settings despite the lack of PHY.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.18 | 1 +
 target/linux/ipq806x/config-4.0  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 814f142..cc1f20d 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -125,6 +125,7 @@ CONFIG_DTC=y
 # CONFIG_DW_DMAC_PCI is not set
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_ETHERNET_PACKET_MANGLE=y
+CONFIG_FIXED_PHY=y
 CONFIG_FREEZER=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_BUG=y
diff --git a/target/linux/ipq806x/config-4.0 b/target/linux/ipq806x/config-4.0
index 9ce342b..7ec3963 100644
--- a/target/linux/ipq806x/config-4.0
+++ b/target/linux/ipq806x/config-4.0
@@ -128,6 +128,7 @@ CONFIG_DTC=y
 # CONFIG_DW_DMAC_PCI is not set
 CONFIG_DYNAMIC_DEBUG=y
 CONFIG_ETHERNET_PACKET_MANGLE=y
+CONFIG_FIXED_PHY=y
 CONFIG_FREEZER=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_BUG=y
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/6] ipq806x: move arm-gic include into pcie patch

2015-05-26 Thread Mathieu Olivari
This include is necessary starting at the PCIe patch, which has a lower
number. So in order to keep the patches consistent, we'll move the
arm-gic include in the first patch who needs it.

Signed-off-by: Mathieu Olivari 
---
 .../112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch| 3 ++-
 target/linux/ipq806x/patches-3.18/700-add-gmac-dts-suport.patch   | 8 
 .../112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch| 3 ++-
 target/linux/ipq806x/patches-4.0/700-add-gmac-dts-suport.patch| 8 
 4 files changed, 4 insertions(+), 18 deletions(-)

diff --git 
a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
 
b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index 3c1ae61..7bee560 100644
--- 
a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ 
b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -121,11 +121,12 @@ Signed-off-by: Mathieu Olivari 
#address-cells = <1>;
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -3,6 +3,7 @@
+@@ -3,6 +3,8 @@
  #include "skeleton.dtsi"
  #include 
  #include 
 +#include 
++#include 
  
  / {
model = "Qualcomm IPQ8064";
diff --git a/target/linux/ipq806x/patches-3.18/700-add-gmac-dts-suport.patch 
b/target/linux/ipq806x/patches-3.18/700-add-gmac-dts-suport.patch
index f0c511a..3c81f88 100644
--- a/target/linux/ipq806x/patches-3.18/700-add-gmac-dts-suport.patch
+++ b/target/linux/ipq806x/patches-3.18/700-add-gmac-dts-suport.patch
@@ -119,14 +119,6 @@
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -5,6 +5,7 @@
- #include 
- #include 
- #include 
-+#include 
- 
- / {
-   model = "Qualcomm IPQ8064";
 @@ -637,5 +638,42 @@
dr_mode = "host";
};
diff --git 
a/target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
 
b/target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index 9009575..ad0a740 100644
--- 
a/target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ 
b/target/linux/ipq806x/patches-4.0/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -121,11 +121,12 @@ Signed-off-by: Mathieu Olivari 
#address-cells = <1>;
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -3,6 +3,7 @@
+@@ -3,6 +3,8 @@
  #include "skeleton.dtsi"
  #include 
  #include 
 +#include 
++#include 
  
  / {
model = "Qualcomm IPQ8064";
diff --git a/target/linux/ipq806x/patches-4.0/700-add-gmac-dts-suport.patch 
b/target/linux/ipq806x/patches-4.0/700-add-gmac-dts-suport.patch
index 7b628a7..b5a3f19 100644
--- a/target/linux/ipq806x/patches-4.0/700-add-gmac-dts-suport.patch
+++ b/target/linux/ipq806x/patches-4.0/700-add-gmac-dts-suport.patch
@@ -119,14 +119,6 @@
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -5,6 +5,7 @@
- #include 
- #include 
- #include 
-+#include 
- 
- / {
-   model = "Qualcomm IPQ8064";
 @@ -539,5 +540,42 @@
  
status = "disabled";
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/6] kernel: add stmmac as a new kernel package

2015-05-26 Thread Mathieu Olivari
Signed-off-by: Mathieu Olivari 
---
 package/kernel/linux/modules/netdevices.mk | 21 +
 1 file changed, 21 insertions(+)

diff --git a/package/kernel/linux/modules/netdevices.mk 
b/package/kernel/linux/modules/netdevices.mk
index 9dd18f3..62fd949 100644
--- a/package/kernel/linux/modules/netdevices.mk
+++ b/package/kernel/linux/modules/netdevices.mk
@@ -811,6 +811,27 @@ endef
 $(eval $(call KernelPackage,vmxnet3))
 
 
+define KernelPackage/stmmac
+  SUBMENU:=$(NETWORK_DEVICES_MENU)
+  TITLE:=STMicro 10/100/1000 Ethernet driver
+  DEPENDS:=+kmod-mii +kmod-ptp
+  KCONFIG:=CONFIG_NET_VENDOR_STMICRO=y \
+ CONFIG_STMMAC_ETH \
+ CONFIG_STMMAC_PLATFORM=y \
+ CONFIG_STMMAC_DEBUG_FS=y \
+ CONFIG_STMMAC_DA=y \
+ CONFIG_DWMAC_IPQ806X=y
+  FILES:=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac.ko
+  AUTOLOAD:=$(call AutoLoad,50,stmmac.ko)
+endef
+
+define KernelPackage/stmmac/description
+  Kernel module for STMicroelectronics 10/100/1000 Ethernet driver
+endef
+
+$(eval $(call KernelPackage,stmmac))
+
+
 define KernelPackage/spi-ks8995
   SUBMENU:=$(NETWORK_DEVICES_MENU)
   TITLE:=Micrel/Kendin KS8995 Ethernet switch control
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 6/6] qca-nss-gmac: delete package

2015-05-26 Thread Mathieu Olivari
nss-gmac has been replaced by its upstream counterpart "stmmac", to
which we added the SoC glue layer required for it to run on IPQ806x.

Signed-off-by: Mathieu Olivari 
---
 package/kernel/qca-nss-gmac/Makefile   | 50 --
 ...01-nss-gmac-remove-IRQ-flag-IRQF_DISABLED.patch | 15 ---
 2 files changed, 65 deletions(-)
 delete mode 100644 package/kernel/qca-nss-gmac/Makefile
 delete mode 100644 
package/kernel/qca-nss-gmac/patches/001-nss-gmac-remove-IRQ-flag-IRQF_DISABLED.patch

diff --git a/package/kernel/qca-nss-gmac/Makefile 
b/package/kernel/qca-nss-gmac/Makefile
deleted file mode 100644
index a854c54..000
--- a/package/kernel/qca-nss-gmac/Makefile
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# Copyright (c) 2015 The Linux Foundation. All rights reserved.
-#
-
-include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/kernel.mk
-
-PKG_NAME:=qca-nss-gmac
-PKG_VERSION:=20150408
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=git://codeaurora.org/quic/qsdk/oss/lklm/nss-gmac
-PKG_SOURCE_PROTO:=git
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=3dcb945b467f8f6b3c81338e63c917f768deb11e
-
-PKG_LICENSE:=ISC
-
-include $(INCLUDE_DIR)/package.mk
-
-define KernelPackage/qca-nss-gmac
-  SECTION:=kernel
-  CATEGORY:=Kernel modules
-  SUBMENU:=Network Devices
-  DEPENDS:=@TARGET_ipq806x
-  TITLE:=Kernel driver for NSS gmac
-  FILES:=$(PKG_BUILD_DIR)/ipq806x/qca-nss-gmac.ko
-  AUTOLOAD:=$(call AutoProbe,qca-nss-gmac)
-endef
-
-define KernelPackage/qca-nss-gmac/Description
-This package contains a NSS driver for QCA chipset
-endef
-
-EXTRA_CFLAGS+= \
-   -DCONFIG_NSS_DEBUG_LEVEL=4 \
-   -I$(PKG_BUILD_DIR)/nss_hal/include \
-   -I$(PKG_BUILD_DIR)/nss_hal/$(BOARD)
-
-define Build/Compile
-   $(MAKE) -C "$(LINUX_DIR)" \
-   CROSS_COMPILE="$(TARGET_CROSS)" \
-   ARCH="$(LINUX_KARCH)" \
-   SUBDIRS="$(PKG_BUILD_DIR)" \
-   EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
-   modules
-endef
-
-$(eval $(call KernelPackage,qca-nss-gmac))
diff --git 
a/package/kernel/qca-nss-gmac/patches/001-nss-gmac-remove-IRQ-flag-IRQF_DISABLED.patch
 
b/package/kernel/qca-nss-gmac/patches/001-nss-gmac-remove-IRQ-flag-IRQF_DISABLED.patch
deleted file mode 100644
index 7bc5bfe..000
--- 
a/package/kernel/qca-nss-gmac/patches/001-nss-gmac-remove-IRQ-flag-IRQF_DISABLED.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/ipq806x/nss_gmac_tx_rx_offload.c 
b/ipq806x/nss_gmac_tx_rx_offload.c
-index bc684a5..383403b 100644
 a/ipq806x/nss_gmac_tx_rx_offload.c
-+++ b/ipq806x/nss_gmac_tx_rx_offload.c
-@@ -896,8 +896,8 @@ int nss_gmac_open(struct net_device *netdev)
-   nss_gmac_rx_refill(gmacdev);
- 
-   /* Register IRQ */
--  err = request_irq(netdev->irq, nss_gmac_handle_irq,
--  IRQF_DISABLED, "nss-gmac", gmacdev);
-+  err = request_irq(netdev->irq, nss_gmac_handle_irq, 0,
-+  "nss-gmac", gmacdev);
-   if (err) {
-   netdev_dbg(netdev, "Mac %d IRQ %d request failed\n",
-   gmacdev->macid, netdev->irq);
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] scripts/feeds: print the source of packages installed

2015-05-26 Thread Mathieu Olivari
On Tue, May 26, 2015 at 08:12:01AM -0700, Karl Palsson wrote:
> From: Karl Palsson 
> 
> Can be helpful in diagnosing unexpected package overlaps between feeds.
> 
> Signed-off-by: Karl Palsson 
> ---
>  scripts/feeds | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/feeds b/scripts/feeds
> index a6be9cc..e060242 100755
> --- a/scripts/feeds
> +++ b/scripts/feeds
> @@ -498,7 +498,7 @@ sub install_package {
>  
>   defined($override) and $override == 1
>   and warn "Overriding package '$src'\n"
Should we display a similar information for the override case?

> - or warn "Installing package '$src'\n";
> + or warn "Installing package '$src' from $feed->[1]\n";
>  
>   do_install_package($feed, $pkg) == 0 or do {
>   warn "failed.\n";
> -- 
> 2.1.0
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] perf: replace libelf1 select by a depend

2015-05-26 Thread Mathieu Olivari
It was not merged; it stayed pending without resolution since then, so I 
figured I’d find an alternative.

Thanks,

Mathieu

 

From: Luiz Angelo Daros de Luca [mailto:luizl...@gmail.com] 
Sent: Tuesday, May 26, 2015 3:08 PM
To: Mathieu Olivari; n...@openwrt.org; blo...@openwrt.org
Cc: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH] perf: replace libelf1 select by a depend

 

Hi Mathieu,

So the elfutils import from packages.git was rejected?

 

Regards,

 

Luiz Angelo,

 

Em ter, 26 de mai de 2015 às 18:18, Mathieu Olivari mailto:math...@codeaurora.org> > escreveu:

perf has libelf1 marked as a select, but this package is actually
located in packages.git. As such, the dependency is ignored unless
libelf1 package has been manually installed previously.

To avoid any missing dependency, we'll mark it as a regular depend.
This will make sure the dependency check doesn't silently fail.

Signed-off-by: Mathieu Olivari mailto:math...@codeaurora.org> >
---
 package/devel/perf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile
index b77e29a..e31a693 100644
--- a/package/devel/perf/Makefile
+++ b/package/devel/perf/Makefile
@@ -19,7 +19,7 @@ include $(INCLUDE_DIR)/package.mk <http://package.mk> 
 define Package/perf
   SECTION:=devel
   CATEGORY:=Development
-  DEPENDS:= @USE_GLIBC +libelf1 +libdw +libpthread +librt +binutils
+  DEPENDS:= libelf1 +libdw +libpthread +librt +binutils
   TITLE:=Linux performance monitoring tool
   VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE)
   URL:=http://www.kernel.org
--
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org <mailto:openwrt-devel@lists.openwrt.org> 
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] perf: replace libelf1 select by a depend

2015-05-27 Thread Mathieu Olivari
Perf is in trunk today, but it has no maintainer listed. Somebody probably 
needs to volunteer.
As of the packages I was planning to import, I'm adding the other maintainers 
to the To: list:
- argp-standalone: Ted Hess 
- bzip2: Steven Barth 
- Luiz Angelo Daros de Luca  

Initial proposal is here: https://patchwork.ozlabs.org/patch/473676/

Thanks,
Mathieu
-Original Message-
From: Felix Fietkau [mailto:n...@openwrt.org] 
Sent: Wednesday, May 27, 2015 8:33 AM
To: Mathieu Olivari; 'Luiz Angelo Daros de Luca'; blo...@openwrt.org
Cc: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH] perf: replace libelf1 select by a depend

On 2015-05-27 02:13, Mathieu Olivari wrote:
> It was not merged; it stayed pending without resolution since then, so 
> I figured I’d find an alternative.
Replacing the select by a depend makes the whole process completely 
counterintuitive, so NACK from me on that.

Any package we add to trunk needs to have a maintainer. Is moving the relevant 
packages to trunk acked by the current package maintainers?

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 3/6] kernel: add stmmac as a new kernel package

2015-05-29 Thread Mathieu Olivari
Yeah; that's what I was thinking actually. I'll post a patch today.

-Original Message-
From: Felix Fietkau [mailto:n...@openwrt.org] 
Sent: Friday, May 29, 2015 1:35 PM
To: Mathieu Olivari; blo...@openwrt.org; ka...@openwrt.org
Cc: openwrt-devel@lists.openwrt.org
Subject: Re: [PATCH 3/6] kernel: add stmmac as a new kernel package

On 2015-05-26 23:27, Mathieu Olivari wrote:
> Signed-off-by: Mathieu Olivari 
How about simply enabling stmmac in the target kernel config?

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] ipq806x: move stmmac support in the kernel binary

2015-05-29 Thread Mathieu Olivari
Ethernet GMAC is built-in the SoC, so there is no need to enable it as a
module. We'll just assume we need it. That's what is done for other
platform where this driver is used so it'll make things more consistent.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/Makefile|  2 +-
 target/linux/ipq806x/config-3.18 | 10 --
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile
index da841a6..b6ddfe2 100644
--- a/target/linux/ipq806x/Makefile
+++ b/target/linux/ipq806x/Makefile
@@ -15,7 +15,7 @@ KERNELNAME:=zImage Image dtbs
 
 include $(INCLUDE_DIR)/target.mk
 DEFAULT_PACKAGES += \
-   kmod-leds-gpio kmod-gpio-button-hotplug kmod-stmmac swconfig \
+   kmod-leds-gpio kmod-gpio-button-hotplug swconfig \
kmod-ata-core kmod-ata-ahci kmod-ata-ahci-platform
 
 
diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 396c6e3..4d3b884 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -121,6 +121,7 @@ CONFIG_DMA_ENGINE=y
 CONFIG_DMA_OF=y
 CONFIG_DMA_VIRTUAL_CHANNELS=y
 CONFIG_DTC=y
+CONFIG_DWMAC_IPQ806X=y
 # CONFIG_DW_DMAC_CORE is not set
 # CONFIG_DW_DMAC_PCI is not set
 CONFIG_DYNAMIC_DEBUG=y
@@ -212,7 +213,6 @@ CONFIG_I2C_CHARDEV=y
 CONFIG_I2C_COMPAT=y
 CONFIG_I2C_HELPER_AUTO=y
 CONFIG_I2C_QUP=y
-# CONFIG_IEEE802154 is not set
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_INITRAMFS_SOURCE=""
@@ -243,7 +243,6 @@ CONFIG_MFD_SYSCON=y
 CONFIG_MIGHT_HAVE_CACHE_L2X0=y
 CONFIG_MIGHT_HAVE_PCI=y
 CONFIG_MIGRATION=y
-# CONFIG_MMC_SDHCI_MSM is not set
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MSM_GCC_8660=y
 CONFIG_MSM_GCC_8960=y
@@ -261,6 +260,7 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEON=y
 CONFIG_NET_FLOW_LIMIT=y
+CONFIG_NET_PTP_CLASSIFY=y
 CONFIG_NET_VENDOR_WIZNET=y
 CONFIG_NO_BOOTMEM=y
 CONFIG_NO_HZ=y
@@ -319,12 +319,14 @@ CONFIG_POWER_RESET=y
 CONFIG_POWER_RESET_MSM=y
 # CONFIG_POWER_RESET_SYSCON is not set
 CONFIG_POWER_SUPPLY=y
+CONFIG_PPS=y
 CONFIG_PREEMPT=y
 CONFIG_PREEMPT_COUNT=y
 # CONFIG_PREEMPT_NONE is not set
 CONFIG_PREEMPT_RCU=y
 CONFIG_PRINTK_TIME=y
 CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_PTP_1588_CLOCK=y
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
@@ -366,6 +368,10 @@ CONFIG_SPI_MASTER=y
 CONFIG_SPI_QUP=y
 CONFIG_SPMI=y
 CONFIG_SPMI_MSM_PMIC_ARB=y
+# CONFIG_STMMAC_DA is not set
+CONFIG_STMMAC_DEBUG_FS=y
+CONFIG_STMMAC_ETH=y
+CONFIG_STMMAC_PLATFORM=y
 CONFIG_STOP_MACHINE=y
 # CONFIG_STRIP_ASM_SYMS is not set
 CONFIG_SUSPEND=y
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2] kernel: remove stmmac kernel package

2015-05-29 Thread Mathieu Olivari
We just moved the stmmac support in the kernel for ipq806x. Therefore,
nobody needs this driver so we'll just get rid of it.

Signed-off-by: Mathieu Olivari 
---
 package/kernel/linux/modules/netdevices.mk | 21 -
 1 file changed, 21 deletions(-)

diff --git a/package/kernel/linux/modules/netdevices.mk 
b/package/kernel/linux/modules/netdevices.mk
index 62fd949..9dd18f3 100644
--- a/package/kernel/linux/modules/netdevices.mk
+++ b/package/kernel/linux/modules/netdevices.mk
@@ -811,27 +811,6 @@ endef
 $(eval $(call KernelPackage,vmxnet3))
 
 
-define KernelPackage/stmmac
-  SUBMENU:=$(NETWORK_DEVICES_MENU)
-  TITLE:=STMicro 10/100/1000 Ethernet driver
-  DEPENDS:=+kmod-mii +kmod-ptp
-  KCONFIG:=CONFIG_NET_VENDOR_STMICRO=y \
- CONFIG_STMMAC_ETH \
- CONFIG_STMMAC_PLATFORM=y \
- CONFIG_STMMAC_DEBUG_FS=y \
- CONFIG_STMMAC_DA=y \
- CONFIG_DWMAC_IPQ806X=y
-  FILES:=$(LINUX_DIR)/drivers/net/ethernet/stmicro/stmmac/stmmac.ko
-  AUTOLOAD:=$(call AutoLoad,50,stmmac.ko)
-endef
-
-define KernelPackage/stmmac/description
-  Kernel module for STMicroelectronics 10/100/1000 Ethernet driver
-endef
-
-$(eval $(call KernelPackage,stmmac))
-
-
 define KernelPackage/spi-ks8995
   SUBMENU:=$(NETWORK_DEVICES_MENU)
   TITLE:=Micrel/Kendin KS8995 Ethernet switch control
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] rules.mk: export STAGING_DIR_HOST to sub-makefiles and shells

2015-07-21 Thread Mathieu Olivari
Certains host packages (like quilt) need to know the previously used
install location at run-time. They currently use $STAGING_DIR, which
causes issues on cleaned environment, where $STAGING_DIR doesn't exist
yet.

Signed-off-by: Mathieu Olivari 
---
 rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules.mk b/rules.mk
index 58b9f3e..e67ffd5 100644
--- a/rules.mk
+++ b/rules.mk
@@ -188,7 +188,7 @@ else
 endif
 
 export PATH:=$(TARGET_PATH)
-export STAGING_DIR
+export STAGING_DIR STAGING_DIR_HOST
 export SH_FUNC:=. $(INCLUDE_DIR)/shell.sh;
 
 PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2] tools/quilt: fix build error during kernel_menuconfig on a cleaned env

2015-07-21 Thread Mathieu Olivari
When running "make kernel_menuconfig" right after "make clean", we error
out with the following message:

Makefile:22: recipe for target 
'.../build_dir/target-arm_cortex-a7_musl-1.1.10_eabi/linux-.../linux-3.18.18/.quilt_checked'
 failed
make[2]: 
[.../build_dir/target-arm_cortex-a7_musl-1.1.10_eabi/linux-.../linux-3.18.18/.quilt_checked]
Error 127 (ignored)

The root cause of the problem is located in the OpenWrt specific quilt
patch, which sets the quilt install directory to $STAGING_DIR/../host.
However, on a clean environment (right after running "make clean"),
$STAGING_DIR doesn't exist. The "quilt" executable doesn't find its
different commands, errors out, and creates this message.

We're fixing it by using $STAGING_DIR_HOST rather than $STAGING_DIR,
which is absolute. It will work even if there is no target directory
yet.

Signed-off-by: Mathieu Olivari 
---
 tools/quilt/patches/000-relocatable.patch | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/quilt/patches/000-relocatable.patch 
b/tools/quilt/patches/000-relocatable.patch
index 99d7af5..c498627 100644
--- a/tools/quilt/patches/000-relocatable.patch
+++ b/tools/quilt/patches/000-relocatable.patch
@@ -7,9 +7,9 @@
 -export TEXTDOMAINDIR=@LOCALEDIR@
  
 -: ${QUILT_DIR=@QUILT_DIR@}
-+if test -n "$STAGING_DIR"; then
-+  export TEXTDOMAINDIR="$STAGING_DIR/../host/share/locale"
-+  : ${QUILT_DIR=$STAGING_DIR/../host/share/quilt} 
${QUILT_LIB=$STAGING_DIR/../host/lib/quilt}
++if test -n "$STAGING_DIR_HOST"; then
++  export TEXTDOMAINDIR="$STAGING_DIR_HOST/share/locale"
++  : ${QUILT_DIR=$STAGING_DIR_HOST/share/quilt} 
${QUILT_LIB=$STAGING_DIR_HOST/lib/quilt}
 +else
 +  export TEXTDOMAINDIR=@LOCALEDIR@
 +  : ${QUILT_DIR=@QUILT_DIR@}
@@ -25,7 +25,7 @@
  
  setlocale(LC_MESSAGES, "");
 -bindtextdomain("quilt", "@LOCALEDIR@");
-+bindtextdomain("quilt", $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . 
'/../host/share/locale' : "@LOCALEDIR@");
++bindtextdomain("quilt", $ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . 
'/share/locale' : "@LOCALEDIR@");
  textdomain("quilt");
  
  sub _($) {
@@ -36,8 +36,8 @@
  #  See the COPYING and AUTHORS files for more details.
  
 -: ${QUILT_DIR=@QUILT_DIR@}
-+if test -n "$STAGING_DIR"; then
-+  : ${QUILT_DIR="$STAGING_DIR/../host/share/quilt"}
++if test -n "$STAGING_DIR_HOST"; then
++  : ${QUILT_DIR="$STAGING_DIR_HOST/share/quilt"}
 +else
 +  : ${QUILT_DIR=@QUILT_DIR@}
 +fi
@@ -51,8 +51,8 @@
  
  export TEXTDOMAIN=quilt
 -export TEXTDOMAINDIR=@LOCALEDIR@
-+if [ -n "$STAGING_DIR" ]; then
-+  export TEXTDOMAINDIR="$STAGING_DIR/../host/share/locale"
++if [ -n "$STAGING_DIR_HOST" ]; then
++  export TEXTDOMAINDIR="$STAGING_DIR_HOST/share/locale"
 +else
 +  export TEXTDOMAINDIR=@LOCALEDIR@
 +fi
@@ -66,7 +66,7 @@
  
  setlocale(LC_MESSAGES, "");
 -bindtextdomain("quilt", "@LOCALEDIR@");
-+bindtextdomain("quilt", $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . 
'/../host/share/locale' : "@LOCALEDIR@");
++bindtextdomain("quilt", $ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . 
'/share/locale' : "@LOCALEDIR@");
  textdomain("quilt");
  
  sub _($) {
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 2/2] tools/quilt: fix build error during kernel_menuconfig on a cleaned env

2015-08-03 Thread Mathieu Olivari
Hi Jow,
I just tried it out. I confirm the SDK works after the patch as well.
Thanks,
Mathieu

-Original Message-
From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On
Behalf Of Jo-Philipp Wich
Sent: Wednesday, July 22, 2015 12:29 AM
To: openwrt-devel@lists.openwrt.org
Subject: Re: [OpenWrt-Devel] [PATCH 2/2] tools/quilt: fix build error during
kernel_menuconfig on a cleaned env

Hi,

this was originally done to fix quilt in the SDK. Did you test it there
after your change?

~ Jow
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/4] ipq806x: add support for non-dt enabled ap148 bootloader

2015-08-04 Thread Mathieu Olivari
Certain AP148 platforms (and derivative) use bootloaders which did not
have DT enabled.
In order to support these old platforms, we'll now make the following
modifications:
*explicitely add the memory node in the AP148 DT: this used to be added
 by new u-boot through a run-time patch mechanism. We'll now add it
 explicitely so it works on boots which don't support that feature. New
 boots will have the node twice, the second one will be ignored.
*add the zImage generation next to the FIT image for AP148.

Other platforms using non-DT enabled bootloaders may want to leverage
this zImage code to generate their own firmare as well.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/image/Makefile| 10 ++
 .../ipq806x/patches-3.18/024-ap148-add-memory-node.patch   | 14 ++
 .../ipq806x/patches-4.1/024-ap148-add-memory-node.patch| 14 ++
 ...-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  4 ++--
 ...-dts-qcom-Add-necessary-DT-data-for-Krait-cpufreq.patch |  4 ++--
 .../707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch   |  6 +++---
 ...-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  4 ++--
 7 files changed, 47 insertions(+), 9 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/024-ap148-add-memory-node.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch

diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index 9a1bad8..99e9811 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -8,6 +8,15 @@ UBINIZE_OPTS = -m 2048 -p 128KiB
 
 E2SIZE=$(shell echo $$(($(CONFIG_TARGET_ROOTFS_PARTSIZE)*1024)))
 
+define Image/BuildKernel/zImage
+   cat $(KDIR)/zImage $(LINUX_DIR)/arch/arm/boot/dts/$(1).dtb > 
$(KDIR)/zImage-$(1)
+   $(CP) $(KDIR)/zImage-$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-zImage
+ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
+   cat $(KDIR)/zImage-initramfs $(LINUX_DIR)/arch/arm/boot/dts/$(1).dtb > 
$(KDIR)/zImage-initramfs-$(1)
+   $(CP) $(KDIR)/zImage-initramfs-$(1) 
$(BIN_DIR)/$(IMG_PREFIX)-$(1)-zImage-initramfs
+endif
+endef
+
 define Image/BuildKernel/FIT
gzip -9n -c $(KDIR)/Image > $(KDIR)/Image.gz
$(call CompressLzma,$(KDIR)/Image,$(KDIR)/Image.gz)
@@ -26,6 +35,7 @@ endef
 define Image/BuildKernel
$(CP) $(KDIR)/$(IMG_PREFIX)-vmlinux.elf $(BIN_DIR)
$(call Image/BuildKernel/FIT,qcom-ipq8064-ap148)
+   $(call Image/BuildKernel/zImage,qcom-ipq8064-ap148)
$(call Image/BuildKernel/FIT,qcom-ipq8064-db149)
 endef
 
diff --git a/target/linux/ipq806x/patches-3.18/024-ap148-add-memory-node.patch 
b/target/linux/ipq806x/patches-3.18/024-ap148-add-memory-node.patch
new file mode 100644
index 000..f026ed9
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/024-ap148-add-memory-node.patch
@@ -0,0 +1,14 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -4,6 +4,11 @@
+   model = "Qualcomm IPQ8064/AP148";
+   compatible = "qcom,ipq8064-ap148", "qcom,ipq8064";
+ 
++  memory@0 {
++  reg = <0x4200 0x1e00>;
++  device_type = "memory";
++  };
++
+   reserved-memory {
+   #address-cells = <1>;
+   #size-cells = <1>;
diff --git a/target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch 
b/target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch
new file mode 100644
index 000..f026ed9
--- /dev/null
+++ b/target/linux/ipq806x/patches-4.1/024-ap148-add-memory-node.patch
@@ -0,0 +1,14 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -4,6 +4,11 @@
+   model = "Qualcomm IPQ8064/AP148";
+   compatible = "qcom,ipq8064-ap148", "qcom,ipq8064";
+ 
++  memory@0 {
++  reg = <0x4200 0x1e00>;
++  device_type = "memory";
++  };
++
+   reserved-memory {
+   #address-cells = <1>;
+   #size-cells = <1>;
diff --git 
a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
 
b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index e7de2bb..e494d32 100644
--- 
a/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ 
b/target/linux/ipq806x/patches-4.1/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -15,7 +15,7 @@ Signed-off-by: Mathieu Olivari 
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -30,6 +30,22 @@
+@@ -35,6 +35,22 @@
bias-disable;
};
  
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari 
 

[OpenWrt-Devel] [PATCH 4/4] ipq806x: fix freeze in PCIe code when booting with an old u-boot

2015-08-04 Thread Mathieu Olivari
Old bootloader (same ones which have DT disabled) don't perform any PCIe
initialization. The consequence is a freeze during PCIe bring-up on
these old u-boot. Same kernel with a newer bootloaders works fine as
they contain the corresponding PCIe init code.

In this change, we'll add the missing init and make sure the kernel
doesn't rely on some preexisting init to get PCIe to work. That includes
the following changes:
*GPIOs: set function & drive strength
*Clocks: add init code for aux & ref clocks
*PCIe driver: additional init of the hardware controller

Tested 3.18 and 4.1 on an AP148 with bootloader branch 0.0.1

Signed-off-by: Mathieu Olivari 
---
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  23 +-
 .../patches-3.18/114-pcie-add-ctlr-init.patch  | 278 +
 .../patches-3.18/115-add-pcie-aux-clk-dts.patch|  80 ++
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   8 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   8 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  23 +-
 .../patches-4.1/114-pcie-add-ctlr-init.patch   | 278 +
 .../patches-4.1/115-add-pcie-aux-clk-dts.patch |  80 ++
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   8 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  10 +-
 10 files changed, 761 insertions(+), 35 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/114-pcie-add-ctlr-init.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/115-add-pcie-aux-clk-dts.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/114-pcie-add-ctlr-init.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/115-add-pcie-aux-clk-dts.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
 
b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index bdc91fb..ed66047 100644
--- 
a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ 
b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -15,14 +15,15 @@ Signed-off-by: Mathieu Olivari 
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -35,6 +35,22 @@
+@@ -35,6 +35,24 @@
bias-disable;
};
  
 +  pcie0_pins: pcie0_pinmux {
 +  mux {
 +  pins = "gpio3";
-+  drive-strength = <2>;
++  function = "pcie1_rst";
++  drive-strength = <12>;
 +  bias-disable;
 +  };
 +          };
@@ -30,7 +31,8 @@ Signed-off-by: Mathieu Olivari 
 +  pcie1_pins: pcie1_pinmux {
 +  mux {
 +  pins = "gpio48";
-+  drive-strength = <2>;
++  function = "pcie2_rst";
++  drive-strength = <12>;
 +  bias-disable;
 +          };
 +  };
@@ -38,7 +40,7 @@ Signed-off-by: Mathieu Olivari 
spi_pins: spi_pins {
mux {
pins = "gpio18", "gpio19", "gpio21";
-@@ -138,5 +154,19 @@
+@@ -138,5 +156,19 @@
        usb30@1 {
status = "ok";
};
@@ -60,14 +62,15 @@ Signed-off-by: Mathieu Olivari 
  };
 --- a/arch/arm/boot/dts/qcom-ipq8064-db149.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-db149.dts
-@@ -30,6 +30,30 @@
+@@ -30,6 +30,33 @@
bias-disable;
};
  
 +  pcie0_pins: pcie0_pinmux {
 +  mux {
 +  pins = "gpio3";
-+  drive-strength = <2>;
++  function = "pcie1_rst";
++  drive-strength = <12>;
 +      bias-disable;
 +  };
 +  };
@@ -75,7 +78,8 @@ Signed-off-by: Mathieu Olivari 
 +  pcie1_pins: pcie1_pinmux {
 +  mux {
 +  pins = "gpio48";
-+  drive-strength = <2>;
++  function = "pcie2_rst";
++      dr

[OpenWrt-Devel] [PATCH 3/4] ipq806x: fix pcie pinmux naming in ipq806x dts

2015-08-04 Thread Mathieu Olivari
PCIe controller nodes are numbers 0/1/2 in the chipset dtsi file, but
the pinmux nodes are numbers 1/2/3. We'll make it consistent by changing
the pinmux numbering to match the controller's one.

Signed-off-by: Mathieu Olivari 
---
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch | 31 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch | 10 +++
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch | 13 -
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch | 25 +
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  4 +--
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  6 ++---
 6 files changed, 41 insertions(+), 48 deletions(-)

diff --git 
a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
 
b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
index 80ac25f..bdc91fb 100644
--- 
a/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
+++ 
b/target/linux/ipq806x/patches-3.18/112-ARM-dts-qcom-add-pcie-nodes-to-ipq806x-platforms.patch
@@ -15,11 +15,11 @@ Signed-off-by: Mathieu Olivari 
 
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -30,6 +30,22 @@
+@@ -35,6 +35,22 @@
bias-disable;
};
  
-+  pcie1_pins: pcie1_pinmux {
++  pcie0_pins: pcie0_pinmux {
 +  mux {
 +  pins = "gpio3";
 +  drive-strength = <2>;
@@ -27,7 +27,7 @@ Signed-off-by: Mathieu Olivari 
 +  };
 +  };
 +
-+  pcie2_pins: pcie2_pinmux {
++  pcie1_pins: pcie1_pinmux {
 +  mux {
 +  pins = "gpio48";
 +  drive-strength = <2>;
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari 
spi_pins: spi_pins {
mux {
pins = "gpio18", "gpio19", "gpio21";
-@@ -133,5 +149,19 @@
+@@ -138,5 +154,19 @@
usb30@1 {
    status = "ok";
};
@@ -46,14 +46,14 @@ Signed-off-by: Mathieu Olivari 
 +  pcie0: pci@1b50 {
 +  status = "ok";
 +  reset-gpio = <&qcom_pinmux 3 0>;
-+  pinctrl-0 = <&pcie1_pins>;
++  pinctrl-0 = <&pcie0_pins>;
 +  pinctrl-names = "default";
 +  };
 +
 +  pcie1: pci@1b70 {
 +  status = "ok";
 +  reset-gpio = <&qcom_pinmux 48 0>;
-+  pinctrl-0 = <&pcie2_pins>;
++          pinctrl-0 = <&pcie1_pins>;
 +  pinctrl-names = "default";
 +  };
};
@@ -64,7 +64,7 @@ Signed-off-by: Mathieu Olivari 
bias-disable;
};
  
-+  pcie1_pins: pcie1_pinmux {
++  pcie0_pins: pcie0_pinmux {
 +          mux {
 +  pins = "gpio3";
 +  drive-strength = <2>;
@@ -72,7 +72,7 @@ Signed-off-by: Mathieu Olivari 
 +  };
 +  };
 +
-+  pcie2_pins: pcie2_pinmux {
++  pcie1_pins: pcie1_pinmux {
 +  mux {
 +  pins = "gpio48";
 +  drive-strength = <2>;
@@ -80,7 +80,7 @@ Signed-off-by: Mathieu Olivari 
 +  };
 +  };
 +
-+  pcie3_pins: pcie3_pinmux {
++  pcie2_pins: pcie2_pinmux {
 +  mux {
 +  pins = "gpio63";
 +  drive-strength = <2>;
@@ -99,21 +99,21 @@ Signed-off-by: Mathieu Olivari 
 +  pcie0: pci@1b50 {
 +  status = "ok";
 +  reset-gpio = <&qcom_pinmux 3 0>;
-+  pinctrl-0 = <&pcie1_pins>;
++  pinctrl-0 = <&pcie0_pins>;
 +  pinctrl-names = "default";
 +  };
 +
 +  pcie1: pci@1b70 {
 +  status = "ok";
 +  reset-gpio = <&qcom_pinmux 48 0>;
-+ 

[OpenWrt-Devel] [PATCH 1/2] ipq806x: refresh kernel configs

2015-08-04 Thread Mathieu Olivari
Remove options which have been moved into the generic config ever since.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.18 |  1 -
 target/linux/ipq806x/config-4.1  | 12 
 2 files changed, 13 deletions(-)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 4d3b884..f5bd58e 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -410,7 +410,6 @@ CONFIG_WATCHDOG_CORE=y
 # CONFIG_WIZNET_W5300 is not set
 # CONFIG_WL_TI is not set
 # CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
-# CONFIG_XEN is not set
 CONFIG_XPS=y
 CONFIG_XZ_DEC_ARM=y
 CONFIG_XZ_DEC_BCJ=y
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index e80b632..ffb0334 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -4,7 +4,6 @@ CONFIG_ALIGNMENT_TRAP=y
 CONFIG_APQ_GCC_8084=y
 CONFIG_APQ_MMCC_8084=y
 CONFIG_AR8216_PHY=y
-# CONFIG_ARCH_ALPINE is not set
 CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
 CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
 CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
@@ -243,8 +242,6 @@ CONFIG_KRAIT_L2_ACCESSORS=y
 CONFIG_LIBFDT=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
-# CONFIG_LZ4_COMPRESS is not set
-# CONFIG_LZ4_DECOMPRESS is not set
 CONFIG_LZO_COMPRESS=y
 CONFIG_LZO_DECOMPRESS=y
 CONFIG_MDIO_BITBANG=y
@@ -316,7 +313,6 @@ CONFIG_PHYLIB=y
 CONFIG_PHY_QCOM_IPQ806X_SATA=y
 # CONFIG_PHY_QCOM_UFS is not set
 CONFIG_PINCTRL=y
-# CONFIG_PINCTRL_AMD is not set
 CONFIG_PINCTRL_APQ8064=y
 # CONFIG_PINCTRL_APQ8084 is not set
 CONFIG_PINCTRL_IPQ8064=y
@@ -334,12 +330,7 @@ CONFIG_PM_SLEEP=y
 CONFIG_PM_SLEEP_SMP=y
 CONFIG_POWER_RESET=y
 # CONFIG_POWER_RESET_BRCMSTB is not set
-# CONFIG_POWER_RESET_GPIO is not set
-# CONFIG_POWER_RESET_GPIO_RESTART is not set
-# CONFIG_POWER_RESET_LTC2952 is not set
 CONFIG_POWER_RESET_MSM=y
-# CONFIG_POWER_RESET_SYSCON is not set
-# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set
 CONFIG_POWER_SUPPLY=y
 CONFIG_PREEMPT=y
 CONFIG_PREEMPT_COUNT=y
@@ -352,11 +343,9 @@ CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
 CONFIG_QCOM_SCM=y
 CONFIG_QCOM_WDT=y
-# CONFIG_QORIQ_CPUFREQ is not set
 CONFIG_RAS=y
 # CONFIG_RCU_BOOST is not set
 CONFIG_RCU_CPU_STALL_TIMEOUT=21
-# CONFIG_RCU_EXPEDITE_BOOT is not set
 CONFIG_RCU_STALL_COMMON=y
 CONFIG_RD_GZIP=y
 CONFIG_REGMAP=y
@@ -427,7 +416,6 @@ CONFIG_WATCHDOG_CORE=y
 # CONFIG_WIZNET_W5300 is not set
 # CONFIG_WL_TI is not set
 # CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
-# CONFIG_XEN is not set
 CONFIG_XPS=y
 CONFIG_XZ_DEC_ARM=y
 CONFIG_XZ_DEC_BCJ=y
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2] ipq806x: add ethernet (stmmac) support

2015-08-04 Thread Mathieu Olivari
We forgot to enable the stmmac driver for 4.1 kernel, so ethernet
interfaces don't show-up on this kernel.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-4.1 | 5 +
 1 file changed, 5 insertions(+)

diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index ffb0334..e3cff2f 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -271,6 +271,7 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEON=y
 CONFIG_NET_FLOW_LIMIT=y
+CONFIG_NET_PTP_CLASSIFY=y
 CONFIG_NET_VENDOR_WIZNET=y
 CONFIG_NO_BOOTMEM=y
 CONFIG_NO_HZ=y
@@ -332,12 +333,14 @@ CONFIG_POWER_RESET=y
 # CONFIG_POWER_RESET_BRCMSTB is not set
 CONFIG_POWER_RESET_MSM=y
 CONFIG_POWER_SUPPLY=y
+CONFIG_PPS=y
 CONFIG_PREEMPT=y
 CONFIG_PREEMPT_COUNT=y
 # CONFIG_PREEMPT_NONE is not set
 CONFIG_PREEMPT_RCU=y
 CONFIG_PRINTK_TIME=y
 CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_PTP_1588_CLOCK=y
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
@@ -379,6 +382,8 @@ CONFIG_SPI_QUP=y
 CONFIG_SPMI=y
 CONFIG_SPMI_MSM_PMIC_ARB=y
 CONFIG_SRCU=y
+CONFIG_STMMAC_ETH=y
+CONFIG_STMMAC_PLATFORM=y
 CONFIG_STOP_MACHINE=y
 # CONFIG_STRIP_ASM_SYMS is not set
 CONFIG_SUSPEND=y
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH 3/4] ipq806x: fix pcie pinmux naming in ipq806x dts

2015-08-04 Thread Mathieu Olivari
Rah; sorry about that, it happens fairly often actually. I reworked the
patch list a couple of times and I thought I tried it after the last one.
Thanks for the fix.

-Original Message-
From: Felix Fietkau [mailto:n...@openwrt.org] 
Sent: Tuesday, August 04, 2015 4:05 PM
To: Mathieu Olivari; j...@openwrt.org; blo...@openwrt.org
Cc: openwrt-devel@lists.openwrt.org
Subject: Re: [PATCH 3/4] ipq806x: fix pcie pinmux naming in ipq806x dts

On 2015-08-04 23:55, Mathieu Olivari wrote:
> PCIe controller nodes are numbers 0/1/2 in the chipset dtsi file, but 
> the pinmux nodes are numbers 1/2/3. We'll make it consistent by 
> changing the pinmux numbering to match the controller's one.
> 
> Signed-off-by: Mathieu Olivari 
> ---
> diff --git 
> a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to
> -ipq806x-platforms.patch 
> b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to
> -ipq806x-platforms.patch
> index cce30b0..8d6e77a 100644
> --- 
> a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to
> -ipq806x-platforms.patch
> +++ b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-node
> +++ s-to-ipq806x-platforms.patch
> @@ -12,7 +12,7 @@ Signed-off-by: Mathieu Olivari 
> 
>  
>  --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
>  +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
> -@@ -64,6 +64,16 @@
> +@@ -69,6 +69,16 @@
>   bias-disable;
>       };
>   };
> @@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari 
>   };
>   
>   gsbi@1630 {
> -@@ -201,5 +211,26 @@
> +@@ -206,5 +216,26 @@
>           reg = <4>;
>   };
>   };
> @@ -116,9 +116,9 @@ Signed-off-by: Mathieu Olivari

>   };
>  --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
>  +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
> -@@ -638,5 +638,91 @@
> - dr_mode = "host";
> - };
> +@@ -87,6 +87,92 @@
> + clock-frequency = <32768>;
> + #clock-cells = <0>;
>   };
>  +
>  +nss_common: syscon@0300 {
> @@ -207,4 +207,5 @@ Signed-off-by: Mathieu Olivari

>  +status = "disabled";
>  +};
>   };
> - };
> + 
> + kraitcc: clock-controller {
FYI, this part completely messed up the patch, as it moved the gmac device
tree nodes from /soc to /clocks. I've fixed it up locally and I will commit
the fixed version.

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/2] Fix quilt error when $STAGING_DIR doesn't exist yet

2015-08-05 Thread Mathieu Olivari
This patch has been posted a few weeks ago. Just posting again as a
gentle reminder. Concerns were raised regarding whether the SDK worked
after the modification, which has been confirmed.

Mathieu Olivari (2):
  rules.mk: export STAGING_DIR_HOST to sub-makefiles and shells
  tools/quilt: fix build error during kernel_menuconfig on a cleaned env

 rules.mk  |  2 +-
 tools/quilt/patches/000-relocatable.patch | 18 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] rules.mk: export STAGING_DIR_HOST to sub-makefiles and shells

2015-08-05 Thread Mathieu Olivari
Certains host packages (like quilt) need to know the previously used
install location at run-time. They currently use $STAGING_DIR, which
causes issues on cleaned environment, where $STAGING_DIR doesn't exist
yet.

Signed-off-by: Mathieu Olivari 
---
 rules.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules.mk b/rules.mk
index 58b9f3e..e67ffd5 100644
--- a/rules.mk
+++ b/rules.mk
@@ -188,7 +188,7 @@ else
 endif
 
 export PATH:=$(TARGET_PATH)
-export STAGING_DIR
+export STAGING_DIR STAGING_DIR_HOST
 export SH_FUNC:=. $(INCLUDE_DIR)/shell.sh;
 
 PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2] tools/quilt: fix build error during kernel_menuconfig on a cleaned env

2015-08-05 Thread Mathieu Olivari
When running "make kernel_menuconfig" right after "make clean", we error
out with the following message:

Makefile:22: recipe for target 
'.../build_dir/target-arm_cortex-a7_musl-1.1.10_eabi/linux-.../linux-3.18.18/.quilt_checked'
 failed
make[2]: 
[.../build_dir/target-arm_cortex-a7_musl-1.1.10_eabi/linux-.../linux-3.18.18/.quilt_checked]
Error 127 (ignored)

The root cause of the problem is located in the OpenWrt specific quilt
patch, which sets the quilt install directory to $STAGING_DIR/../host.
However, on a clean environment (right after running "make clean"),
$STAGING_DIR doesn't exist. The "quilt" executable doesn't find its
different commands, errors out, and creates this message.

We're fixing it by using $STAGING_DIR_HOST rather than $STAGING_DIR,
which is absolute. It will work even if there is no target directory
yet.

Signed-off-by: Mathieu Olivari 
---
 tools/quilt/patches/000-relocatable.patch | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/quilt/patches/000-relocatable.patch 
b/tools/quilt/patches/000-relocatable.patch
index 99d7af5..c498627 100644
--- a/tools/quilt/patches/000-relocatable.patch
+++ b/tools/quilt/patches/000-relocatable.patch
@@ -7,9 +7,9 @@
 -export TEXTDOMAINDIR=@LOCALEDIR@
  
 -: ${QUILT_DIR=@QUILT_DIR@}
-+if test -n "$STAGING_DIR"; then
-+  export TEXTDOMAINDIR="$STAGING_DIR/../host/share/locale"
-+  : ${QUILT_DIR=$STAGING_DIR/../host/share/quilt} 
${QUILT_LIB=$STAGING_DIR/../host/lib/quilt}
++if test -n "$STAGING_DIR_HOST"; then
++  export TEXTDOMAINDIR="$STAGING_DIR_HOST/share/locale"
++  : ${QUILT_DIR=$STAGING_DIR_HOST/share/quilt} 
${QUILT_LIB=$STAGING_DIR_HOST/lib/quilt}
 +else
 +  export TEXTDOMAINDIR=@LOCALEDIR@
 +  : ${QUILT_DIR=@QUILT_DIR@}
@@ -25,7 +25,7 @@
  
  setlocale(LC_MESSAGES, "");
 -bindtextdomain("quilt", "@LOCALEDIR@");
-+bindtextdomain("quilt", $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . 
'/../host/share/locale' : "@LOCALEDIR@");
++bindtextdomain("quilt", $ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . 
'/share/locale' : "@LOCALEDIR@");
  textdomain("quilt");
  
  sub _($) {
@@ -36,8 +36,8 @@
  #  See the COPYING and AUTHORS files for more details.
  
 -: ${QUILT_DIR=@QUILT_DIR@}
-+if test -n "$STAGING_DIR"; then
-+  : ${QUILT_DIR="$STAGING_DIR/../host/share/quilt"}
++if test -n "$STAGING_DIR_HOST"; then
++  : ${QUILT_DIR="$STAGING_DIR_HOST/share/quilt"}
 +else
 +  : ${QUILT_DIR=@QUILT_DIR@}
 +fi
@@ -51,8 +51,8 @@
  
  export TEXTDOMAIN=quilt
 -export TEXTDOMAINDIR=@LOCALEDIR@
-+if [ -n "$STAGING_DIR" ]; then
-+  export TEXTDOMAINDIR="$STAGING_DIR/../host/share/locale"
++if [ -n "$STAGING_DIR_HOST" ]; then
++  export TEXTDOMAINDIR="$STAGING_DIR_HOST/share/locale"
 +else
 +  export TEXTDOMAINDIR=@LOCALEDIR@
 +fi
@@ -66,7 +66,7 @@
  
  setlocale(LC_MESSAGES, "");
 -bindtextdomain("quilt", "@LOCALEDIR@");
-+bindtextdomain("quilt", $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . 
'/../host/share/locale' : "@LOCALEDIR@");
++bindtextdomain("quilt", $ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . 
'/share/locale' : "@LOCALEDIR@");
  textdomain("quilt");
  
  sub _($) {
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] scripts: add a new patch-rename.sh script

2015-08-05 Thread Mathieu Olivari
During quilt based development, it is sometimes necessary to reorder
patch files, which can become a tedious process as the patch list gets
bigger. This script can help when doing such operations, by allowing to
increment or decrement the number of multiple patch files at once:

$ ./scripts/patch-rename.sh -i 5 target/linux/generic/1*
Add 5 to all the prefix numbers of all the patch files specified as an
argument.

Signed-off-by: Mathieu Olivari 
---
 scripts/patch-rename.sh | 66 +
 1 file changed, 66 insertions(+)
 create mode 100755 scripts/patch-rename.sh

diff --git a/scripts/patch-rename.sh b/scripts/patch-rename.sh
new file mode 100755
index 000..011d179
--- /dev/null
+++ b/scripts/patch-rename.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+usage() {
+   echo "Usage: `basename $0` [ -i addval ] [ -d decval ] xxx.patch 
yyy.patch ..."
+   echo -e "\t -i ==> increment patch files by \"addval\""
+   echo -e "\t -d ==> decrement patch files by \"decval\""
+   exit 1
+}
+
+_do_rename() {
+   local mod=$1
+   local op=$2
+   local file=$3
+   local oldval newval
+
+   [ -f $file ] || { echo "Can't find file: $file"; exit 1; }
+
+   oldval=$(echo $file | sed 's/.*\/\([0-9]*\)-[^\/]*/\1/')
+   digits=${#oldval}
+   newval=$((${oldval##0*0} $op $mod))
+   # Pad newval to the previous number of characters
+   newval=$(printf "%0${#oldval}d" $newval)
+   rename "s/$oldval/$newval/" $file || { \
+   echo "Can't rename file: $file\n"; \
+   exit 1; \
+   }
+}
+
+dec_patches() {
+   local decval=$1; shift
+   # process the lowest patch first to avoid having conflicting numbers
+   local patchlist=$(echo $@ | sort -n)
+   local oldval newval
+
+   for p in ${patchlist}; do
+   _do_rename $decval - $p
+   done
+}
+
+inc_patches() {
+   local incval=$1; shift
+   # process the highest patch first to avoid having conflicting numbers
+   local patchlist=$(echo $@ | sort -nr)
+   local oldval newval
+
+   for p in ${patchlist}; do
+   _do_rename $incval + $p
+   done
+}
+
+while getopts "i:d:" OPTION; do
+   case $OPTION in
+   i ) INCVAL=$OPTARG;;
+   d ) DECVAL=$OPTARG;;
+   * ) usage;;
+   esac
+done
+
+shift $((OPTIND-1))
+PATCH_LIST=$@
+
+# If the user didn't provide any file, show the usage information
+[ ${#PATCH_LIST} == 0 ] && usage
+
+[ -n "$INCVAL" ] && inc_patches $INCVAL $PATCH_LIST
+[ -n "$DECVAL" ] && dec_patches $DECVAL $PATCH_LIST
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/3] ipq806x: add NAND flash support

2015-08-06 Thread Mathieu Olivari
This patch serie adds support for the integrated NAND flash controller
available on AP148. Most of the patches are backported from LKML, with
minor modifications.

This is kernel level support & enablement for now. Support for proper
MTD partitioning will come later and will be necessary to boot from
it.

Mathieu Olivari (3):
  ipq806x: Add ADM support
  ipq806x: add NAND flash controller support
  ipq806x: enable NAND flash support in the kernel

 target/linux/ipq806x/Makefile  |2 +-
 target/linux/ipq806x/config-3.18   |   20 +
 target/linux/ipq806x/config-4.1|   18 +
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |2 +-
 .../150-dmaengine-Rework-dma_chan_get.patch|   70 +
 ...Remove-the-need-to-declare-device_control.patch |   27 +
 ...ake-channel-allocation-callbacks-optional.patch |   62 +
 ...engine-Introduce-a-device_config-callback.patch |   51 +
 ...aengine-Add-device_terminate_all-callback.patch |   47 +
 ...-bindings-qcom_adm-Fix-channel-specifiers.patch |   76 +
 .../156-dmaengine-Add-ADM-driver.patch |  958 +
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   54 +
 .../160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch |   74 +
 ...g-to-access-bad-block-markers-in-raw-mode.patch |   84 +
 ...-mtd-nand-Qualcomm-NAND-controller-driver.patch | 2024 
 ...63-dt-bindings-qcom_nandc-Add-DT-bindings.patch |   82 +
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   50 +
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   79 +
 ...dd-support-for-NSS-GMAC-clocks-and-resets.patch |   20 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   11 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   10 +-
 ...-bindings-qcom_adm-Fix-channel-specifiers.patch |   76 +
 .../patches-4.1/156-dmaengine-Add-ADM-driver.patch |  962 ++
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   54 +
 ...g-to-access-bad-block-markers-in-raw-mode.patch |   84 +
 ...-mtd-nand-Qualcomm-NAND-controller-driver.patch | 2024 
 ...63-dt-bindings-qcom_nandc-Add-DT-bindings.patch |   82 +
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   50 +
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   76 +
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   11 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |7 +-
 31 files changed, 7218 insertions(+), 29 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/150-dmaengine-Rework-dma_chan_get.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/151-dmaengine-Remove-the-need-to-declare-device_control.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/152-dmaengine-Make-channel-allocation-callbacks-optional.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/153-dmaengine-Introduce-a-device_config-callback.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/154-dmaengine-Add-device_terminate_all-callback.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/156-dmaengine-Add-ADM-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/156-dmaengine-Add-ADM-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch

-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
h

[OpenWrt-Devel] [PATCH 3/3] ipq806x: enable NAND flash support in the kernel

2015-08-06 Thread Mathieu Olivari
Previous patch set backported the recently posted NAND flash driver to
3.18 and 4.1 kernel. This patch now enables it in the kernel config.

There is no change to the partition layout and init yet. But the NAND
flash can be seen in the mtd list on an AP148:

root@OpenWrt:/# cat /proc/mtd
dev:size   erasesize  name
mtd0: 1000 0002 "qcom-nandc"
...

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/Makefile|  2 +-
 target/linux/ipq806x/config-3.18 | 21 -
 target/linux/ipq806x/config-4.1  | 19 ++-
 3 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile
index b6ddfe2..45f83dd 100644
--- a/target/linux/ipq806x/Makefile
+++ b/target/linux/ipq806x/Makefile
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 ARCH:=arm
 BOARD:=ipq806x
 BOARDNAME:=Qualcomm Atheros IPQ806X
-FEATURES:=squashfs
+FEATURES:=squashfs nand ubifs
 CPU_TYPE:=cortex-a7
 MAINTAINER:=John Crispin 
 
diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index feedfd9..2a837f5 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -104,6 +104,8 @@ CONFIG_CRC16=y
 # CONFIG_CRC32_SARWATE is not set
 CONFIG_CRC32_SLICEBY8=y
 CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
 # CONFIG_CRYPTO_SHA1_ARM_NEON is not set
 # CONFIG_CRYPTO_SHA512_ARM_NEON is not set
 CONFIG_CRYPTO_XZ=y
@@ -251,10 +253,21 @@ CONFIG_MSM_IOMMU=y
 CONFIG_MSM_MMCC_8960=y
 CONFIG_MSM_MMCC_8974=y
 CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_IMPA7 is not set
+CONFIG_MTD_JEDECPROBE=y
 CONFIG_MTD_M25P80=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_QCOM=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+# CONFIG_MTD_UBI_BLOCK is not set
+# CONFIG_MTD_UBI_FASTMAP is not set
+# CONFIG_MTD_UBI_GLUEBI is not set
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NEED_DMA_MAP_STATE=y
@@ -327,7 +340,7 @@ CONFIG_PREEMPT_RCU=y
 CONFIG_PRINTK_TIME=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_PTP_1588_CLOCK=y
-# CONFIG_QCOM_ADM is not set
+CONFIG_QCOM_ADM=y
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
@@ -395,6 +408,11 @@ CONFIG_THERMAL_OF=y
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_TIMER_STATS=y
 CONFIG_TREE_PREEMPT_RCU=y
+CONFIG_UBIFS_FS=y
+# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_XZ=y
+CONFIG_UBIFS_FS_ZLIB=y
 CONFIG_UEVENT_HELPER_PATH=""
 CONFIG_UID16=y
 CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
@@ -416,5 +434,6 @@ CONFIG_XZ_DEC_ARM=y
 CONFIG_XZ_DEC_BCJ=y
 CONFIG_ZBOOT_ROM_BSS=0
 CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZLIB_DEFLATE=y
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZONE_DMA_FLAG=0
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index 0262e7a..f711dd5 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -111,6 +111,8 @@ CONFIG_CRC16=y
 # CONFIG_CRC32_SARWATE is not set
 CONFIG_CRC32_SLICEBY8=y
 CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
 CONFIG_CRYPTO_XZ=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_BUGVERBOSE=y
@@ -263,9 +265,18 @@ CONFIG_MSM_MMCC_8960=y
 CONFIG_MSM_MMCC_8974=y
 CONFIG_MTD_CMDLINE_PARTS=y
 CONFIG_MTD_M25P80=y
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_NAND_QCOM=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_BEB_LIMIT=20
+# CONFIG_MTD_UBI_BLOCK is not set
+# CONFIG_MTD_UBI_FASTMAP is not set
+# CONFIG_MTD_UBI_GLUEBI is not set
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NEED_DMA_MAP_STATE=y
@@ -341,7 +352,7 @@ CONFIG_PREEMPT_RCU=y
 CONFIG_PRINTK_TIME=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_PTP_1588_CLOCK=y
-# CONFIG_QCOM_ADM is not set
+CONFIG_QCOM_ADM=y
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
@@ -406,6 +417,11 @@ CONFIG_THERMAL_OF=y
 # CONFIG_THUMB2_KERNEL is not set
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_TIMER_STATS=y
+CONFIG_UBIFS_FS=y
+# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_XZ=y
+CONFIG_UBIFS_FS_ZLIB=y
 CONFIG_UEVENT_HELPER_PATH=""
 CONFIG_UID16=y
 CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
@@ -427,5 +443,6 @@ CONFIG_XZ_DEC_ARM=y
 CONFIG_XZ_DEC_BCJ=y
 CONFIG_ZBOOT_ROM_BSS=0
 CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZLIB_DEFLATE=y
 CONFIG_ZLIB_INFLATE=y
 CONFIG_ZONE_DMA_FLAG=0
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/3] ipq806x: Add ADM support

2015-08-06 Thread Mathieu Olivari
These are cherry-picked & backported from LKML:
*https://lkml.org/lkml/2015/3/17/19

They are enabled on both 3.18 and 4.1 kernel. Patches 150 to 154 are
applying changes merged since 3.18; they enable mechanisms used by the
ADM driver.

ADM engine is used by the NAND controller, so it is necessary to
bring-up NAND flash support.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.18   |   1 +
 target/linux/ipq806x/config-4.1|   1 +
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   2 +-
 .../150-dmaengine-Rework-dma_chan_get.patch|  70 ++
 ...Remove-the-need-to-declare-device_control.patch |  27 +
 ...ake-channel-allocation-callbacks-optional.patch |  62 ++
 ...engine-Introduce-a-device_config-callback.patch |  51 ++
 ...aengine-Add-device_terminate_all-callback.patch |  47 +
 ...-bindings-qcom_adm-Fix-channel-specifiers.patch |  76 ++
 .../156-dmaengine-Add-ADM-driver.patch | 958 
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |  54 ++
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   7 +-
 ...-bindings-qcom_adm-Fix-channel-specifiers.patch |  76 ++
 .../patches-4.1/156-dmaengine-Add-ADM-driver.patch | 962 +
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |  54 ++
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   4 +-
 18 files changed, 2448 insertions(+), 8 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/150-dmaengine-Rework-dma_chan_get.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/151-dmaengine-Remove-the-need-to-declare-device_control.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/152-dmaengine-Make-channel-allocation-callbacks-optional.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/153-dmaengine-Introduce-a-device_config-callback.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/154-dmaengine-Add-device_terminate_all-callback.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/156-dmaengine-Add-ADM-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/155-dt-bindings-qcom_adm-Fix-channel-specifiers.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/156-dmaengine-Add-ADM-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/157-ARM-DT-ipq8064-Add-ADM-device-node.patch

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index f5bd58e..feedfd9 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -327,6 +327,7 @@ CONFIG_PREEMPT_RCU=y
 CONFIG_PRINTK_TIME=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_PTP_1588_CLOCK=y
+# CONFIG_QCOM_ADM is not set
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index e3cff2f..0262e7a 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -341,6 +341,7 @@ CONFIG_PREEMPT_RCU=y
 CONFIG_PRINTK_TIME=y
 CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_PTP_1588_CLOCK=y
+# CONFIG_QCOM_ADM is not set
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
diff --git 
a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
 
b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
index 8f17397..5fee6ad 100644
--- 
a/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
+++ 
b/target/linux/ipq806x/patches-3.18/101-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -109,5 +109,29 @@
+@@ -114,5 +114,29 @@
sata@2900 {
status = "ok";
};
diff --git 
a/target/linux/ipq806x/patches-3.18/150-dmaengine-Rework-dma_chan_get.patch 
b/target/linux/ipq806x/patches-3.18/150-dmaengine-Rework-dma_chan_get.patch
new file mode 100644
index 000..880e67c
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/150-dmaengine-Rework-dma_chan_get.patch
@@ -0,0 +1,70 @@
+From d2f4f99db3e9ec8b063cf2e45704e2bb95428317 Mon Sep 17 00:00:00 2001
+From: Maxime Ripard 
+Date: Mon, 17 Nov 2014 14:41:58 +0100
+Subject: [PATCH] dmaengine: Rework dma_chan_get
+
+dma_chan_get uses a rather interesting error handling and code path.
+
+Change it to something more usual in the kernel.
+
+Signed-off-by: Maxime Ripard 
+Acked-by: Laurent Pinchart 
+Signed-off-by: Vinod Koul 
+---
+ drivers/dma/dmaengine.c | 36 +++-
+ 1 file changed, 19 insertions(+), 17 deletions(-)
+
+---

[OpenWrt-Devel] [PATCH 2/3] ipq806x: add NAND flash controller support

2015-08-06 Thread Mathieu Olivari
These patches add support for ipq806x NAND flash controller. Most of
these are cherry-picked & backported from LKML:
*https://lkml.org/lkml/2015/8/3/16

This patch just modifies the kernel code, but doesn't change the config.
It should be harmless.

Signed-off-by: Mathieu Olivari 
---
 .../160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch |   74 +
 ...g-to-access-bad-block-markers-in-raw-mode.patch |   84 +
 ...-mtd-nand-Qualcomm-NAND-controller-driver.patch | 2024 
 ...63-dt-bindings-qcom_nandc-Add-DT-bindings.patch |   82 +
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   50 +
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   79 +
 ...dd-support-for-NSS-GMAC-clocks-and-resets.patch |   20 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   11 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |7 +-
 ...g-to-access-bad-block-markers-in-raw-mode.patch |   84 +
 ...-mtd-nand-Qualcomm-NAND-controller-driver.patch | 2024 
 ...63-dt-bindings-qcom_nandc-Add-DT-bindings.patch |   82 +
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   50 +
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   76 +
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   11 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |7 +-
 16 files changed, 4739 insertions(+), 26 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/161-mtd-nand-Create-a-BBT-flag-to-access-bad-block-markers-in-raw-mode.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/162-mtd-nand-Qualcomm-NAND-controller-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/163-dt-bindings-qcom_nandc-Add-DT-bindings.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/164-arm-qcom-dts-Add-NAND-controller-node-for-ipq806x.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch
 
b/target/linux/ipq806x/patches-3.18/160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch
new file mode 100644
index 000..77d29d8
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/160-clk-qcom-Add-EBI2-clocks-for-IPQ806x.patch
@@ -0,0 +1,74 @@
+From 4c385b25fab119144bffb255ad77712fe586ac10 Mon Sep 17 00:00:00 2001
+From: Archit Taneja 
+Date: Thu, 2 Apr 2015 11:20:41 +0530
+Subject: [PATCH] clk: qcom: Add EBI2 clocks for IPQ806x
+
+The NAND controller within EBI2 requires EBI2_CLK and
+EBI2_ALWAYS_ON_CLK clocks.  Create structs for these clocks so
+that they can be used by the NAND controller driver. Add an entry
+for EBI2_AON_CLK in the gcc-ipq806x DT binding document.
+
+Signed-off-by: Archit Taneja 
+Signed-off-by: Stephen Boyd 
+---
+ drivers/clk/qcom/gcc-ipq806x.c   | 32 
+ include/dt-bindings/clock/qcom,gcc-ipq806x.h |  1 +
+ 2 files changed, 33 insertions(+)
+
+--- a/drivers/clk/qcom/gcc-ipq806x.c
 b/drivers/clk/qcom/gcc-ipq806x.c
+@@ -2239,6 +2239,36 @@ static struct clk_branch usb_fs1_h_clk =
+   },
+ };
+ 
++static struct clk_branch ebi2_clk = {
++  .hwcg_reg = 0x3b00,
++  .hwcg_bit = 6,
++  .halt_reg = 0x2fcc,
++  .halt_bit = 1,
++  .clkr = {
++  .enable_reg = 0x3b00,
++  .enable_mask = BIT(4),
++  .hw.init = &(struct clk_init_data){
++  .name = "ebi2_clk",
++  .ops = &clk_branch_ops,
++  .flags = CLK_IS_ROOT,
++  },
++  },
++};
++
++static struct clk_branch ebi2_aon_clk = {
++  .halt_reg = 0x2fcc,
++  .halt_bit = 0,
++  .clkr = {
++  .enable_reg = 0x3b00,
++  .enable_mask = BIT(8),
++  .hw.init = &(struct clk_init_data){
++  .name = "ebi2_always_on_clk",
++  .ops = &clk_branch_ops,
++  .flags = CLK_IS_ROOT,
++  },
++  },
++};
++
+ static struct clk_regmap *gcc_ipq806x_clks[] = {
+   [PLL0] = &pll0.clkr,
+   [PLL0_VOTE] = &pll0_vote,
+@@ -2341,6 +2371,8 @@ static struct clk_regmap *gcc_ipq806x_cl
+   [USB_FS1_XCVR_SRC] = &usb_fs1_xcvr_clk_src.

Re: [OpenWrt-Devel] [PATCH 0/3] ipq806x: add NAND flash support

2015-08-07 Thread Mathieu Olivari
Actually, I was asking myself the same questions yesterday. I was leaning
towards dts for the reasons you mention below as well; the problem is on ref
designs, there is no "standard" layout. The flash layout changes with time
(an AP148 with an old boot binary blob will have a different layout than the
same AP148 with a new boot image), sometimes with a certain application
(some boots will have an SMEM with 2 kernels & 2 rootfs for dual
partitioning). For this reason, and on ref designs, it'd be easier to have
one dts and the kernel adapting at run-time, than multiplying the dts files
and having to pick the right one based on your current SMEM content.

I would agree that it's the exception though; on most retail routers, you
would have one SMEM per SKU, i.e. one layout per dts.

I'm thinking the most flexible way would probably to have the opportunity in
dts to select between "dynamic" smem partitioning, or regular "fixed"
partitioning. Not sure if something like this has ever been done in the
past; but we could explore it.

Thanks,
Mathieu

-Original Message-
From: Felix Fietkau [mailto:n...@openwrt.org] 
Sent: Friday, August 07, 2015 2:11 AM
To: Mathieu Olivari; j...@openwrt.org
Cc: openwrt-devel@lists.openwrt.org
Subject: Re: [PATCH 0/3] ipq806x: add NAND flash support

On 2015-08-07 04:28, Mathieu Olivari wrote:
> This patch serie adds support for the integrated NAND flash controller 
> available on AP148. Most of the patches are backported from LKML, with 
> minor modifications.
> 
> This is kernel level support & enablement for now. Support for proper 
> MTD partitioning will come later and will be necessary to boot from 
> it.
Do you plan on porting the smem stuff for partitioning that QSDK uses, or do
are you going to add partitions to the device tree file?
Unless there's a good reason to avoid it, I'm leaning towards the latter, to
give our kernel more control over what's going on.
For example, I'd like to call the partition with the kernel/fs 'ubi'
instead of 'rootfs', since rootfs is already used to auto-select the root
filesystem partition for auto-mounting.

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] ipq806x: disable DMA on the SPI flash

2015-08-10 Thread Mathieu Olivari
Previous patch 6f2905eeb6ce5ddec8d12d677e1f377a940b537b enabled ADM in
the kernel, which causes a kernel panic when accessing the SPI flash.

As a workaround, We'll disable DMA for the flash for now. It was not
enabled previously anyway so we'll just leave it as is.

Reported-by: Jonas Gorski 
Signed-off-by: Mathieu Olivari 
---
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch| 13 -
 ...com-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch |  2 +-
 .../707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch|  2 +-
 ...8-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 4 files changed, 3 insertions(+), 16 deletions(-)

diff --git 
a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
 
b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
index 64b0022..4d9e613 100644
--- 
a/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
+++ 
b/target/linux/ipq806x/patches-3.18/157-ARM-DT-ipq8064-Add-ADM-device-node.patch
@@ -11,19 +11,6 @@ Signed-off-by: Andy Gross 
  arch/arm/boot/dts/qcom-ipq8064.dtsi  | 21 +
  2 files changed, 25 insertions(+)
 
 a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-+++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -90,6 +90,10 @@
- 
-   cs-gpios = <&qcom_pinmux 20 0>;
- 
-+  dmas = <&adm_dma 6>,
-+  <&adm_dma 5>;
-+  dma-names = "rx", "tx";
-+
-   flash: m25p80@0 {
-   compatible = "s25fl256s1";
-   #address-cells = <1>;
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
 @@ -657,5 +657,25 @@
diff --git 
a/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
 
b/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
index 94e4e6b..77be886 100644
--- 
a/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
+++ 
b/target/linux/ipq806x/patches-3.18/165-arm-qcom-dts-Enable-NAND-node-on-IPQ8064-AP148-platform.patch
@@ -57,7 +57,7 @@ arch/arm/boot/dts/qcom-ipq8064-ap148.dts | 36 

};
  
gsbi@1630 {
-@@ -174,5 +199,19 @@
+@@ -170,5 +195,19 @@
pinctrl-0 = <&pcie1_pins>;
pinctrl-names = "default";
};
diff --git 
a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
 
b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
index 75ebfe6..da8286a 100644
--- 
a/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
+++ 
b/target/linux/ipq806x/patches-3.18/707-ARM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch
@@ -38,7 +38,7 @@ Signed-off-by: Mathieu Olivari 
};
  
gsbi@1630 {
-@@ -209,6 +219,34 @@
+@@ -205,6 +215,34 @@
nand-ecc-strength = <4>;
nand-bus-width = <8>;
};
diff --git 
a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
 
b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
index 72a9f8b..8cfc38b 100644
--- 
a/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
+++ 
b/target/linux/ipq806x/patches-3.18/708-ARM-dts-qcom-add-gmac-nodes-to-ipq806x-platforms.patch
@@ -29,7 +29,7 @@ Signed-off-by: Mathieu Olivari 
};
  
gsbi@1630 {
-@@ -247,6 +257,27 @@
+@@ -243,6 +253,27 @@
reg = <4>;
};
};
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/5] ipq806x: add support for SMEM based MTD parser

2015-08-12 Thread Mathieu Olivari
This patch sets intents to add a new MTD parser for QCOM parser which
makes use of the information available in SMEM to provide the flash
layout. We're also cherry-picking drivers for SMEM & HW spinlocks from
LKML as dependencies.

This has been tested on AP148, both for NOR & NAND flash. The MTD layout
was detected accurately on both boot methods.

Mathieu Olivari (5):
  kernel: move linux,part-probe dt parsing in generic code
  ipq806x: add hwspinlock support
  ipq806x: add SMEM support
  ipq806x: add QCOM SMEM based MTD parser
  ipq806x: switch AP148 to using SMEM based MTD parser

 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 -
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +
 .../400-mtd-add-rootfs-split-support.patch |  16 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch|   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch |   4 +-
 .../411-mtd-partial_eraseblock_write.patch |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch|   2 +-
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +
 .../400-mtd-add-rootfs-split-support.patch |  15 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch|   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch |   4 +-
 .../411-mtd-partial_eraseblock_write.patch |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch|   2 +-
 target/linux/ipq806x/config-3.18   |   4 +
 target/linux/ipq806x/config-4.1|   8 +-
 .../patches-3.18/021-add-ap148-partitions.patch|  34 +-
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 ++
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +
 ...3-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch |  20 +
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +
 ...36-soc-qcom-add-smem-to-IPQ806x-platforms.patch |  26 +
 .../037-mtd-add-qcom-smem-parser.patch | 253 +++
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   8 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   6 +-
 .../patches-3.18/115-add-pcie-aux-clk-dts.patch|   6 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   4 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   6 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-4.1/021-add-ap148-partitions.patch |  34 +-
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 ++
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +
 ...3-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch |  21 +
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +
 ...36-soc-qcom-add-smem-to-IPQ806x-platforms.patch |  27 +
 .../patches-4.1/037-mtd-add-qcom-smem-parser.patch | 253 +++
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-4.1/115-add-pcie-aux-clk-dts.patch |   6 +-
 .../patches-4.1/126-add-rpm-to-ipq8064-dts.patch   |   4 +-
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch |   4 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   4 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   6 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   4 +-
 56 files changed, 3765 insertions(+), 313 deletions(-)
 delete mode 100644 
target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 
target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 
target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tre

[OpenWrt-Devel] [PATCH 2/5] ipq806x: add hwspinlock support

2015-08-12 Thread Mathieu Olivari
This change cherry-picks the following 3 changes from linux-next:
*fb7737 hwspinlock/core: add device tree support
*19a0f6 hwspinlock: qcom: Add support for Qualcomm HW Mutex block
*bd5717 hwspinlock: qcom: Correct msb in regmap_field

We're also adding a patch to add the hardware spinlock device nodes on
IPQ806x platforms (033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch).

Signed-off-by: Mathieu Olivari 
---
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 +++
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 +
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +++
 ...3-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch |  20 ++
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   6 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-3.18/115-add-pcie-aux-clk-dts.patch|   6 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   2 +-
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 +++
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 +
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +++
 ...3-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch |  21 ++
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   2 +-
 .../patches-4.1/115-add-pcie-aux-clk-dts.patch |   6 +-
 .../patches-4.1/126-add-rpm-to-ipq8064-dts.patch   |   4 +-
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch |   4 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   2 +-
 21 files changed, 917 insertions(+), 22 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
 
b/target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
new file mode 100644
index 000..04f35b7
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
@@ -0,0 +1,167 @@
+From fb7737e949e31d8a71acee6bbb670f32dbd2a2c0 Mon Sep 17 00:00:00 2001
+From: Suman Anna 
+Date: Wed, 4 Mar 2015 20:01:14 -0600
+Subject: [PATCH] hwspinlock/core: add device tree support
+
+This patch adds a new OF-friendly API of_hwspin_lock_get_id()
+for hwspinlock clients to use/request locks from a hwspinlock
+device instantiated through a device-tree blob. This new API
+can be used by hwspinlock clients to get the id for a specific
+lock using the phandle + args specifier, so that it can be
+requested using the available hwspin_lock_request_specific()
+API.
+
+Signed-off-by: Suman Anna 
+Reviewed-by: Bjorn Andersson 
+[small comment clarification]
+Signed-off-by: Ohad Ben-Cohen 
+---
+ Documentation/hwspinlock.txt | 10 +
+ drivers/hwspinlock/hwspinlock_core.c | 79 
+ include/linux/hwspinlock.h   |  7 
+ 3 files changed, 96 insertions(+)
+
+--- a/Documentation/hwspinlock.txt
 b/Documentation/hwspinlock.txt
+@@ -48,6 +48,16 @@ independent, drivers.
+  ids for predefined purposes.
+  Should be called from a process context (might sleep).
+ 
++  int of_hwspin_lock_get_id(struct device_node *np, int index);
++   - retrieve the global lock id for an OF phandle-based specific lock.
++ This function provides a means for DT users of a hwspinlock module
++ to get the global lock id of a specific hwspinlock, so that it can
++ be requested using the normal hwspin_lock_request_specific() API.
++ The function returns a lock id number on success, -EPROBE_DEFER if
++ the hwspinlock device is not yet registered with the core, or other
++ error values.
++ Should be called from a process context (might sleep).
++
+   int hwspin_lock_free(struct hwspinlock *hwlock);
+- free a previously-assigned hwspinlock; returns 0 on success, or an
+  appropriate error code on failure (e.g. -EINVAL if the hwspinlock
+--- a/drivers/hwspi

[OpenWrt-Devel] [PATCH 1/5] kernel: move linux, part-probe dt parsing in generic code

2015-08-12 Thread Mathieu Olivari
The "linux,part-probe" dts parsing is a pretty neat generic feature.
It has been posted to kernel.org and could easily be reused by all
targets.

This change moves the patch to the 3.18 and 4.1 generic folders, and
makes the feature available to all platforms who may want to use it.

Signed-off-by: Mathieu Olivari 
---
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 -
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +
 .../400-mtd-add-rootfs-split-support.patch |  16 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch|   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch |   4 +-
 .../411-mtd-partial_eraseblock_write.patch |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch|   2 +-
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +
 .../400-mtd-add-rootfs-split-support.patch |  15 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch|   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch |   4 +-
 .../411-mtd-partial_eraseblock_write.patch |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch|   2 +-
 19 files changed, 400 insertions(+), 224 deletions(-)
 delete mode 100644 
target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 
target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 
target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch

diff --git 
a/target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 
b/target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
deleted file mode 100644
index 686696e..000
--- 
a/target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
+++ /dev/null
@@ -1,175 +0,0 @@
-From 173b0add0cff6558f950c0cb1eacfb729d482711 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens 
-Date: Sun, 17 May 2015 18:48:38 +0200
-Subject: [PATCH 4/8] mtd: part: add generic parsing of linux,part-probe
-
-This moves the linux,part-probe device tree parsing code from
-physmap_of.c to mtdpart.c. Now all drivers can use this feature by just
-providing a reference to their device tree node in struct
-mtd_part_parser_data.
-
-Signed-off-by: Hauke Mehrtens 

- Documentation/devicetree/bindings/mtd/nand.txt | 16 ++
- drivers/mtd/maps/physmap_of.c  | 40 +---
- drivers/mtd/mtdpart.c  | 43 ++
- 3 files changed, 60 insertions(+), 39 deletions(-)
-
 a/Documentation/devicetree/bindings/mtd/nand.txt
-+++ b/Documentation/devicetree/bindings/mtd/nand.txt
-@@ -12,6 +12,22 @@
- - nand-ecc-step-size: integer representing the number of data bytes
- that are covered by a single ECC step.
- 
-+- linux,part-probe: list of name as strings of the partition parser
-+  which should be used to parse the partition table.
-+  They will be tried in the specified ordering and
-+  the next one will be used if the previous one
-+  failed.
-+
-+  Example: linux,part-probe = "cmdlinepart", "ofpart";
-+
-+  This is also the default value, which will be used
-+  if this attribute is not specified. It could be
-+  that the flash driver in use overwrote the default
-+  value and uses some other default.
-+
-+  Possible values are: bcm47xxpart, afs, ar7part,
-+  ofoldpart, ofpart, bcm63xxpart, RedBoot, cmdlinepart
-+
- The ECC strength and ECC step size properties define the correction capability
- of a controller. Together, they say a controller can correct "{strength} bit
- errors per {size} bytes".
 a/drivers/mtd/maps/physmap_of.c
-+++ b/drivers/mtd/maps/physmap_of.c
-@@ -112,45 +112,9 @@ static struct mtd_info *obsolete_probe(s
- static const char * const part_probe_types_def[] = {
-   "cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL };
- 
--static const char * const *of_get_probes(struct device_node *dp)
--{
--  const char *cp;
--  int cplen;
--  unsigned int l;
--  unsigned int count;
--  const char **res;
--
--  cp = of_get_property(dp, "linux,part-probe", &cplen);
--  if (cp == NULL)
--  return part_probe_types_

[OpenWrt-Devel] [PATCH 5/5] ipq806x: switch AP148 to using SMEM based MTD parser

2015-08-12 Thread Mathieu Olivari
*Enable SMEM MTD parser and its dependencies (SMEM & HW spinlocks) in
 the kernel config
*Replaces the MTD layout in DT by the dynamic layout provided by the
 SMEM parser for AP148

Using the OF based parser is still possible on platforms which have a
fixed MTD partition layout.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.18   |  4 +++
 target/linux/ipq806x/config-4.1|  8 ++---
 .../patches-3.18/021-add-ap148-partitions.patch| 34 ++
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |  2 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |  4 ++-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  6 ++--
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 .../patches-4.1/021-add-ap148-partitions.patch | 34 ++
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |  4 ++-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  6 ++--
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 13 files changed, 43 insertions(+), 67 deletions(-)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 2a837f5..3d4f8bb 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -206,6 +206,8 @@ CONFIG_HIGHMEM=y
 CONFIG_HIGHPTE=y
 CONFIG_HOTPLUG_CPU=y
 CONFIG_HWMON=y
+CONFIG_HWSPINLOCK=y
+CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_MSM=y
 CONFIG_HZ_FIXED=0
@@ -259,6 +261,7 @@ CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_QCOM=y
+CONFIG_MTD_QCOM_SMEM_PARTS=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
@@ -345,6 +348,7 @@ CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
 CONFIG_QCOM_SCM=y
+CONFIG_QCOM_SMEM=y
 CONFIG_QCOM_WDT=y
 CONFIG_RAS=y
 # CONFIG_RCU_BOOST is not set
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index f711dd5..d48943c 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -45,7 +45,6 @@ CONFIG_ARM_CCI400_PMU=y
 CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_GIC=y
 CONFIG_ARM_HAS_SG_CHAIN=y
-# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
 CONFIG_ARM_L1_CACHE_SHIFT=6
 CONFIG_ARM_L1_CACHE_SHIFT_6=y
 # CONFIG_ARM_LPAE is not set
@@ -214,6 +213,8 @@ CONFIG_HIGHPTE=y
 CONFIG_HOTPLUG_CPU=y
 # CONFIG_HSU_DMA_PCI is not set
 CONFIG_HWMON=y
+CONFIG_HWSPINLOCK=y
+CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_MSM=y
 CONFIG_HZ_FIXED=0
@@ -240,7 +241,6 @@ CONFIG_KPSS_XCC=y
 CONFIG_KRAITCC=y
 CONFIG_KRAIT_CLOCKS=y
 CONFIG_KRAIT_L2_ACCESSORS=y
-# CONFIG_LEDS_REGULATOR is not set
 CONFIG_LIBFDT=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
@@ -268,6 +268,7 @@ CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_QCOM=y
+CONFIG_MTD_QCOM_SMEM_PARTS=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
@@ -357,6 +358,7 @@ CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
 CONFIG_QCOM_SCM=y
+CONFIG_QCOM_SMEM=y
 CONFIG_QCOM_WDT=y
 CONFIG_RAS=y
 # CONFIG_RCU_BOOST is not set
@@ -366,9 +368,7 @@ CONFIG_RD_GZIP=y
 CONFIG_REGMAP=y
 CONFIG_REGMAP_MMIO=y
 CONFIG_REGULATOR=y
-# CONFIG_REGULATOR_DEBUG is not set
 CONFIG_REGULATOR_QCOM_RPM=y
-# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
 CONFIG_RESET_CONTROLLER=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
diff --git a/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch 
b/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch
index 34eb9c0..bfdb30f 100644
--- a/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch
+++ b/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch
@@ -1,35 +1,19 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -78,13 +78,28 @@
+@@ -77,15 +77,7 @@
+   spi-max-frequency = <5000>;
reg = <0>;
  
-   partition@0 {
+-  partition@0 {
 -  label = "rootfs";
 -  reg = <0x0 0x100>;
-+  label = "lowlevel_init";
-+  reg = <0x0 0x1b>;
-   };
- 
-   partition@1 {
+-  };
+-
+-  partition@1 {
 -  label = "scratch";
 -  reg = <0x100 0x100>;
-+  label = "u-boot"

[OpenWrt-Devel] [PATCH 3/5] ipq806x: add SMEM support

2015-08-12 Thread Mathieu Olivari
2 patches are cherry-picked from the following LKML thread:
*https://lkml.org/lkml/2015/4/11/208

The last patch (036-soc-qcom-add-smem-to-IPQ806x-platforms.patch) is
adding the corresponding DT nodes required for IPQ806x.

Signed-off-by: Mathieu Olivari 
---
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +
 ...36-soc-qcom-add-smem-to-IPQ806x-platforms.patch |  26 +
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   4 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-3.18/115-add-pcie-aux-clk-dts.patch|   6 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   2 +-
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +
 ...36-soc-qcom-add-smem-to-IPQ806x-platforms.patch |  27 +
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   2 +-
 .../patches-4.1/115-add-pcie-aux-clk-dts.patch |   6 +-
 .../patches-4.1/126-add-rpm-to-ipq8064-dts.patch   |   4 +-
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch |   4 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   2 +-
 19 files changed, 1920 insertions(+), 21 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/036-soc-qcom-add-smem-to-IPQ806x-platforms.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 
b/target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
new file mode 100644
index 000..d22db22
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
@@ -0,0 +1,82 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,1/2] soc: qcom: Add device tree binding for SMEM
+From: Bjorn Andersson 
+X-Patchwork-Id: 6202201
+Message-Id: <1428795178-24312-1-git-send-email-bjorn.anders...@sonymobile.com>
+To: Rob Herring , Pawel Moll ,
+   Mark Rutland ,
+   Ian Campbell ,
+   Kumar Gala , Jeffrey Hugo , 
+   Andry Gross 
+Cc: ,
+   linux-arm-msm ,
+   
+Date: Sat, 11 Apr 2015 16:32:57 -0700
+
+Add device tree binding documentation for the Qualcom Shared Memory
+manager.
+
+Signed-off-by: Bjorn Andersson 
+
+---
+Changes since v1:
+- None
+
+ .../devicetree/bindings/soc/qcom/qcom,smem.txt | 49 ++
+ 1 file changed, 49 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
+
+--- /dev/null
 b/Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
+@@ -0,0 +1,49 @@
++Qualcomm Shared Memory binding
++
++This binding describes the Qualcomm Shared Memory, used to share data between
++various subsystems and OSes in Qualcomm platforms.
++
++- compatible:
++  Usage: required
++  Value type: 
++  Definition: must be:
++  "qcom,smem"
++
++- memory-region:
++  Usage: required
++  Value type: 
++  Definition: handle to memory reservation for main smem memory region.
++
++- reg:
++  Usage: optional
++  Value type: 
++  Definition: base address and size pair for any additional memory areas
++  of the shared memory.
++
++- hwspinlocks:
++  Usage: required
++  Value type: 
++  Definition: reference to a hwspinlock used to protect allocations from
++  the shared memory
++
++= EXAMPLE
++
++  reserved-memory {
++  #address-cells = <1>;
++  #size-cells = <1>;
++  ranges;
++
++  smem_region: smem@fa0 {
++  reg = <0xfa0 0x20>;
++  no-map;
++  };
++  };
++
++  smem@fa0 {
++  compatible = "qcom,smem";
++
++  memory-region = <&smem_region>;
++  reg = <0xfc428000 0x4000>;
++
++  hwlocks = <&tcsr_mutex 3>;
++  };
diff --git 
a/target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 
b/target/linux/ipq806x/patches-3.18/035-so

[OpenWrt-Devel] [PATCH 4/5] ipq806x: add QCOM SMEM based MTD parser

2015-08-12 Thread Mathieu Olivari
This patch adds a new parser which uses the SMEM available on IPQ and
some other QCOM platforms to map the MTD partitions.

Signed-off-by: Mathieu Olivari 
---
 .../037-mtd-add-qcom-smem-parser.patch | 253 +
 .../patches-4.1/037-mtd-add-qcom-smem-parser.patch | 253 +
 2 files changed, 506 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-3.18/037-mtd-add-qcom-smem-parser.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/037-mtd-add-qcom-smem-parser.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/037-mtd-add-qcom-smem-parser.patch 
b/target/linux/ipq806x/patches-3.18/037-mtd-add-qcom-smem-parser.patch
new file mode 100644
index 000..6ee3ba0
--- /dev/null
+++ b/target/linux/ipq806x/patches-3.18/037-mtd-add-qcom-smem-parser.patch
@@ -0,0 +1,253 @@
+--- a/drivers/mtd/Kconfig
 b/drivers/mtd/Kconfig
+@@ -184,6 +184,13 @@ config MTD_BCM47XX_PARTS
+ This provides partitions parser for devices based on BCM47xx
+ boards.
+ 
++config MTD_QCOM_SMEM_PARTS
++  tristate "QCOM SMEM partitioning support"
++  depends on QCOM_SMEM
++  help
++This provides partitions parser for QCOM devices using SMEM
++such as IPQ806x.
++
+ config MTD_MYLOADER_PARTS
+   tristate "MyLoader partition parsing"
+   depends on ADM5120 || ATH25 || ATH79
+--- a/drivers/mtd/Makefile
 b/drivers/mtd/Makefile
+@@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_AR7_PARTS)  += ar7part.o
+ obj-$(CONFIG_MTD_BCM63XX_PARTS)   += bcm63xxpart.o
+ obj-$(CONFIG_MTD_BCM47XX_PARTS)   += bcm47xxpart.o
+ obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o
++obj-$(CONFIG_MTD_QCOM_SMEM_PARTS) += qcom_smem_part.o
+ 
+ # 'Users' - code which presents functionality to userspace.
+ obj-$(CONFIG_MTD_BLKDEVS) += mtd_blkdevs.o
+--- /dev/null
 b/drivers/mtd/qcom_smem_part.c
+@@ -0,0 +1,224 @@
++/*
++ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include 
++#include 
++#include 
++
++#include 
++#include 
++#include 
++#include 
++
++#include 
++
++/* Processor/host identifier for the application processor */
++#define SMEM_HOST_APPS0
++
++/* SMEM items index */
++#define SMEM_AARM_PARTITION_TABLE 9
++#define SMEM_BOOT_FLASH_TYPE  421
++#define SMEM_BOOT_FLASH_BLOCK_SIZE424
++
++/* SMEM Magic values in partition table */
++#define SMEM_PTABLE_MAGIC_1   0x55ee73aa
++#define SMEM_PTABLE_MAGIC_2   0xe35ebddb
++
++/* SMEM Flash types */
++#define SMEM_FLASH_NAND   2
++#define SMEM_FLASH_SPI6
++
++#define SMEM_PART_NAME_SZ 16
++#define SMEM_PARTS_MAX32
++
++struct smem_partition {
++  char name[SMEM_PART_NAME_SZ];
++  uint32_t start;
++  uint32_t size;
++  uint32_t attr;
++};
++
++struct smem_partition_table {
++  uint32_t magic[2];
++  uint32_t version;
++  uint32_t len;
++  struct smem_partition parts[SMEM_PARTS_MAX];
++};
++
++static int qcom_smem_get_flash_blksz(uint64_t **smem_blksz)
++{
++  int ret;
++  size_t size;
++
++  ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_BLOCK_SIZE,
++  (void **) smem_blksz, &size);
++
++  if (ret < 0) {
++  pr_err("Unable to read flash blksz from SMEM\n");
++  return -ENOENT;
++  }
++
++  if (size != sizeof(**smem_blksz)) {
++  pr_err("Invalid flash blksz size in SMEM\n");
++  return -EINVAL;
++  }
++
++  return 0;
++}
++
++static int qcom_smem_get_flash_type(uint64_t **smem_flash_type) {
++  int ret;
++  size_t size;
++
++  ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_TYPE,
++  (void **) smem_flash_type, &size);
++
++  if (ret < 0) {
++  pr_err("Unable to read flash type from SMEM\n");
++  return -ENOENT;
++  }
++
++  if (size != sizeof(**smem_flash_type)) {
++  pr_err("Invalid flash type size in SMEM\n");
++  return -EINVAL;
++  }
++
++  return 0;
++}
++
++static int qcom_smem_get_flash_partitions(struct smem_partition_table 
**pparts)
++{
++  int ret;
++  size_t size;
++
++  ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_AARM_PARTITION_TABLE,
++  (void **) pparts, &size);
++
++  if (ret < 0) {
+

Re: [OpenWrt-Devel] [PATCH 1/5] kernel: move linux, part-probe dt parsing in generic code

2015-08-13 Thread Mathieu Olivari
No; I don't think it was. Patches weren't acked afaik and it doesn't seem to be 
in the next tree.
http://lists.infradead.org/pipermail/linux-mtd/2015-May/059226.html


-Original Message-
From: Rafał Miłecki [mailto:zaj...@gmail.com] 
Sent: Wednesday, August 12, 2015 9:05 PM
To: Mathieu Olivari
Cc: Felix Fietkau; Jonas Gorski; John Crispin; OpenWrt Development List
Subject: Re: [OpenWrt-Devel] [PATCH 1/5] kernel: move linux, part-probe dt 
parsing in generic code

On 13 August 2015 at 04:37, Mathieu Olivari  wrote:
> The "linux,part-probe" dts parsing is a pretty neat generic feature.
> It has been posted to kernel.org and could easily be reused by all 
> targets.

Was it accepted mainline? If so, you should use 0xx prefix for this patch. 
Otherwise it's OK.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/5] kernel: move linux, part-probe dt parsing in generic code

2015-08-14 Thread Mathieu Olivari
The "linux,part-probe" dts parsing is a pretty neat generic feature.
It has been posted to kernel.org and could easily be reused by all
targets.

This change moves the patch to the 3.18 and 4.1 generic folders, and
makes the feature available to all platforms who may want to use it.

Signed-off-by: Mathieu Olivari 
---
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 -
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +
 .../400-mtd-add-rootfs-split-support.patch |  16 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch|   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch |   4 +-
 .../411-mtd-partial_eraseblock_write.patch |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch|   2 +-
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +
 .../400-mtd-add-rootfs-split-support.patch |  15 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch|   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch |   4 +-
 .../411-mtd-partial_eraseblock_write.patch |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch|   2 +-
 19 files changed, 400 insertions(+), 224 deletions(-)
 delete mode 100644 
target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 
target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 
target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch

diff --git 
a/target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 
b/target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
deleted file mode 100644
index 686696e..000
--- 
a/target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
+++ /dev/null
@@ -1,175 +0,0 @@
-From 173b0add0cff6558f950c0cb1eacfb729d482711 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens 
-Date: Sun, 17 May 2015 18:48:38 +0200
-Subject: [PATCH 4/8] mtd: part: add generic parsing of linux,part-probe
-
-This moves the linux,part-probe device tree parsing code from
-physmap_of.c to mtdpart.c. Now all drivers can use this feature by just
-providing a reference to their device tree node in struct
-mtd_part_parser_data.
-
-Signed-off-by: Hauke Mehrtens 

- Documentation/devicetree/bindings/mtd/nand.txt | 16 ++
- drivers/mtd/maps/physmap_of.c  | 40 +---
- drivers/mtd/mtdpart.c  | 43 ++
- 3 files changed, 60 insertions(+), 39 deletions(-)
-
 a/Documentation/devicetree/bindings/mtd/nand.txt
-+++ b/Documentation/devicetree/bindings/mtd/nand.txt
-@@ -12,6 +12,22 @@
- - nand-ecc-step-size: integer representing the number of data bytes
- that are covered by a single ECC step.
- 
-+- linux,part-probe: list of name as strings of the partition parser
-+  which should be used to parse the partition table.
-+  They will be tried in the specified ordering and
-+  the next one will be used if the previous one
-+  failed.
-+
-+  Example: linux,part-probe = "cmdlinepart", "ofpart";
-+
-+  This is also the default value, which will be used
-+  if this attribute is not specified. It could be
-+  that the flash driver in use overwrote the default
-+  value and uses some other default.
-+
-+  Possible values are: bcm47xxpart, afs, ar7part,
-+  ofoldpart, ofpart, bcm63xxpart, RedBoot, cmdlinepart
-+
- The ECC strength and ECC step size properties define the correction capability
- of a controller. Together, they say a controller can correct "{strength} bit
- errors per {size} bytes".
 a/drivers/mtd/maps/physmap_of.c
-+++ b/drivers/mtd/maps/physmap_of.c
-@@ -112,45 +112,9 @@ static struct mtd_info *obsolete_probe(s
- static const char * const part_probe_types_def[] = {
-   "cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL };
- 
--static const char * const *of_get_probes(struct device_node *dp)
--{
--  const char *cp;
--  int cplen;
--  unsigned int l;
--  unsigned int count;
--  const char **res;
--
--  cp = of_get_property(dp, "linux,part-probe", &cplen);
--  if (cp == NULL)
--  return part_probe_types_

[OpenWrt-Devel] [PATCH 2/5] ipq806x: add hwspinlock support

2015-08-14 Thread Mathieu Olivari
This change cherry-picks the following 3 changes from linux-next:
*fb7737 hwspinlock/core: add device tree support
*19a0f6 hwspinlock: qcom: Add support for Qualcomm HW Mutex block
*bd5717 hwspinlock: qcom: Correct msb in regmap_field

We're also adding a patch to add the hardware spinlock device nodes on
IPQ806x platforms (033-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch).

Signed-off-by: Mathieu Olivari 
---
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 +++
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 +
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +++
 ...33-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch |  34 +++
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   9 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-3.18/115-add-pcie-aux-clk-dts.patch|   6 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   5 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   5 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   5 +-
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 +++
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 +
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +++
 ...33-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch |  33 +++
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  10 +-
 .../patches-4.1/115-add-pcie-aux-clk-dts.patch |   6 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   5 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   5 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   5 +-
 19 files changed, 958 insertions(+), 28 deletions(-)
 create mode 100644 
target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/033-ARM-qcom-add-SFPB-nodes-to-IPQ806x-dts.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
 
b/target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
new file mode 100644
index 000..04f35b7
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
@@ -0,0 +1,167 @@
+From fb7737e949e31d8a71acee6bbb670f32dbd2a2c0 Mon Sep 17 00:00:00 2001
+From: Suman Anna 
+Date: Wed, 4 Mar 2015 20:01:14 -0600
+Subject: [PATCH] hwspinlock/core: add device tree support
+
+This patch adds a new OF-friendly API of_hwspin_lock_get_id()
+for hwspinlock clients to use/request locks from a hwspinlock
+device instantiated through a device-tree blob. This new API
+can be used by hwspinlock clients to get the id for a specific
+lock using the phandle + args specifier, so that it can be
+requested using the available hwspin_lock_request_specific()
+API.
+
+Signed-off-by: Suman Anna 
+Reviewed-by: Bjorn Andersson 
+[small comment clarification]
+Signed-off-by: Ohad Ben-Cohen 
+---
+ Documentation/hwspinlock.txt | 10 +
+ drivers/hwspinlock/hwspinlock_core.c | 79 
+ include/linux/hwspinlock.h   |  7 
+ 3 files changed, 96 insertions(+)
+
+--- a/Documentation/hwspinlock.txt
 b/Documentation/hwspinlock.txt
+@@ -48,6 +48,16 @@ independent, drivers.
+  ids for predefined purposes.
+  Should be called from a process context (might sleep).
+ 
++  int of_hwspin_lock_get_id(struct device_node *np, int index);
++   - retrieve the global lock id for an OF phandle-based specific lock.
++ This function provides a means for DT users of a hwspinlock module
++ to get the global lock id of a specific hwspinlock, so that it can
++ be requested using the normal hwspin_lock_request_specific() API.
++ The function returns a lock id number on success, -EPROBE_DEFER if
++ the hwspinlock device is not yet registered with the core, or other
++ error values.
++ Should be called from a process context (might sleep).
++
+   int hwspin_lock_free(struct hwspinlock *hwlock);
+- free a previously-assigned hwspinlock; returns 0 on success, or an
+  appropriate error code on failure (e.g. -EINVAL if the hwspinlock
+--- a/drivers/hwspinlock/hwspinlock_core.c
 b/drivers/hwspinlock/hwspinlock_core.c
+@@ -27,6 +27,7 @@
+ #include 
+ #include 
+ #in

[OpenWrt-Devel] [PATCH 5/5] ipq806x: switch AP148 to using SMEM based MTD parser

2015-08-14 Thread Mathieu Olivari
*Enable SMEM MTD parser and its dependencies (SMEM & HW spinlocks) in
 the kernel config
*Replaces the MTD layout in DT by the dynamic layout provided by the
 SMEM parser for AP148

Using the OF based parser is still possible on platforms which have a
fixed MTD partition layout.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.18   |  4 +++
 target/linux/ipq806x/config-4.1|  8 ++---
 .../patches-3.18/021-add-ap148-partitions.patch| 34 ++
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |  2 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |  2 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 .../patches-4.1/021-add-ap148-partitions.patch | 34 ++
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |  2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |  2 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |  2 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |  2 +-
 13 files changed, 35 insertions(+), 63 deletions(-)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 2a837f5..3d4f8bb 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -206,6 +206,8 @@ CONFIG_HIGHMEM=y
 CONFIG_HIGHPTE=y
 CONFIG_HOTPLUG_CPU=y
 CONFIG_HWMON=y
+CONFIG_HWSPINLOCK=y
+CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_MSM=y
 CONFIG_HZ_FIXED=0
@@ -259,6 +261,7 @@ CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_QCOM=y
+CONFIG_MTD_QCOM_SMEM_PARTS=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
@@ -345,6 +348,7 @@ CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
 CONFIG_QCOM_SCM=y
+CONFIG_QCOM_SMEM=y
 CONFIG_QCOM_WDT=y
 CONFIG_RAS=y
 # CONFIG_RCU_BOOST is not set
diff --git a/target/linux/ipq806x/config-4.1 b/target/linux/ipq806x/config-4.1
index f711dd5..d48943c 100644
--- a/target/linux/ipq806x/config-4.1
+++ b/target/linux/ipq806x/config-4.1
@@ -45,7 +45,6 @@ CONFIG_ARM_CCI400_PMU=y
 CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_GIC=y
 CONFIG_ARM_HAS_SG_CHAIN=y
-# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
 CONFIG_ARM_L1_CACHE_SHIFT=6
 CONFIG_ARM_L1_CACHE_SHIFT_6=y
 # CONFIG_ARM_LPAE is not set
@@ -214,6 +213,8 @@ CONFIG_HIGHPTE=y
 CONFIG_HOTPLUG_CPU=y
 # CONFIG_HSU_DMA_PCI is not set
 CONFIG_HWMON=y
+CONFIG_HWSPINLOCK=y
+CONFIG_HWSPINLOCK_QCOM=y
 CONFIG_HW_RANDOM=y
 CONFIG_HW_RANDOM_MSM=y
 CONFIG_HZ_FIXED=0
@@ -240,7 +241,6 @@ CONFIG_KPSS_XCC=y
 CONFIG_KRAITCC=y
 CONFIG_KRAIT_CLOCKS=y
 CONFIG_KRAIT_L2_ACCESSORS=y
-# CONFIG_LEDS_REGULATOR is not set
 CONFIG_LIBFDT=y
 CONFIG_LOCKUP_DETECTOR=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
@@ -268,6 +268,7 @@ CONFIG_MTD_M25P80=y
 CONFIG_MTD_NAND=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_QCOM=y
+CONFIG_MTD_QCOM_SMEM_PARTS=y
 CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
@@ -357,6 +358,7 @@ CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_HFPLL=y
 CONFIG_QCOM_SCM=y
+CONFIG_QCOM_SMEM=y
 CONFIG_QCOM_WDT=y
 CONFIG_RAS=y
 # CONFIG_RCU_BOOST is not set
@@ -366,9 +368,7 @@ CONFIG_RD_GZIP=y
 CONFIG_REGMAP=y
 CONFIG_REGMAP_MMIO=y
 CONFIG_REGULATOR=y
-# CONFIG_REGULATOR_DEBUG is not set
 CONFIG_REGULATOR_QCOM_RPM=y
-# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
 CONFIG_RESET_CONTROLLER=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
diff --git a/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch 
b/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch
index 34eb9c0..bfdb30f 100644
--- a/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch
+++ b/target/linux/ipq806x/patches-3.18/021-add-ap148-partitions.patch
@@ -1,35 +1,19 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
-@@ -78,13 +78,28 @@
+@@ -77,15 +77,7 @@
+   spi-max-frequency = <5000>;
reg = <0>;
  
-   partition@0 {
+-  partition@0 {
 -  label = "rootfs";
 -  reg = <0x0 0x100>;
-+  label = "lowlevel_init";
-+  reg = <0x0 0x1b>;
-   };
- 
-   partition@1 {
+-  };
+-
+-  partition@1 {
 -  label = "scratch";
 -  reg = <0x100 0x100>;
-+  label = "u-boot"

[OpenWrt-Devel] [PATCH 0/5] ipq806x: add support for SMEM based MTD parser

2015-08-14 Thread Mathieu Olivari
This patch sets intents to add a new MTD parser for QCOM parser which
makes use of the information available in SMEM to provide the flash
layout. We're also cherry-picking drivers for SMEM & HW spinlocks from
LKML as dependencies.

This has been tested on AP148, both for NOR & NAND flash. The MTD layout
was detected accurately on both boot methods.

v2:
*rebased and fix conflicts with previous patches
*renamed patch files according to their LKML names
*updated the SMEM parser with comments provided on LKML

Mathieu Olivari (5):
  kernel: move linux,part-probe dt parsing in generic code
  ipq806x: add hwspinlock support
  ipq806x: add SMEM support
  ipq806x: add QCOM SMEM based MTD parser
  ipq806x: switch AP148 to using SMEM based MTD parser

 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 -
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +
 .../400-mtd-add-rootfs-split-support.patch |  16 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch|   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch |   4 +-
 .../411-mtd-partial_eraseblock_write.patch |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch|   2 +-
 ...t-add-generic-parsing-of-linux-part-probe.patch | 175 +
 .../400-mtd-add-rootfs-split-support.patch |  15 +-
 ...port-for-different-partition-parser-types.patch |   4 +-
 ...mtd-parsers-for-rootfs-and-firmware-split.patch |   6 +-
 .../404-mtd-add-more-helper-functions.patch|   6 +-
 .../405-mtd-old-firmware-uimage-splitter.patch |   4 +-
 .../406-mtd-old-rootfs-squashfs-splitter.patch |   4 +-
 .../411-mtd-partial_eraseblock_write.patch |   8 +-
 .../412-mtd-partial_eraseblock_unlock.patch|   2 +-
 target/linux/ipq806x/config-3.18   |   4 +
 target/linux/ipq806x/config-4.1|   8 +-
 .../patches-3.18/021-add-ap148-partitions.patch|  34 +-
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 ++
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +
 ...3-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch |  20 +
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +
 ...36-soc-qcom-add-smem-to-IPQ806x-platforms.patch |  26 +
 .../037-mtd-add-qcom-smem-parser.patch | 253 +++
 ...1-ARM-qcom-add-USB-nodes-to-ipq806x-ap148.patch |   8 +-
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   6 +-
 .../patches-3.18/115-add-pcie-aux-clk-dts.patch|   6 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   4 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   6 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-4.1/021-add-ap148-partitions.patch |  34 +-
 ...0-hwspinlock-core-add-device-tree-support.patch | 167 
 ...qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch | 234 ++
 ...spinlock-qcom-Correct-msb-in-regmap_field.patch |  26 +
 ...3-soc-qcom-Add-sfbp-device-to-IPQ806x-dts.patch |  21 +
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +
 ...36-soc-qcom-add-smem-to-IPQ806x-platforms.patch |  27 +
 .../patches-4.1/037-mtd-add-qcom-smem-parser.patch | 253 +++
 ...-qcom-add-pcie-nodes-to-ipq806x-platforms.patch |   4 +-
 .../patches-4.1/115-add-pcie-aux-clk-dts.patch |   6 +-
 .../patches-4.1/126-add-rpm-to-ipq8064-dts.patch   |   4 +-
 ...m-Add-necessary-DT-data-for-Krait-cpufreq.patch |   4 +-
 .../157-ARM-DT-ipq8064-Add-ADM-device-node.patch   |   2 +-
 ...-dts-Add-NAND-controller-node-for-ipq806x.patch |   2 +-
 ...nable-NAND-node-on-IPQ8064-AP148-platform.patch |   4 +-
 ...RM-dts-qcom-add-mdio-nodes-to-ap148-db149.patch |   6 +-
 ...-qcom-add-gmac-nodes-to-ipq806x-platforms.patch |   4 +-
 56 files changed, 3765 insertions(+), 313 deletions(-)
 delete mode 100644 
target/linux/bcm53xx/patches-4.1/095-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 
target/linux/generic/patches-3.18/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 
target/linux/generic/patches-4.1/140-mtd-part-add-generic-parsing-of-linux-part-probe.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/030-hwspinlock-core-add-device-tree-support.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/031-hwspinlock-qcom-Add-support-for-Qualcomm-HW-Mutex-bl.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/032-hwspinlock-qcom-Correct-msb-in-regmap_field.patch
 create mode 100644 

[OpenWrt-Devel] [PATCH 4/5] ipq806x: add QCOM SMEM based MTD parser

2015-08-14 Thread Mathieu Olivari
This patch adds a new parser which uses the SMEM available on IPQ and
some other QCOM platforms to map the MTD partitions.

Signed-off-by: Mathieu Olivari 
---
 ...37-mtd-add-SMEM-parser-for-QCOM-platforms.patch | 277 +
 ...37-mtd-add-SMEM-parser-for-QCOM-platforms.patch | 277 +
 2 files changed, 554 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-3.18/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch
 
b/target/linux/ipq806x/patches-3.18/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch
new file mode 100644
index 000..b2c8cd5
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/037-mtd-add-SMEM-parser-for-QCOM-platforms.patch
@@ -0,0 +1,277 @@
+From 0501f76b138cf1dc11a313bb7a094da524b79337 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari 
+Date: Thu, 13 Aug 2015 09:53:14 -0700
+Subject: [PATCH 3/3] mtd: add SMEM parser for QCOM platforms
+
+On QCOM platforms using MTD devices storage (such as IPQ806x), SMEM is
+used to store partition layout. This new parser can now be used to read
+SMEM and use it to register an MTD layout according to its content.
+
+Signed-off-by: Mathieu Olivari 
+---
+ drivers/mtd/Kconfig  |   7 ++
+ drivers/mtd/Makefile |   1 +
+ drivers/mtd/qcom_smem_part.c | 231 +++
+ 3 files changed, 239 insertions(+)
+ create mode 100644 drivers/mtd/qcom_smem_part.c
+
+--- a/drivers/mtd/Kconfig
 b/drivers/mtd/Kconfig
+@@ -200,6 +200,13 @@ config MTD_MYLOADER_PARTS
+ You will still need the parsing functions to be called by the driver
+ for your particular device. It won't happen automatically.
+ 
++config MTD_QCOM_SMEM_PARTS
++  tristate "QCOM SMEM partitioning support"
++  depends on QCOM_SMEM
++  help
++This provides partitions parser for QCOM devices using SMEM
++such as IPQ806x.
++
+ comment "User Modules And Translation Layers"
+ 
+ #
+--- /dev/null
 b/drivers/mtd/qcom_smem_part.c
+@@ -0,0 +1,231 @@
++/*
++ * Copyright (c) 2015, The Linux Foundation. All rights reserved.
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 and
++ * only version 2 as published by the Free Software Foundation.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ */
++
++#include 
++#include 
++#include 
++
++#include 
++#include 
++#include 
++#include 
++
++#include 
++
++/* Processor/host identifier for the application processor */
++#define SMEM_HOST_APPS0
++
++/* SMEM items index */
++#define SMEM_AARM_PARTITION_TABLE 9
++#define SMEM_BOOT_FLASH_TYPE  421
++#define SMEM_BOOT_FLASH_BLOCK_SIZE424
++
++/* SMEM Flash types */
++#define SMEM_FLASH_NAND   2
++#define SMEM_FLASH_SPI6
++
++#define SMEM_PART_NAME_SZ 16
++#define SMEM_PARTS_MAX32
++
++struct smem_partition {
++  char name[SMEM_PART_NAME_SZ];
++  __le32 start;
++  __le32 size;
++  __le32 attr;
++};
++
++struct smem_partition_table {
++  u8 magic[8];
++  __le32 version;
++  __le32 len;
++  struct smem_partition parts[SMEM_PARTS_MAX];
++};
++
++/* SMEM Magic values in partition table */
++static const u8 SMEM_PTABLE_MAGIC[] = {
++  0xaa, 0x73, 0xee, 0x55,
++  0xdb, 0xbd, 0x5e, 0xe3,
++};
++
++static int qcom_smem_get_flash_blksz(u64 **smem_blksz)
++{
++  int ret;
++  size_t size;
++
++  ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_BLOCK_SIZE,
++  (void **) smem_blksz, &size);
++
++  if (ret < 0) {
++  pr_err("Unable to read flash blksz from SMEM\n");
++  return -ENOENT;
++  }
++
++  if (size != sizeof(**smem_blksz)) {
++  pr_err("Invalid flash blksz size in SMEM\n");
++  return -EINVAL;
++  }
++
++  return 0;
++}
++
++static int qcom_smem_get_flash_type(u64 **smem_flash_type)
++{
++  int ret;
++  size_t size;
++
++  ret = qcom_smem_get(SMEM_HOST_APPS, SMEM_BOOT_FLASH_TYPE,
++  (void **) smem_flash_type, &size);
++
++  if (ret < 0) {
++  pr_err("Unable to read flash type from SMEM\n");
++  return -ENOENT;
++  }
++
++  if (size != sizeof(**smem_flash_type)) {
++  pr_err("Invalid flash type size in SMEM\n");
++  return -EINVAL;
++  }
++
++  return 0;

[OpenWrt-Devel] [PATCH 3/5] ipq806x: add SMEM support

2015-08-14 Thread Mathieu Olivari
2 patches are cherry-picked from the following LKML thread:
*https://lkml.org/lkml/2015/4/11/208

The last patch (036-soc-qcom-add-smem-to-IPQ806x-platforms.patch) is
adding the corresponding DT nodes required for IPQ806x.

Signed-off-by: Mathieu Olivari 
---
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +
 ...-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch |  36 +
 ...soc-qcom-Add-device-tree-binding-for-SMEM.patch |  82 ++
 ...soc-qcom-Add-Shared-Memory-Manager-driver.patch | 841 +
 ...-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch |  36 +
 6 files changed, 1918 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-3.18/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 create mode 100644 
target/linux/ipq806x/patches-4.1/036-ARM-qcom-add-SMEM-device-node-to-IPQ806x-dts.patch

diff --git 
a/target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
 
b/target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
new file mode 100644
index 000..d22db22
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/034-soc-qcom-Add-device-tree-binding-for-SMEM.patch
@@ -0,0 +1,82 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,1/2] soc: qcom: Add device tree binding for SMEM
+From: Bjorn Andersson 
+X-Patchwork-Id: 6202201
+Message-Id: <1428795178-24312-1-git-send-email-bjorn.anders...@sonymobile.com>
+To: Rob Herring , Pawel Moll ,
+   Mark Rutland ,
+   Ian Campbell ,
+   Kumar Gala , Jeffrey Hugo , 
+   Andry Gross 
+Cc: ,
+   linux-arm-msm ,
+   
+Date: Sat, 11 Apr 2015 16:32:57 -0700
+
+Add device tree binding documentation for the Qualcom Shared Memory
+manager.
+
+Signed-off-by: Bjorn Andersson 
+
+---
+Changes since v1:
+- None
+
+ .../devicetree/bindings/soc/qcom/qcom,smem.txt | 49 ++
+ 1 file changed, 49 insertions(+)
+ create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
+
+--- /dev/null
 b/Documentation/devicetree/bindings/soc/qcom/qcom,smem.txt
+@@ -0,0 +1,49 @@
++Qualcomm Shared Memory binding
++
++This binding describes the Qualcomm Shared Memory, used to share data between
++various subsystems and OSes in Qualcomm platforms.
++
++- compatible:
++  Usage: required
++  Value type: 
++  Definition: must be:
++  "qcom,smem"
++
++- memory-region:
++  Usage: required
++  Value type: 
++  Definition: handle to memory reservation for main smem memory region.
++
++- reg:
++  Usage: optional
++  Value type: 
++  Definition: base address and size pair for any additional memory areas
++  of the shared memory.
++
++- hwspinlocks:
++  Usage: required
++  Value type: 
++  Definition: reference to a hwspinlock used to protect allocations from
++  the shared memory
++
++= EXAMPLE
++
++  reserved-memory {
++  #address-cells = <1>;
++  #size-cells = <1>;
++  ranges;
++
++  smem_region: smem@fa0 {
++  reg = <0xfa0 0x20>;
++  no-map;
++  };
++  };
++
++  smem@fa0 {
++  compatible = "qcom,smem";
++
++  memory-region = <&smem_region>;
++  reg = <0xfc428000 0x4000>;
++
++  hwlocks = <&tcsr_mutex 3>;
++  };
diff --git 
a/target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
 
b/target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
new file mode 100644
index 000..c8cff1a
--- /dev/null
+++ 
b/target/linux/ipq806x/patches-3.18/035-soc-qcom-Add-Shared-Memory-Manager-driver.patch
@@ -0,0 +1,841 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: [v2,2/2] soc: qcom: Add Shared Memory Manager driver
+From: Bjorn Andersson 
+X-Patchwork-Id: 6202211
+Message-Id: <1428795178-24312-2-git-send-email-bjorn.anders...@sonymobile.com>
+To: Kumar Gala , Andy Gross ,
+   David Brown , Jeffrey Hugo 
+Cc: , ,
+   
+Date: Sat, 11 Apr 2015 16:32:58 -0700
+
+The Shared Memory Manager driver implements an interface for allocating
+and accessing items in the memory area shared among all of the
+processors in a Qualco

[OpenWrt-Devel] [PATCH 2/2] ipq806x: add UBI image generation

2015-08-20 Thread Mathieu Olivari
UBI image will be used to flash in NAND.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/image/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index b64d629..698aeb9 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -34,6 +34,8 @@ define Device/Default
KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
DEVICE_DTS :=
KERNEL_PREFIX := $$(IMAGE_PREFIX)
+   IMAGES:= ubinized.bin
+   IMAGE/ubinized.bin := ubinize-image squashfs
 endef
 DEVICE_VARS += DEVICE_DTS
 
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/2] include: add a new ubinize-image build target

2015-08-20 Thread Mathieu Olivari
This new build target can be used to generate a ubinized.bin file,
including the kernel and the FS specified as an argument.

Signed-off-by: Mathieu Olivari 
---
 include/image.mk | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/image.mk b/include/image.mk
index 73fc805..f98d871 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -380,6 +380,12 @@ define Build/combined-image
@mv $@.new $@
 endef
 
+define Build/ubinize-image
+   $(if $(filter $(1),$(TARGET_FILESYSTEMS)), \
+   $(call Image/Build/UbinizeImage,$(DEVICE_NAME),--kernel $(word 
1,$^),$(1),$(UBINIZE_OPTS)); \
+   cp $(KDIR)/$(IMG_PREFIX)-$(DEVICE_NAME)-$(1)-ubinized.bin $@)
+endef
+
 define Device/Init
   PROFILES := $(PROFILE)
   DEVICE_NAME := $(1)
-- 
2.1.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] include: remove file before overwritting it with replace_script

2014-09-11 Thread Mathieu Olivari
config.{sub,guess} could be symlinks to a shared common version of
this file (e.g. in staging). So we remove the destination file via
--remove-destination option of cp. This prevents replaceing the
common file that other packages could be build with if running at
the same time.

This fixes a class of errors where config.sub is missing, or
only partially present when running configure because a cp is
currently in progress

This is commonly seen building with a lot of parallel jobs and
on packages that use 'PKG_FIXUP:=autoreconf'

Signed-off-by: Matthew McClintock 
Signed-off-by: Mathieu Olivari 
---
 include/package-defaults.mk |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/package-defaults.mk b/include/package-defaults.mk
index 61e495f..051cde5 100644
--- a/include/package-defaults.mk
+++ b/include/package-defaults.mk
@@ -98,7 +98,9 @@ CONFIGURE_VARS = \
 CONFIGURE_PATH = .
 CONFIGURE_CMD = ./configure
 
-replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; $(FIND) $(1) 
-name $(2) | $(XARGS) -n1 cp $(SCRIPT_DIR)/$(2);
+replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; \
+  $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp --remove-destination \
+  $(SCRIPT_DIR)/$(2);
 
 define Build/Configure/Default
(cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] build: allow openwrt.git packages to be replaced by feeds

2015-01-16 Thread Mathieu Olivari
Currently, replacing a package available in openwrt.git requires
modifications in openwrt.git, or requires duplicating the package in a
feed but with a different name, which causes all kind of problems
related to dependencies (all packages selecting it would have to be
modified accordingly to select the new package).

With this change, if a package with the same name is present both in
feeds/ and package/ folders, the one in feeds/ will override the one
in package/, both in the menuconfig and during the build.

This mechanism is particularly useful for vendor tree, or in general for
application which needs to replace one particular package which exists
within openwrt.git by a custom/newer version.

Signed-off-by: Mathieu Olivari 
---
 include/scan.awk |   17 +
 include/scan.mk  |2 +-
 scripts/feeds|9 ++---
 3 files changed, 24 insertions(+), 4 deletions(-)
 create mode 100644 include/scan.awk

diff --git a/include/scan.awk b/include/scan.awk
new file mode 100644
index 000..39b2977
--- /dev/null
+++ b/include/scan.awk
@@ -0,0 +1,17 @@
+BEGIN { FS="/" }
+$1 ~ /^feeds/ { FEEDS[$NF]=$0 }
+$1 !~ /^feeds/ { PKGS[$NF]=$0 }
+END {
+   # Filter-out OpenWrt packages which have a feeds equivalent
+   for (pkg in PKGS)
+   if (pkg in FEEDS)
+   delete PKGS[pkg]
+   n = asort(PKGS)
+   for (i=1; i <= n; i++) {
+   print PKGS[i]
+   }
+   n = asort(FEEDS)
+   for (i=1; i <= n; i++){
+   print FEEDS[i]
+   }
+}
diff --git a/include/scan.mk b/include/scan.mk
index 0998333..138707d 100644
--- a/include/scan.mk
+++ b/include/scan.mk
@@ -43,7 +43,7 @@ endef
 
 $(FILELIST):
rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
-   $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call 
(Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 
's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq > $@
+   $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call 
(Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 
's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -f include/scan.awk > $@
 
 $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
( \
diff --git a/scripts/feeds b/scripts/feeds
index 31ad544..01d9041 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -384,12 +384,15 @@ sub install_package {
 
# previously installed packages set the runtime package
# newly installed packages set the source package
-   $installed{$src} and return 0;
+   $installed{$src} and !is_core_package($src) and return 0;
 
# check previously installed packages
-   $installed{$name} and return 0;
+   $installed{$name} and !is_core_package($name) and return 0;
$installed{$src} = 1;
-   warn "Installing package '$src'\n";
+
+   is_core_package($src)
+   and warn "Overriding package '$src'\n"
+   or warn "Installing package '$src'\n";
 
$install_method{$type} or do {
warn "Unknown installation method: '$type'\n";
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] build: allow openwrt.git packages to be replaced by feeds

2015-01-21 Thread Mathieu Olivari
Currently, replacing a package available in openwrt.git requires
modifications in openwrt.git, or requires duplicating the package in a
feed but with a different name, which causes all kind of problems
related to dependencies (all packages selecting it would have to be
modified accordingly to select the new package).

With this change, if a package with the same name is present both in
feeds/ and package/ folders, the one in feeds/ can override the one
in package/, both in the menuconfig and during the build, by passing the
"-f" option to "./scripts/feeds install"

This mechanism is particularly useful for vendor tree, or in general for
application which needs to replace one particular package which exists
within openwrt.git by a custom/newer version.

Signed-off-by: Mathieu Olivari 
---
v2:
*fix an issue when trying to override packages which include a dependency in the
 core packages. (ex: lua depends on liblua, which exists in the core, which
 ended-up in the package not being overridden properly).
*address John's concerns about core OpenWrt packages being overriden without
 notice and control. Override is now disable by default, and "-f" needs to be
 passed to "./scripts/feeds install" to allow it.
---
 include/scan.awk |   17 +
 include/scan.mk  |2 +-
 scripts/feeds|   25 ++---
 3 files changed, 36 insertions(+), 8 deletions(-)
 create mode 100644 include/scan.awk

diff --git a/include/scan.awk b/include/scan.awk
new file mode 100644
index 000..39b2977
--- /dev/null
+++ b/include/scan.awk
@@ -0,0 +1,17 @@
+BEGIN { FS="/" }
+$1 ~ /^feeds/ { FEEDS[$NF]=$0 }
+$1 !~ /^feeds/ { PKGS[$NF]=$0 }
+END {
+   # Filter-out OpenWrt packages which have a feeds equivalent
+   for (pkg in PKGS)
+   if (pkg in FEEDS)
+   delete PKGS[pkg]
+   n = asort(PKGS)
+   for (i=1; i <= n; i++) {
+   print PKGS[i]
+   }
+   n = asort(FEEDS)
+   for (i=1; i <= n; i++){
+   print FEEDS[i]
+   }
+}
diff --git a/include/scan.mk b/include/scan.mk
index 0998333..138707d 100644
--- a/include/scan.mk
+++ b/include/scan.mk
@@ -43,7 +43,7 @@ endef
 
 $(FILELIST):
rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
-   $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call 
(Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 
's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq > $@
+   $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call 
(Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 
's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -f include/scan.awk > $@
 
 $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
( \
diff --git a/scripts/feeds b/scripts/feeds
index 31ad544..6c03375 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -358,6 +358,7 @@ sub is_core_package($) {
 sub install_package {
my $feed = shift;
my $name = shift;
+   my $force = shift;
my $ret = 0;
 
$feed = lookup_package($feed, $name);
@@ -383,13 +384,22 @@ sub install_package {
$src or $src = $name;
 
# previously installed packages set the runtime package
-   # newly installed packages set the source package
-   $installed{$src} and return 0;
+   # newly installed packages set the source package to 1
+   $installed{$src} and $installed{$src} == 1 and return 0;
+
+   # we'll trigger the override only with the 3 conditions below:
+   # - override is allowed by command line (-f)
+   # - a package with the same src exists in the core packages list
+   # - the package previously installed is not from a feed
+   my $override = 1 if ($force and is_core_package($src) and 
!$installed{$src}->{feed});
 
# check previously installed packages
-   $installed{$name} and return 0;
+   $installed{$name} and !$override and return 0;
$installed{$src} = 1;
-   warn "Installing package '$src'\n";
+
+   $override == 1
+   and warn "Overriding package '$src'\n"
+   or warn "Installing package '$src'\n";
 
$install_method{$type} or do {
warn "Unknown installation method: '$type'\n";
@@ -436,7 +446,7 @@ sub install {
my $feed;
my $ret = 0;
 
-   getopts('ap:d:h', \%opts);
+   getopts('ap:d:fh', \%opts);
 
if ($opts{h}) {
usage();
@@ -462,7 +472,7 @@ sub install {
my $p = $feed_package->{$name};
next if $p->{vdepe

[OpenWrt-Devel] [Patch v3 1/4] build: allow openwrt.git packages to be replaced by feeds

2015-02-02 Thread Mathieu Olivari
Currently, replacing a package available in openwrt.git requires
modifications in openwrt.git, or requires duplicating the package in a
feed but with a different name, which causes all kind of problems
related to dependencies (all packages selecting it would have to be
modified accordingly to select the new package).

With this change, if a package with the same name is present both in
feeds/ and package/ folders, the one in feeds/ can override the one
in package/, both in the menuconfig and during the build, by passing the
"-f" option to "./scripts/feeds install"

This mechanism is particularly useful for vendor tree, or in general for
application which needs to replace one particular package which exists
within openwrt.git by a custom/newer version.

Signed-off-by: Mathieu Olivari 
---

Notes:
v2:
*fix an issue when trying to override packages which include a dependency 
in the
 core packages. (ex: lua depends on liblua, which exists in the core, which
 ended-up in the package not being overridden properly).
*address John's concerns about core OpenWrt packages being overriden without
 notice and control. Override is now disable by default, and "-f" needs to 
be
 passed to "./scripts/feeds install" to allow it.

v3:
*fix the errors reported by ./scripts/feeds while installing regular 
packages:
 Use of uninitialized value $override in numeric eq (==) at ./scripts/feeds 
line 400.

 include/scan.awk | 17 +
 include/scan.mk  |  2 +-
 scripts/feeds| 30 ++
 3 files changed, 40 insertions(+), 9 deletions(-)
 create mode 100644 include/scan.awk

diff --git a/include/scan.awk b/include/scan.awk
new file mode 100644
index 000..39b2977
--- /dev/null
+++ b/include/scan.awk
@@ -0,0 +1,17 @@
+BEGIN { FS="/" }
+$1 ~ /^feeds/ { FEEDS[$NF]=$0 }
+$1 !~ /^feeds/ { PKGS[$NF]=$0 }
+END {
+   # Filter-out OpenWrt packages which have a feeds equivalent
+   for (pkg in PKGS)
+   if (pkg in FEEDS)
+   delete PKGS[pkg]
+   n = asort(PKGS)
+   for (i=1; i <= n; i++) {
+   print PKGS[i]
+   }
+   n = asort(FEEDS)
+   for (i=1; i <= n; i++){
+   print FEEDS[i]
+   }
+}
diff --git a/include/scan.mk b/include/scan.mk
index 0998333..138707d 100644
--- a/include/scan.mk
+++ b/include/scan.mk
@@ -43,7 +43,7 @@ endef
 
 $(FILELIST):
rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
-   $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call 
(Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 
's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq > $@
+   $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call 
(Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 
's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -f include/scan.awk > $@
 
 $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
( \
diff --git a/scripts/feeds b/scripts/feeds
index 31ad544..4b98d3e 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -358,6 +358,7 @@ sub is_core_package($) {
 sub install_package {
my $feed = shift;
my $name = shift;
+   my $force = shift;
my $ret = 0;
 
$feed = lookup_package($feed, $name);
@@ -382,14 +383,26 @@ sub install_package {
my $type = $feed->[0];
$src or $src = $name;
 
+   # If it's a core package and we don't want to override, just return
+   !$force and is_core_package($src) and return 0;
+
# previously installed packages set the runtime package
-   # newly installed packages set the source package
-   $installed{$src} and return 0;
+   # newly installed packages set the source package to 1
+   $installed{$src} and $installed{$src} == 1 and return 0;
+
+   # we'll trigger the override only with the 3 conditions below:
+   # - override is allowed by command line (-f)
+   # - a package with the same src exists in the core packages list
+   # - the package previously installed is not from a feed
+   my $override = 1 if ($force and is_core_package($src) and 
!$installed{$name}->{feed});
 
# check previously installed packages
-   $installed{$name} and return 0;
+   $installed{$name} and !$override and return 0;
$installed{$src} = 1;
-   warn "Installing package '$src'\n";
+
+   defined($override) and $override == 1
+   and warn "Overriding package '$src'\n"
+   or warn "Installing package '$src'\n";
 
$install_method{$type} or do {
warn &

[OpenWrt-Devel] [Patch v3 4/4] base-files: taint the build if the override mechanism is used

2015-02-02 Thread Mathieu Olivari
If some packages are overridden (using ./scripts/feeds -f), add a new
taint flag in /etc/openwrt_release. We'll use the CONFIG_OVERRIDE_PKGS
variable reported through the .config to detect it.

Signed-off-by: Mathieu Olivari 
---
 include/version.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/version.mk b/include/version.mk
index c3cc170..99af96e 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -58,6 +58,7 @@ VERSION_TAINT_SPECS := \
+USE_EGLIBC:eglibc \
+USE_MKLIBS:mklibs \
+BUSYBOX_CUSTOM:busybox \
+   +OVERRIDE_PKGS:override \
 
 VERSION_TAINTS := $(strip $(foreach taint,$(VERSION_TAINT_SPECS), \
$(if $(findstring +,$(taint)), \
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [Patch v3 2/4] build: propagate override information to .packageinfo

2015-02-02 Thread Mathieu Olivari
Packages overridden with "./scripts/feeds -f" will show up with an
"Override: " in .packageinfo.

This will be useful to create a corresponding option in .config and
use this information during the build process.

Signed-off-by: Mathieu Olivari 
---
 include/scan.awk |  4 +++-
 include/scan.mk  | 26 +-
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/include/scan.awk b/include/scan.awk
index 39b2977..0f02782 100644
--- a/include/scan.awk
+++ b/include/scan.awk
@@ -4,8 +4,10 @@ $1 !~ /^feeds/ { PKGS[$NF]=$0 }
 END {
# Filter-out OpenWrt packages which have a feeds equivalent
for (pkg in PKGS)
-   if (pkg in FEEDS)
+   if (pkg in FEEDS) {
+   print PKGS[pkg] > of
delete PKGS[pkg]
+   }
n = asort(PKGS)
for (i=1; i <= n; i++) {
print PKGS[i]
diff --git a/include/scan.mk b/include/scan.mk
index 138707d..c301579 100644
--- a/include/scan.mk
+++ b/include/scan.mk
@@ -10,6 +10,7 @@ SCAN_NAME ?= package
 SCAN_DIR ?= package
 TARGET_STAMP:=$(TMP_DIR)/info/.files-$(SCAN_TARGET).stamp
 FILELIST:=$(TMP_DIR)/info/.files-$(SCAN_TARGET)-$(SCAN_COOKIE)
+OVERRIDELIST:=$(TMP_DIR)/info/.overrides-$(SCAN_TARGET)-$(SCAN_COOKIE)
 
 ifeq ($(IS_TTY),1)
   define progress
@@ -31,6 +32,7 @@ define PackageDir
{ \
$$(call progress,Collecting $(SCAN_NAME) info: 
$(SCAN_DIR)/$(2)) \
echo Source-Makefile: $(SCAN_DIR)/$(2)/Makefile; \
+   $(if $(3),echo Override: $(3),true); \
$(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call 
feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) 2>/dev/null || { \
mkdir -p "$(TOPDIR)/logs/$(SCAN_DIR)/$(2)"; \
$(NO_TRACE_MAKE) --no-print-dir -r DUMP=1 FEED="$(call 
feedname,$(2))" -C $(SCAN_DIR)/$(2) $(SCAN_MAKEOPTS) > 
$(TOPDIR)/logs/$(SCAN_DIR)/$(2)/dump.txt 2>&1; \
@@ -41,17 +43,31 @@ define PackageDir
} > $$@ || true
 endef
 
-$(FILELIST):
+$(OVERRIDELIST):
+   rm -f $(TMP_DIR)/info/.overrides-$(SCAN_TARGET)-*
+   touch $@
+
+$(FILELIST): $(OVERRIDELIST)
rm -f $(TMP_DIR)/info/.files-$(SCAN_TARGET)-*
-   $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call 
(Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 
's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -f include/scan.awk > $@
+   $(call FIND_L, $(SCAN_DIR)) $(SCAN_EXTRA) -mindepth 1 $(if 
$(SCAN_DEPTH),-maxdepth $(SCAN_DEPTH)) -name Makefile | xargs grep -HE 'call 
(Build/DefaultTargets|Build(Package|Target)|.+Package)' | sed -e 
's#^$(SCAN_DIR)/##' -e 's#/Makefile:.*##' | uniq | awk -v of=$(OVERRIDELIST) -f 
include/scan.awk > $@
 
 $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
( \
cat $< | awk '{print "$(SCAN_DIR)/" $$0 "/Makefile" }' | xargs 
grep -HE '^ *SCAN_DEPS *= *' | awk -F: '{ gsub(/^.*DEPS *= */, "", $$2); print 
"DEPS_" $$1 "=" $$2 }'; \
-   awk -v deps="$$DEPS" '{ \
+   awk -F/ -v deps="$$DEPS" -v of="$(OVERRIDELIST)" ' \
+   BEGIN { \
+   while (getline < (of)) \
+   override[$$NF]=$$0; \
+   close(of) \
+   } \
+   { \
info=$$0; \
gsub(/\//, "_", info); \
-   print "$$(eval $$(call PackageDir," info "," $$0 "))"; \
+   dir=$$0; \
+   pkg=""; \
+   if($$NF in override) \
+   pkg=override[$$NF]; \
+   print "$$(eval $$(call PackageDir," info "," dir "," 
pkg "))"; \
} ' < $<; \
true; \
) > $@
@@ -61,7 +77,7 @@ $(TMP_DIR)/info/.files-$(SCAN_TARGET).mk: $(FILELIST)
 $(TARGET_STAMP)::
+( \
$(NO_TRACE_MAKE) $(FILELIST); \
-   MD5SUM=$$(cat $(FILELIST) | (md5sum || md5) 2>/dev/null | awk 
'{print $$1}'); \
+   MD5SUM=$$(cat $(FILELIST) $(OVERRIDELIST) | (md5sum || md5) 
2>/dev/null | awk '{print $$1}'); \
[ -f "$@.$$MD5SUM" ] || { \
rm -f $@.*; \
touch $@.$$MD5SUM; \
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [Patch v3 3/4] build: propagate override information to .config file

2015-02-02 Thread Mathieu Olivari
With this change, override information is now parsed from the metadata
and put in the %packages hash. A new hash - %overrides - is created and
exported, to be used during the .config-package.in generation.

If an override is detected, a new option CONFIG_OVERRIDE_PKGS will be
created in the .config, and will contain a space-separated list of all
the overridden packages.

Signed-off-by: Mathieu Olivari 
---
 scripts/metadata.pl |  8 
 scripts/metadata.pm | 11 ++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/scripts/metadata.pl b/scripts/metadata.pl
index ea437f5..abf8248 100755
--- a/scripts/metadata.pl
+++ b/scripts/metadata.pl
@@ -679,6 +679,13 @@ EOF
print "endmenu\n\n";
 }
 
+sub print_package_overrides() {
+   keys %overrides > 0 or return;
+   print "\tconfig OVERRIDE_PKGS\n";
+   print "\t\tstring\n";
+   print "\t\tdefault \"".join(" ", keys %overrides)."\"\n\n";
+}
+
 sub gen_package_config() {
parse_package_metadata($ARGV[0]) or exit 1;
print "menuconfig IMAGEOPT\n\tbool \"Image configuration\"\n\tdefault 
n\n";
@@ -704,6 +711,7 @@ EOF
foreach my $cat (sort {uc($a) cmp uc($b)} keys %category) {
print_package_config_category $cat;
}
+   print_package_overrides();
 }
 
 sub get_conditional_dep($$) {
diff --git a/scripts/metadata.pm b/scripts/metadata.pm
index fc86573..4bf70bb 100644
--- a/scripts/metadata.pm
+++ b/scripts/metadata.pm
@@ -2,7 +2,7 @@ package metadata;
 use base 'Exporter';
 use strict;
 use warnings;
-our @EXPORT = qw(%package %srcpackage %category %subdir %preconfig %features 
clear_packages parse_package_metadata get_multiline);
+our @EXPORT = qw(%package %srcpackage %category %subdir %preconfig %features 
%overrides clear_packages parse_package_metadata get_multiline);
 
 our %package;
 our %preconfig;
@@ -10,6 +10,7 @@ our %srcpackage;
 our %category;
 our %subdir;
 our %features;
+our %overrides;
 
 sub get_multiline {
my $fh = shift;
@@ -30,6 +31,7 @@ sub clear_packages() {
%srcpackage = ();
%category = ();
%features = ();
+   %overrides = ();
 }
 
 sub parse_package_metadata($) {
@@ -40,6 +42,7 @@ sub parse_package_metadata($) {
my $preconfig;
my $subdir;
my $src;
+   my $override;
 
open FILE, "<$file" or do {
warn "Cannot open '$file': $!\n";
@@ -54,8 +57,13 @@ sub parse_package_metadata($) {
$subdir =~ s/^package\///;
$subdir{$src} = $subdir;
$srcpackage{$src} = [];
+   $override = "";
undef $pkg;
};
+   /^Override: \s*(.+?)\s*$/ and do {
+   $override = $1;
+   $overrides{$src} = 1;
+   };
next unless $src;
/^Package:\s*(.+?)\s*$/ and do {
undef $feature;
@@ -70,6 +78,7 @@ sub parse_package_metadata($) {
$pkg->{buildtypes} = [];
$pkg->{subdir} = $subdir;
$pkg->{tristate} = 1;
+   $pkg->{override} = $override;
$package{$1} = $pkg;
push @{$srcpackage{$src}}, $pkg;
};
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] Porting package, need permanent storage

2015-02-06 Thread Mathieu Olivari
Don’t create it into /var/lib. Instead, create it somewhere in /etc.

If for some reason you don’t want to modify your daemon, then create a link 
from /var/lib to a persistent location in /etc before you launch your daemon in 
your init.d script.

 

From: openwrt-devel [mailto:openwrt-devel-boun...@lists.openwrt.org] On Behalf 
Of Antonio Gómez Soto
Sent: Friday, February 06, 2015 7:27 AM
To: openwrt-devel@lists.openwrt.org
Subject: [OpenWrt-Devel] Porting package, need permanent storage

 

Hi,

 

I am porting a software package to openwrt. It's a daemon which runs in the 
background.

Problem is, this daemon spontaneously creates a file in /var/lib. It's a one 
line ascii

file, but it needs to be preserved across reboots.

 

How do I accomplish that? I know about UCI, but I think that populates nvram

on service restart, and I can't have that. This daemon runs, and just suddenly

creates that file, and it needs to stay there forever.

 

Thanks for any pointers,

Antonio

___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/4] ipq806x: add JFFS2 mark at the end of the squashfs

2015-02-10 Thread Mathieu Olivari
Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/image/Makefile | 4 
 1 file changed, 4 insertions(+)

diff --git a/target/linux/ipq806x/image/Makefile 
b/target/linux/ipq806x/image/Makefile
index 977e674..77d191f 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -24,6 +24,10 @@ define Image/BuildKernel
$(call Image/BuildKernel/FIT,qcom-ipq8064-ap148)
 endef
 
+define Image/Build/squashfs
+   $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
+endef
+
 define Image/Build
$(call Image/Build/$(1),$(1))
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1)-root.img bs=2k 
conv=sync
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/4] ipq806x: fix SPI read errors

2015-02-10 Thread Mathieu Olivari
SPI read errors are reported even with the board sitting idle.
Fixes have been posted to linux-spi mailing list but not merged yet, so
we'll just pull the patches and apply them locally:

*001-spi-qup-Add-DMA-capabilities.patch is pulled from:
 http://marc.info/?l=linux-spi&m=140381685115859&w=2

*002-v3-spi-qup-Fix-incorrect-block-transfers.patch is pulled from:
 http://marc.info/?l=linux-spi&m=141211211011539&w=2

Signed-off-by: Mathieu Olivari 
---
 .../patches/001-spi-qup-Add-DMA-capabilities.patch | 522 +
 ...-v3-spi-qup-Fix-incorrect-block-transfers.patch | 376 +++
 2 files changed, 898 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches/001-spi-qup-Add-DMA-capabilities.patch
 create mode 100644 
target/linux/ipq806x/patches/002-v3-spi-qup-Fix-incorrect-block-transfers.patch

diff --git 
a/target/linux/ipq806x/patches/001-spi-qup-Add-DMA-capabilities.patch 
b/target/linux/ipq806x/patches/001-spi-qup-Add-DMA-capabilities.patch
new file mode 100644
index 000..62badd5
--- /dev/null
+++ b/target/linux/ipq806x/patches/001-spi-qup-Add-DMA-capabilities.patch
@@ -0,0 +1,522 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: spi: qup: Add DMA capabilities
+From: Andy Gross 
+X-Patchwork-Id: 4432401
+Message-Id: <1403816781-31008-1-git-send-email-agr...@codeaurora.org>
+To: Mark Brown 
+Cc: linux-...@vger.kernel.org, Sagar Dharia ,
+   Daniel Sneddon ,
+   Bjorn Andersson ,
+   "Ivan T. Ivanov" ,
+   linux-ker...@vger.kernel.org, linux-arm-ker...@lists.infradead.org,
+   linux-arm-...@vger.kernel.org, Andy Gross 
+Date: Thu, 26 Jun 2014 16:06:21 -0500
+
+This patch adds DMA capabilities to the spi-qup driver.  If DMA channels are
+present, the QUP will use DMA instead of block mode for transfers to/from SPI
+peripherals for transactions larger than the length of a block.
+
+Signed-off-by: Andy Gross 
+
+---
+.../devicetree/bindings/spi/qcom,spi-qup.txt   |   10 +
+ drivers/spi/spi-qup.c  |  361 ++--
+ 2 files changed, 350 insertions(+), 21 deletions(-)
+
+--- a/Documentation/devicetree/bindings/spi/qcom,spi-qup.txt
 b/Documentation/devicetree/bindings/spi/qcom,spi-qup.txt
+@@ -27,6 +27,11 @@ Optional properties:
+ - spi-max-frequency: Specifies maximum SPI clock frequency,
+  Units - Hz. Definition as per
+  Documentation/devicetree/bindings/spi/spi-bus.txt
++- dmas : Two DMA channel specifiers following the convention 
outlined
++ in bindings/dma/dma.txt
++- dma-names: Names for the dma channels, if present. There must be at
++ least one channel named "tx" for transmit and named "rx" 
for
++ receive.
+ - num-cs: total number of chipselects
+ - cs-gpios:   should specify GPIOs used for chipselects.
+   The gpios will be referred to as reg =  in the SPI child
+@@ -51,6 +56,10 @@ Example:
+   clocks = <&gcc GCC_BLSP2_QUP2_SPI_APPS_CLK>, <&gcc 
GCC_BLSP2_AHB_CLK>;
+   clock-names = "core", "iface";
+ 
++  dmas = <&blsp2_bam 2>,
++  <&blsp2_bam 3>;
++  dma-names = "rx", "tx";
++
+   pinctrl-names = "default";
+   pinctrl-0 = <&spi8_default>;
+ 
+--- a/drivers/spi/spi-qup.c
 b/drivers/spi/spi-qup.c
+@@ -22,6 +22,8 @@
+ #include 
+ #include 
+ #include 
++#include 
++#include 
+ 
+ #define QUP_CONFIG0x
+ #define QUP_STATE 0x0004
+@@ -116,6 +118,8 @@
+ 
+ #define SPI_NUM_CHIPSELECTS   4
+ 
++#define SPI_MAX_XFER  (SZ_64K - 64)
++
+ /* high speed mode is when bus rate is greater then 26MHz */
+ #define SPI_HS_MIN_RATE   2600
+ #define SPI_MAX_RATE  5000
+@@ -143,6 +147,17 @@ struct spi_qup {
+   int tx_bytes;
+   int rx_bytes;
+   int qup_v1;
++
++  int use_dma;
++
++  struct dma_chan *rx_chan;
++  struct dma_slave_config rx_conf;
++  struct dma_chan *tx_chan;
++  struct dma_slave_config tx_conf;
++  dma_addr_t  rx_dma;
++  dma_addr_t  tx_dma;
++  void*dummy;
++  atomic_tdma_outstanding;
+ };
+ 
+ 
+@@ -266,6 +281,221 @@ static void spi_qup_fifo_write(struct sp
+   }
+ }
+ 
++static void qup_dma_callback(void *data)
++{
++  struct spi_qup *controller = data;
++
++  if (atomic_dec_and_test(&controller->dma_outstanding))
++  complete(&controller->done);
++}
++
++static int spi_qup_do_dma(struct spi_qup *c

[OpenWrt-Devel] [PATCH 4/4] ipq806x: enable NOR flash support in the kernel config

2015-02-10 Thread Mathieu Olivari
Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.18 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index d45862b..22d8092 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -221,6 +221,8 @@ CONFIG_MSM_IOMMU=y
 CONFIG_MSM_MMCC_8960=y
 CONFIG_MSM_MMCC_8974=y
 CONFIG_MTD_CMDLINE_PARTS=y
+CONFIG_MTD_M25P80=y
+CONFIG_MTD_SPI_NOR=y
 CONFIG_MTD_SPLIT_SUPPORT=y
 CONFIG_MULTI_IRQ_HANDLER=y
 CONFIG_MUTEX_SPIN_ON_OWNER=y
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/3] ipq806x: fix restart

2015-02-18 Thread Mathieu Olivari
Add an out of tree patch to fix reset on IPQ806x. Patch is available on
codeaurora.org but needs to be cleaned-up and upstreamed properly at
some point.

Signed-off-by: Mathieu Olivari 
---
 .../003-HACK-qcom-make-restart-work-w-IPQ.patch| 65 ++
 1 file changed, 65 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches/003-HACK-qcom-make-restart-work-w-IPQ.patch

diff --git 
a/target/linux/ipq806x/patches/003-HACK-qcom-make-restart-work-w-IPQ.patch 
b/target/linux/ipq806x/patches/003-HACK-qcom-make-restart-work-w-IPQ.patch
new file mode 100644
index 000..6a82ac4
--- /dev/null
+++ b/target/linux/ipq806x/patches/003-HACK-qcom-make-restart-work-w-IPQ.patch
@@ -0,0 +1,65 @@
+From 1e09cb4ab430cac62687bd1e5cf796a654f4d78d Mon Sep 17 00:00:00 2001
+From: Josh Cartwright 
+Date: Mon, 8 Sep 2014 00:15:40 -0500
+Subject: [PATCH] HACK: qcom: make restart work w/ IPQ
+
+Make use of the watchdog to trigger a reset.  This is hacky for a
+variety of reasons:
+ - Other mechanisms should be used on other systems proper PS_HOLD
+   handling
+ - This doesn't belong in the board file.  It should belong in a
+   watchdog driver.
+ - As a proper driver, it should make use of device tree to query the
+   start of the register region
+
+Change-Id: Ib5ca21a42ac64e0812186d31a87c8d63d49976c2
+Signed-off-by: Josh Cartwright 
+---
+ arch/arm/mach-qcom/board.c | 29 +
+ 1 file changed, 29 insertions(+)
+
+diff --git a/arch/arm/mach-qcom/board.c b/arch/arm/mach-qcom/board.c
+index 6d8bbf7..7c6891d 100644
+--- a/arch/arm/mach-qcom/board.c
 b/arch/arm/mach-qcom/board.c
+@@ -11,8 +11,37 @@
+  */
+ 
+ #include 
++#include 
++#include 
+ 
+ #include 
++#include 
++
++static void __iomem *wdt;
++
++#define WDT0_RST  0x38
++#define WDT0_EN   0x40
++#define WDT0_BARK_TIME0x4C
++#define WDT0_BITE_TIME0x5C
++
++static void wdt_restart(enum reboot_mode reboot_mode, const char *cmd)
++{
++  writel_relaxed(1, wdt + WDT0_RST);
++  writel_relaxed(5*0x31F3, wdt + WDT0_BARK_TIME);
++  writel_relaxed(0x31F3, wdt + WDT0_BITE_TIME);
++  writel_relaxed(1, wdt + WDT0_EN);
++}
++
++static int wdt_init(void)
++{
++  wdt = ioremap(0x0200A000, 4096);
++  if (!wdt)
++  return -EINVAL;
++
++  arm_pm_restart = wdt_restart;
++  return 0;
++}
++late_initcall(wdt_init);
+ 
+ static const char * const qcom_dt_match[] __initconst = {
+   "qcom,apq8064",
+-- 
+1.9.1
+
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/3] ipq806x: enable watchdog kernel option

2015-02-18 Thread Mathieu Olivari
Some bootloaders seem to trigger the watchdog during the boot process,
therefore the lack of watchdog driver trigger a reboot a few seconds
after boot. So we'll enable it here to avoid it.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.18 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 22d8092..7cda416 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -290,7 +290,7 @@ CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_SCM=y
-# CONFIG_QCOM_WDT is not set
+CONFIG_QCOM_WDT=y
 # CONFIG_RCU_BOOST is not set
 CONFIG_RCU_CPU_STALL_TIMEOUT=21
 CONFIG_RCU_CPU_STALL_VERBOSE=y
@@ -357,6 +357,7 @@ CONFIG_VECTORS_BASE=0x
 CONFIG_VFP=y
 CONFIG_VFPv3=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_WATCHDOG_CORE=y
 # CONFIG_WIZNET_W5100 is not set
 # CONFIG_WIZNET_W5300 is not set
 # CONFIG_WL_TI is not set
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3] ipq806x: add ap148 bootargs to DT

2015-02-18 Thread Mathieu Olivari
This will simplify the boot process by avoiding the bootloader
bootargs configuration process.

Signed-off-by: Mathieu Olivari 
---
 .../ipq806x/patches/004-add-ap148-bootargs.patch   | 86 ++
 1 file changed, 86 insertions(+)
 create mode 100644 target/linux/ipq806x/patches/004-add-ap148-bootargs.patch

diff --git a/target/linux/ipq806x/patches/004-add-ap148-bootargs.patch 
b/target/linux/ipq806x/patches/004-add-ap148-bootargs.patch
new file mode 100644
index 000..0b2ccec
--- /dev/null
+++ b/target/linux/ipq806x/patches/004-add-ap148-bootargs.patch
@@ -0,0 +1,86 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -14,6 +14,10 @@
+   };
+   };
+ 
++  chosen {
++  bootargs = "console=ttyMSM0,115200 root=/dev/mtdblock12 
rootfstype=squashfs,jffs2";
++  };
++
+   soc {
+   pinmux@80 {
+   i2c4_pins: i2c4_pinmux {
+@@ -70,13 +74,68 @@
+   reg = <0>;
+ 
+   partition@0 {
+-  label = "rootfs";
+-  reg = <0x0 0x100>;
++  label = "0:SBL1";
++  reg = <0x0 0x2>;
+   };
+ 
+   partition@1 {
+-  label = "scratch";
+-  reg = <0x100 0x100>;
++  label = "0:MIBIB";
++  reg = <0x2 0x2>;
++  };
++
++  partition@2 {
++  label = "0:SBL2";
++  reg = <0x4 0x4>;
++  };
++
++  partition@3 {
++  label = "0:DDR";
++  reg = <0x8 0x1>;
++  };
++
++  partition@4 {
++  label = "0:DDRCONFIG";
++  reg = <0x9 0x1>;
++  };
++
++  partition@5 {
++  label = "0:SSD";
++  reg = <0xa 0x1>;
++  };
++
++  partition@6 {
++  label = "0:TZ";
++  reg = <0xb 0x8>;
++  };
++
++  partition@7 {
++  label = "0:RPM";
++  reg = <0x13 0x8>;
++  };
++
++  partition@8 {
++  label = "0:APSSBL";
++  reg = <0x1b 0x8>;
++  };
++
++  partition@9 {
++  label = "0:APSSBLENV";
++  reg = <0x23 0x4>;
++  };
++
++  partition@a {
++  label = "0:ART";
++  reg = <0x27 0x4>;
++  };
++
++  partition@b {
++  label = "0:HLOS";
++  reg = <0x2b 0x30>;
++  };
++
++  partition@c {
++  label = "rootfs";
++  reg = <0x5b 0x1a5>;
+   };
+   };
+   };
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/2] kernel: Add a selectable option for ar8xxx

2015-02-18 Thread Mathieu Olivari
AR8xxx driver covers all the QCA switch families. Most architectures
usually build it in the kernel, but it may be valuable for some targets
to build it as a module for more flexibility.

Signed-off-by: Mathieu Olivari 
---
 package/kernel/linux/modules/netdevices.mk | 16 
 1 file changed, 16 insertions(+)

diff --git a/package/kernel/linux/modules/netdevices.mk 
b/package/kernel/linux/modules/netdevices.mk
index b5dc92f..cce1b90 100644
--- a/package/kernel/linux/modules/netdevices.mk
+++ b/package/kernel/linux/modules/netdevices.mk
@@ -165,6 +165,22 @@ endef
 $(eval $(call KernelPackage,swconfig))
 
 
+define KernelPackage/switch-ar8xxx
+  SUBMENU:=$(NETWORK_DEVICES_MENU)
+  TITLE:=Qualcomm Atheros AR82XX/AR83XX switch support
+  DEPENDS:=+kmod-swconfig
+  KCONFIG:=CONFIG_AR8XXX_PHY
+  FILES:=$(LINUX_DIR)/drivers/net/phy/ar8xxx.ko
+  AUTOLOAD:=$(call AutoLoad,42,ar8xxx)
+endef
+
+define KernelPackage/switch-ar8xxx/description
+ Qualcomm atheros AR82XX/AR83XX switch support
+endef
+
+$(eval $(call KernelPackage,switch-ar8xxx))
+
+
 define KernelPackage/switch-ip17xx
   SUBMENU:=$(NETWORK_DEVICES_MENU)
   TITLE:=IC+ IP17XX switch support
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/2] kernel: make ar8216 driver selectable as a package

2015-02-18 Thread Mathieu Olivari
The two changes below aims at making the (currently called) ar8216 driver
selectable as an OpenWrt package. Currently, and unlike some other switches,
this driver must be built-in the kernel if we want to enable it.

This is currently impossible for 2 reasons:
*there is no openwrt package to select it
*even if there was one, the 2 objects built by the kernel (ar8216.o and
 ar8327.o) are interdependent, therefore build fails at the end of the kernel
 build.

The 2 changes below fix this issue by renaming the module into ar8xxx.ko, and
marking ar8216.o and ar8327.o as dependencies of this .ko. The name ar8xxx is
also more inline with the current driver structure and where the implementation
seems to be going.

Mathieu Olivari (2):
  kernel: rename ar8216.ko into ar8xxx.ko
  kernel: Add a selectable option for ar8xxx

 package/kernel/linux/modules/netdevices.mk | 16 
 target/linux/ar71xx/config-3.14|  2 +-
 target/linux/atheros/config-3.14   |  2 +-
 target/linux/generic/config-3.10   |  4 +--
 target/linux/generic/config-3.13   |  4 +--
 target/linux/generic/config-3.14   |  4 +--
 target/linux/generic/config-3.18   |  4 +--
 target/linux/generic/config-3.19   |  4 +--
 target/linux/generic/config-3.8|  2 +-
 .../linux/generic/files/drivers/net/phy/ar8327.c   |  6 ++---
 .../generic/patches-3.10/724-phy_ar8216.patch  | 24 -
 .../generic/patches-3.10/724-phy_ar8xxx.patch  | 30 ++
 .../generic/patches-3.10/725-phy_rtl8306.patch |  2 +-
 .../generic/patches-3.10/726-phy_rtl8366.patch |  2 +-
 .../generic/patches-3.13/724-phy_ar8216.patch  | 24 -
 .../generic/patches-3.13/724-phy_ar8xxx.patch  | 30 ++
 .../generic/patches-3.13/725-phy_rtl8306.patch |  2 +-
 .../generic/patches-3.13/726-phy_rtl8366.patch |  2 +-
 .../generic/patches-3.14/724-phy_ar8216.patch  | 24 -
 .../generic/patches-3.14/724-phy_ar8xxx.patch  | 30 ++
 .../generic/patches-3.14/725-phy_rtl8306.patch |  2 +-
 .../generic/patches-3.14/726-phy_rtl8366.patch |  2 +-
 .../generic/patches-3.14/733-phy_mvsw61xx.patch|  2 +-
 .../generic/patches-3.18/724-phy_ar8216.patch  | 24 -
 .../generic/patches-3.18/724-phy_ar8xxx.patch  | 30 ++
 .../generic/patches-3.18/725-phy_rtl8306.patch |  4 +--
 .../generic/patches-3.18/726-phy_rtl8366.patch |  2 +-
 .../patches-3.18/732-phy-ar8216-led-support.patch  | 13 --
 .../patches-3.18/732-phy-ar8xxx-led-support.patch  | 13 ++
 .../generic/patches-3.18/733-phy_mvsw61xx.patch|  2 +-
 .../generic/patches-3.19/724-phy_ar8216.patch  | 24 -
 .../generic/patches-3.19/724-phy_ar8xxx.patch  | 30 ++
 .../generic/patches-3.19/725-phy_rtl8306.patch |  2 +-
 .../generic/patches-3.19/726-phy_rtl8366.patch |  2 +-
 .../generic/patches-3.19/733-phy_mvsw61xx.patch|  2 +-
 .../linux/generic/patches-3.8/724-phy_ar8216.patch | 24 -
 .../linux/generic/patches-3.8/724-phy_ar8xxx.patch | 30 ++
 .../generic/patches-3.8/725-phy_rtl8306.patch  |  2 +-
 .../generic/patches-3.8/726-phy_rtl8366.patch  |  2 +-
 target/linux/lantiq/xrx200/config-3.14 |  2 +-
 target/linux/lantiq/xrx200/config-default  |  2 +-
 target/linux/lantiq/xway/config-3.14   |  2 +-
 target/linux/lantiq/xway/config-default|  2 +-
 target/linux/mpc85xx/config-3.14   |  4 +--
 target/linux/ramips/rt3883/config-3.18 |  2 +-
 45 files changed, 248 insertions(+), 196 deletions(-)
 delete mode 100644 target/linux/generic/patches-3.10/724-phy_ar8216.patch
 create mode 100644 target/linux/generic/patches-3.10/724-phy_ar8xxx.patch
 delete mode 100644 target/linux/generic/patches-3.13/724-phy_ar8216.patch
 create mode 100644 target/linux/generic/patches-3.13/724-phy_ar8xxx.patch
 delete mode 100644 target/linux/generic/patches-3.14/724-phy_ar8216.patch
 create mode 100644 target/linux/generic/patches-3.14/724-phy_ar8xxx.patch
 delete mode 100644 target/linux/generic/patches-3.18/724-phy_ar8216.patch
 create mode 100644 target/linux/generic/patches-3.18/724-phy_ar8xxx.patch
 delete mode 100644 
target/linux/generic/patches-3.18/732-phy-ar8216-led-support.patch
 create mode 100644 
target/linux/generic/patches-3.18/732-phy-ar8xxx-led-support.patch
 delete mode 100644 target/linux/generic/patches-3.19/724-phy_ar8216.patch
 create mode 100644 target/linux/generic/patches-3.19/724-phy_ar8xxx.patch
 delete mode 100644 target/linux/generic/patches-3.8/724-phy_ar8216.patch
 create mode 100644 target/linux/generic/patches-3.8/724-phy_ar8xxx.patch

-- 
1.9.1
___
openwrt-devel mailing list
openwrt

[OpenWrt-Devel] [PATCH 1/2] kernel: rename ar8216.ko into ar8xxx.ko

2015-02-18 Thread Mathieu Olivari
ar8216 driver can no longer be built as a loadable kernel module, since
it's been splitted up into 2 pieces (ar8216 and ar8327), and these two
pieces are interdependent.

This patch is fixing this by renaming the loadable kernel module into
ar8xxx.ko, which will include the 2 objects above.

In order to keep the option name consistent, we're also renaming the
kernel option CONFIG_AR8XXX_PHY, which ends-up propagating the change
into the patches-* folders and the different kernel configs.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ar71xx/config-3.14|  2 +-
 target/linux/atheros/config-3.14   |  2 +-
 target/linux/generic/config-3.10   |  4 +--
 target/linux/generic/config-3.13   |  4 +--
 target/linux/generic/config-3.14   |  4 +--
 target/linux/generic/config-3.18   |  4 +--
 target/linux/generic/config-3.19   |  4 +--
 target/linux/generic/config-3.8|  2 +-
 .../linux/generic/files/drivers/net/phy/ar8327.c   |  6 ++---
 .../generic/patches-3.10/724-phy_ar8216.patch  | 24 -
 .../generic/patches-3.10/724-phy_ar8xxx.patch  | 30 ++
 .../generic/patches-3.10/725-phy_rtl8306.patch |  2 +-
 .../generic/patches-3.10/726-phy_rtl8366.patch |  2 +-
 .../generic/patches-3.13/724-phy_ar8216.patch  | 24 -
 .../generic/patches-3.13/724-phy_ar8xxx.patch  | 30 ++
 .../generic/patches-3.13/725-phy_rtl8306.patch |  2 +-
 .../generic/patches-3.13/726-phy_rtl8366.patch |  2 +-
 .../generic/patches-3.14/724-phy_ar8216.patch  | 24 -
 .../generic/patches-3.14/724-phy_ar8xxx.patch  | 30 ++
 .../generic/patches-3.14/725-phy_rtl8306.patch |  2 +-
 .../generic/patches-3.14/726-phy_rtl8366.patch |  2 +-
 .../generic/patches-3.14/733-phy_mvsw61xx.patch|  2 +-
 .../generic/patches-3.18/724-phy_ar8216.patch  | 24 -
 .../generic/patches-3.18/724-phy_ar8xxx.patch  | 30 ++
 .../generic/patches-3.18/725-phy_rtl8306.patch |  4 +--
 .../generic/patches-3.18/726-phy_rtl8366.patch |  2 +-
 .../patches-3.18/732-phy-ar8216-led-support.patch  | 13 --
 .../patches-3.18/732-phy-ar8xxx-led-support.patch  | 13 ++
 .../generic/patches-3.18/733-phy_mvsw61xx.patch|  2 +-
 .../generic/patches-3.19/724-phy_ar8216.patch  | 24 -
 .../generic/patches-3.19/724-phy_ar8xxx.patch  | 30 ++
 .../generic/patches-3.19/725-phy_rtl8306.patch |  2 +-
 .../generic/patches-3.19/726-phy_rtl8366.patch |  2 +-
 .../generic/patches-3.19/733-phy_mvsw61xx.patch|  2 +-
 .../linux/generic/patches-3.8/724-phy_ar8216.patch | 24 -
 .../linux/generic/patches-3.8/724-phy_ar8xxx.patch | 30 ++
 .../generic/patches-3.8/725-phy_rtl8306.patch  |  2 +-
 .../generic/patches-3.8/726-phy_rtl8366.patch  |  2 +-
 target/linux/lantiq/xrx200/config-3.14 |  2 +-
 target/linux/lantiq/xrx200/config-default  |  2 +-
 target/linux/lantiq/xway/config-3.14   |  2 +-
 target/linux/lantiq/xway/config-default|  2 +-
 target/linux/mpc85xx/config-3.14   |  4 +--
 target/linux/ramips/rt3883/config-3.18 |  2 +-
 44 files changed, 232 insertions(+), 196 deletions(-)
 delete mode 100644 target/linux/generic/patches-3.10/724-phy_ar8216.patch
 create mode 100644 target/linux/generic/patches-3.10/724-phy_ar8xxx.patch
 delete mode 100644 target/linux/generic/patches-3.13/724-phy_ar8216.patch
 create mode 100644 target/linux/generic/patches-3.13/724-phy_ar8xxx.patch
 delete mode 100644 target/linux/generic/patches-3.14/724-phy_ar8216.patch
 create mode 100644 target/linux/generic/patches-3.14/724-phy_ar8xxx.patch
 delete mode 100644 target/linux/generic/patches-3.18/724-phy_ar8216.patch
 create mode 100644 target/linux/generic/patches-3.18/724-phy_ar8xxx.patch
 delete mode 100644 
target/linux/generic/patches-3.18/732-phy-ar8216-led-support.patch
 create mode 100644 
target/linux/generic/patches-3.18/732-phy-ar8xxx-led-support.patch
 delete mode 100644 target/linux/generic/patches-3.19/724-phy_ar8216.patch
 create mode 100644 target/linux/generic/patches-3.19/724-phy_ar8xxx.patch
 delete mode 100644 target/linux/generic/patches-3.8/724-phy_ar8216.patch
 create mode 100644 target/linux/generic/patches-3.8/724-phy_ar8xxx.patch

diff --git a/target/linux/ar71xx/config-3.14 b/target/linux/ar71xx/config-3.14
index b78d4d2..c6f4c70 100644
--- a/target/linux/ar71xx/config-3.14
+++ b/target/linux/ar71xx/config-3.14
@@ -2,7 +2,7 @@ CONFIG_AG71XX=y
 CONFIG_AG71XX_AR8216_SUPPORT=y
 # CONFIG_AG71XX_DEBUG is not set
 # CONFIG_AG71XX_DEBUG_FS is not set
-CONFIG_AR8216_PHY=y
+CONFIG_AR8XXX_PHY=y
 CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
 CONFIG_ARCH_DISCARD_

[OpenWrt-Devel] [PATCH] ipq806x: delete config-3.14 file

2015-02-18 Thread Mathieu Olivari
ipq806x target has been upgraded to 3.14. There is no need to maintain
this file anymore.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.14 | 360 ---
 1 file changed, 360 deletions(-)
 delete mode 100644 target/linux/ipq806x/config-3.14

diff --git a/target/linux/ipq806x/config-3.14 b/target/linux/ipq806x/config-3.14
deleted file mode 100644
index 9d10716..000
--- a/target/linux/ipq806x/config-3.14
+++ /dev/null
@@ -1,360 +0,0 @@
-# CONFIG_AHCI_QCOM is not set
-CONFIG_ALIGNMENT_TRAP=y
-# CONFIG_AMBA_PL08X is not set
-# CONFIG_APM_EMULATION is not set
-CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
-CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
-CONFIG_ARCH_HAS_TICK_BROADCAST=y
-CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
-CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
-# CONFIG_ARCH_MSM is not set
-CONFIG_ARCH_MSM8960=y
-CONFIG_ARCH_MSM8974=y
-CONFIG_ARCH_MSM8X60=y
-CONFIG_ARCH_MULTIPLATFORM=y
-# CONFIG_ARCH_MULTI_CPU_AUTO is not set
-CONFIG_ARCH_MULTI_V6_V7=y
-CONFIG_ARCH_MULTI_V7=y
-# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
-CONFIG_ARCH_NR_GPIO=0
-CONFIG_ARCH_QCOM=y
-CONFIG_ARCH_REQUIRE_GPIOLIB=y
-# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
-# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
-CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
-CONFIG_ARM=y
-CONFIG_ARM_AMBA=y
-CONFIG_ARM_ARCH_TIMER=y
-CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
-CONFIG_ARM_CPU_SUSPEND=y
-CONFIG_ARM_GIC=y
-CONFIG_ARM_L1_CACHE_SHIFT=6
-CONFIG_ARM_L1_CACHE_SHIFT_6=y
-# CONFIG_ARM_LPAE is not set
-CONFIG_ARM_NR_BANKS=8
-CONFIG_ARM_PATCH_PHYS_VIRT=y
-# CONFIG_ARM_SP805_WATCHDOG is not set
-CONFIG_ARM_THUMB=y
-# CONFIG_ARM_THUMBEE is not set
-CONFIG_ARM_UNWIND=y
-CONFIG_ARM_VIRT_EXT=y
-CONFIG_AUTO_ZRELADDR=y
-# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
-CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
-CONFIG_BOUNCE=y
-# CONFIG_CACHE_L2X0 is not set
-CONFIG_CLEANCACHE=y
-CONFIG_CLKDEV_LOOKUP=y
-CONFIG_CLKSRC_OF=y
-CONFIG_CLKSRC_QCOM=y
-CONFIG_CLONE_BACKWARDS=y
-CONFIG_COMMON_CLK=y
-CONFIG_COMMON_CLK_QCOM=y
-CONFIG_COMPACTION=y
-CONFIG_COREDUMP=y
-CONFIG_CPU_32v6K=y
-CONFIG_CPU_32v7=y
-CONFIG_CPU_ABRT_EV7=y
-# CONFIG_CPU_BPREDICT_DISABLE is not set
-CONFIG_CPU_CACHE_V7=y
-CONFIG_CPU_CACHE_VIPT=y
-CONFIG_CPU_COPY_V6=y
-CONFIG_CPU_CP15=y
-CONFIG_CPU_CP15_MMU=y
-CONFIG_CPU_HAS_ASID=y
-# CONFIG_CPU_ICACHE_DISABLE is not set
-CONFIG_CPU_PABRT_V7=y
-CONFIG_CPU_PM=y
-CONFIG_CPU_RMAP=y
-CONFIG_CPU_TLB_V7=y
-CONFIG_CPU_V7=y
-CONFIG_CRC16=y
-# CONFIG_CRC32_SARWATE is not set
-CONFIG_CRC32_SLICEBY8=y
-CONFIG_CROSS_MEMORY_ATTACH=y
-CONFIG_CRYPTO_XZ=y
-CONFIG_DCACHE_WORD_ACCESS=y
-CONFIG_DEBUG_BUGVERBOSE=y
-CONFIG_DEBUG_GPIO=y
-CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
-CONFIG_DEBUG_PREEMPT=y
-# CONFIG_DEBUG_UART_8250 is not set
-# CONFIG_DEBUG_UART_PL01X is not set
-# CONFIG_DEBUG_USER is not set
-CONFIG_DECOMPRESS_GZIP=y
-CONFIG_DMADEVICES=y
-CONFIG_DMA_ENGINE=y
-CONFIG_DMA_OF=y
-CONFIG_DMA_VIRTUAL_CHANNELS=y
-CONFIG_DTC=y
-# CONFIG_DW_DMAC_CORE is not set
-# CONFIG_DW_DMAC_PCI is not set
-CONFIG_DYNAMIC_DEBUG=y
-CONFIG_FREEZER=y
-CONFIG_GENERIC_BUG=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
-CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
-CONFIG_GENERIC_IDLE_POLL_SETUP=y
-CONFIG_GENERIC_IO=y
-CONFIG_GENERIC_IRQ_SHOW=y
-CONFIG_GENERIC_NET_UTILS=y
-CONFIG_GENERIC_PCI_IOMAP=y
-CONFIG_GENERIC_PHY=y
-CONFIG_GENERIC_PINCONF=y
-CONFIG_GENERIC_SCHED_CLOCK=y
-CONFIG_GENERIC_SMP_IDLE_THREAD=y
-CONFIG_GENERIC_STRNCPY_FROM_USER=y
-CONFIG_GENERIC_STRNLEN_USER=y
-CONFIG_GPIOLIB=y
-CONFIG_GPIO_DEVRES=y
-# CONFIG_GPIO_MSM_V2 is not set
-CONFIG_GPIO_SYSFS=y
-CONFIG_HARDIRQS_SW_RESEND=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT=y
-# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_PFN_VALID=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-CONFIG_HAVE_ARM_ARCH_TIMER=y
-# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
-CONFIG_HAVE_BPF_JIT=y
-CONFIG_HAVE_CC_STACKPROTECTOR=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CLK_PREPARE=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DMA_API_DEBUG=y
-CONFIG_HAVE_DMA_ATTRS=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_HAVE_HW_BREAKPOINT=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_KERNEL_GZIP=y
-CONFIG_HAVE_KERNEL_LZ4=y
-CONFIG_HAVE_KERNEL_LZMA=y
-CONFIG_HAVE_KERNEL_LZO=y
-CONFIG_HAVE_KERNEL_XZ=y
-CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_PERF_REGS=y
-CONFIG_HAVE_PERF_USER_ST

Re: [OpenWrt-Devel] [PATCH 2/2] kernel: Add a selectable option for ar8xxx

2015-02-19 Thread Mathieu Olivari
The git log is a bit misleading actually. This change is more meant to
provide the flexibility to enable/disable the switch driver from openwrt
menu.
It would make it easier if somebody wants to build a firmware for a platform
which doesn't have the switch, and wants to save the space associated with
it. Could be useful as well in the future, if somebody implements a
switchdev/dsa based driver; having an openwrt menuconfig would facilitate
disabling the swconfig based one to enable the in kernel one. Rather than
modifying the kernel config to do the same.

In which case, this facility would have to be enabled on a per-target basis
- as it would require to remove the option from config-3.xx. I was typically
thinking about doing this for ipq806x. Therefore my comment about "on
certain targets" :)

Thanks,
Mathieu
-Original Message-
From: Felix Fietkau [mailto:n...@openwrt.org] 
Sent: Wednesday, February 18, 2015 11:58 PM
To: Mathieu Olivari; blo...@openwrt.org; hkallwe...@gmail.com
Cc: openwrt-devel@lists.openwrt.org
Subject: Re: [PATCH 2/2] kernel: Add a selectable option for ar8xxx

On 2015-02-19 12:25, Mathieu Olivari wrote:
> AR8xxx driver covers all the QCA switch families. Most architectures 
> usually build it in the kernel, but it may be valuable for some 
> targets to build it as a module for more flexibility.
> 
> Signed-off-by: Mathieu Olivari 
On what targets would this be useful, and why?

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH V2 1/2] ipq806x: enable watchdog kernel option

2015-02-20 Thread Mathieu Olivari
Some bootloaders seem to trigger the watchdog during the boot process,
therefore the lack of watchdog driver trigger a reboot a few seconds
after boot. So we'll enable it here to avoid it.

Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.18 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 22d8092..7cda416 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -290,7 +290,7 @@ CONFIG_PROC_PAGE_MONITOR=y
 CONFIG_QCOM_BAM_DMA=y
 CONFIG_QCOM_GSBI=y
 CONFIG_QCOM_SCM=y
-# CONFIG_QCOM_WDT is not set
+CONFIG_QCOM_WDT=y
 # CONFIG_RCU_BOOST is not set
 CONFIG_RCU_CPU_STALL_TIMEOUT=21
 CONFIG_RCU_CPU_STALL_VERBOSE=y
@@ -357,6 +357,7 @@ CONFIG_VECTORS_BASE=0x
 CONFIG_VFP=y
 CONFIG_VFPv3=y
 CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_WATCHDOG_CORE=y
 # CONFIG_WIZNET_W5100 is not set
 # CONFIG_WIZNET_W5300 is not set
 # CONFIG_WL_TI is not set
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH V2 2/2] ipq806x: fix "reboot" command

2015-02-20 Thread Mathieu Olivari
The watchdog driver already registers a restart notifier, we just have
to enable it in the config and in the DT to fix the "reboot" command.

This is done by integratin the following patch-set:
https://lkml.org/lkml/2015/2/20/610

I'm copy-pasting the description below:
qcom-wdt is currently assuming the presence of a dedicated node in DT
to gets its configuration. However, on msm architecture, the watchdog is
usually part of the timer block. So this patch-set is changing the driver
and slightly enhancing the timer DT bindings to provide the relevant clocks
and interrupts.

Signed-off-by: Mathieu Olivari 
---
 ...atchdog-qcom-use-timer-devicetree-binding.patch | 72 ++
 ...m-add-description-of-KPSS-WDT-for-IPQ8064.patch | 53 
 ...-watchdog-entries-to-DT-timer-binding-doc.patch | 50 +++
 3 files changed, 175 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches/011-watchdog-qcom-use-timer-devicetree-binding.patch
 create mode 100644 
target/linux/ipq806x/patches/012-ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch
 create mode 100644 
target/linux/ipq806x/patches/013-ARM-msm-add-watchdog-entries-to-DT-timer-binding-doc.patch

diff --git 
a/target/linux/ipq806x/patches/011-watchdog-qcom-use-timer-devicetree-binding.patch
 
b/target/linux/ipq806x/patches/011-watchdog-qcom-use-timer-devicetree-binding.patch
new file mode 100644
index 000..0cd7da1
--- /dev/null
+++ 
b/target/linux/ipq806x/patches/011-watchdog-qcom-use-timer-devicetree-binding.patch
@@ -0,0 +1,72 @@
+From fded70251b1b58f68de1d3757ece9965f0b75452 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari 
+Date: Thu, 19 Feb 2015 20:19:30 -0800
+Subject: [PATCH 1/3] watchdog: qcom: use timer devicetree binding
+
+MSM watchdog configuration happens in the same register block as the
+timer, so we'll use the same binding as the existing timer.
+
+The qcom-wdt will now be probed when devicetree has an entry compatible
+with "qcom,kpss-timer" or "qcom-scss-timer".
+
+Signed-off-by: Mathieu Olivari 
+---
+ drivers/watchdog/qcom-wdt.c | 21 +++--
+ 1 file changed, 15 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/watchdog/qcom-wdt.c b/drivers/watchdog/qcom-wdt.c
+index aa85618..aa03ca8 100644
+--- a/drivers/watchdog/qcom-wdt.c
 b/drivers/watchdog/qcom-wdt.c
+@@ -20,9 +20,9 @@
+ #include 
+ #include 
+ 
+-#define WDT_RST   0x0
+-#define WDT_EN0x8
+-#define WDT_BITE_TIME 0x24
++#define WDT_RST   0x38
++#define WDT_EN0x40
++#define WDT_BITE_TIME 0x5C
+ 
+ struct qcom_wdt {
+   struct watchdog_device  wdd;
+@@ -117,6 +117,8 @@ static int qcom_wdt_probe(struct platform_device *pdev)
+ {
+   struct qcom_wdt *wdt;
+   struct resource *res;
++  struct device_node *np = pdev->dev.of_node;
++  u32 percpu_offset;
+   int ret;
+ 
+   wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
+@@ -124,6 +126,14 @@ static int qcom_wdt_probe(struct platform_device *pdev)
+   return -ENOMEM;
+ 
+   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
++
++  /* We use CPU0's DGT for the watchdog */
++  if (of_property_read_u32(np, "cpu-offset", &percpu_offset))
++  percpu_offset = 0;
++
++  res->start += percpu_offset;
++  res->end += percpu_offset;
++
+   wdt->base = devm_ioremap_resource(&pdev->dev, res);
+   if (IS_ERR(wdt->base))
+   return PTR_ERR(wdt->base);
+@@ -203,9 +213,8 @@ static int qcom_wdt_remove(struct platform_device *pdev)
+ }
+ 
+ static const struct of_device_id qcom_wdt_of_table[] = {
+-  { .compatible = "qcom,kpss-wdt-msm8960", },
+-  { .compatible = "qcom,kpss-wdt-apq8064", },
+-  { .compatible = "qcom,kpss-wdt-ipq8064", },
++  { .compatible = "qcom,kpss-timer" },
++  { .compatible = "qcom,scss-timer" },
+   { },
+ };
+ MODULE_DEVICE_TABLE(of, qcom_wdt_of_table);
+-- 
+1.9.1
+
diff --git 
a/target/linux/ipq806x/patches/012-ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch
 
b/target/linux/ipq806x/patches/012-ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch
new file mode 100644
index 000..24a093a
--- /dev/null
+++ 
b/target/linux/ipq806x/patches/012-ARM-qcom-add-description-of-KPSS-WDT-for-IPQ8064.patch
@@ -0,0 +1,53 @@
+From 297cf8136ecd6a56520888fd28948393766b8ee7 Mon Sep 17 00:00:00 2001
+From: Mathieu Olivari 
+Date: Thu, 19 Feb 2015 20:27:39 -0800
+Subject: [PATCH 2/3] ARM: qcom: add description of KPSS WDT for IPQ8064
+
+Add the watchdog related entries to the Krait Processor Sub-system
+(KPSS) timer IPQ8064 devicetree section. Also, add a fixed-clock
+description of SLEEP_CLK, which will do for now.
+
+Signed-off-by: Josh Cartwright 
+Signed-off-by: Mathieu Olivari 
+---
+ arch/arm/boot/dts/qcom-ipq8064.dtsi | 14 +-
+ 1 fi

[OpenWrt-Devel] [PATCH] ipq806x: fix spi read issues observed with SMP enabled

2015-02-23 Thread Mathieu Olivari
This change is fixing the issues observed when booting from NOR flash
with SMP enabled.

Error logs below:
building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of
xref (0 dead, 0 orphan) found.
m25p80 spi32766.0: SPI transfer failed: -110
spi_master spi32766: failed to transfer one message from queue
jffs2: Write of 873 bytes at 0x019001e8 failed. returned 0, retlen 792

Patch is cherry-picked from here:
https://www.codeaurora.org/cgit/quic/qsdk/oss/kernel/linux-msm/commit/drivers/spi/spi-qup.c?h=coconut_20140924&id=4faba89e3ffbb1c5f6232651375b9b3212b50f02

More details in the patch file.

Signed-off-by: Mathieu Olivari 
---
 .../003-spi-qup-Ensure-done-detection.patch| 56 ++
 1 file changed, 56 insertions(+)
 create mode 100644 
target/linux/ipq806x/patches/003-spi-qup-Ensure-done-detection.patch

diff --git 
a/target/linux/ipq806x/patches/003-spi-qup-Ensure-done-detection.patch 
b/target/linux/ipq806x/patches/003-spi-qup-Ensure-done-detection.patch
new file mode 100644
index 000..7052227
--- /dev/null
+++ b/target/linux/ipq806x/patches/003-spi-qup-Ensure-done-detection.patch
@@ -0,0 +1,56 @@
+From 4faba89e3ffbb1c5f6232651375b9b3212b50f02 Mon Sep 17 00:00:00 2001
+From: Andy Gross 
+Date: Thu, 15 Jan 2015 17:56:02 -0800
+Subject: [PATCH] spi: qup: Ensure done detection
+
+This patch fixes an issue where a SPI transaction has completed, but the done
+condition is missed.  This occurs because at the time of interrupt the
+MAX_INPUT_DONE_FLAG is not asserted.  However, in the process of reading blocks
+of data from the FIFO, the last portion of data comes in.
+
+The opflags read at the beginning of the irq handler no longer matches the
+current opflag state.  To get around this condition, the block read function
+should update the opflags so that done detection is correct after the return.
+
+Change-Id: If109e0eeb432f96000d765c4b34dbb2269f8093f
+Signed-off-by: Andy Gross 
+---
+ drivers/spi/spi-qup.c | 12 +++-
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+--- a/drivers/spi/spi-qup.c
 b/drivers/spi/spi-qup.c
+@@ -298,7 +298,7 @@ static void spi_qup_fifo_write(struct sp
+ }
+ 
+ static void spi_qup_block_read(struct spi_qup *controller,
+-  struct spi_transfer *xfer)
++  struct spi_transfer *xfer, u32 *opflags)
+ {
+   u32 data;
+   u32 reads_per_blk = controller->in_blk_sz >> 2;
+@@ -327,10 +327,12 @@ static void spi_qup_block_read(struct sp
+ 
+   /*
+* Due to extra stickiness of the QUP_OP_IN_SERVICE_FLAG during block
+-   * reads, it has to be cleared again at the very end
++   * reads, it has to be cleared again at the very end.  However, be sure
++   * to refresh opflags value because MAX_INPUT_DONE_FLAG may now be
++   * present and this is used to determine if transaction is complete
+*/
+-  if (readl_relaxed(controller->base + QUP_OPERATIONAL) &
+-  QUP_OP_MAX_INPUT_DONE_FLAG)
++  *opflags = readl_relaxed(controller->base + QUP_OPERATIONAL);
++  if (*opflags & QUP_OP_MAX_INPUT_DONE_FLAG)
+   writel_relaxed(QUP_OP_IN_SERVICE_FLAG,
+   controller->base + QUP_OPERATIONAL);
+ 
+@@ -633,7 +635,7 @@ static irqreturn_t spi_qup_qup_irq(int i
+   if (!controller->use_dma) {
+   if (opflags & QUP_OP_IN_SERVICE_FLAG) {
+   if (opflags & QUP_OP_IN_BLOCK_READ_REQ)
+-  spi_qup_block_read(controller, xfer);
++  spi_qup_block_read(controller, xfer, &opflags);
+   else
+   spi_qup_fifo_read(controller, xfer);
+   }
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 0/4] ipq806x: Add ethernet support

2015-02-23 Thread Mathieu Olivari
These 4 changes add ethernet support to IPQ806x. It's using the driver
available on codeaurora.org and updates the corresponding DT information.
Same driver has also been posted to LKML:
https://lkml.org/lkml/2015/1/8/534

Its needs rework for kernel.org upstream acceptance.

Mathieu Olivari (4):
  ipq806x: enable ar8xxx switch family support
  ipq806x: enable GMAC support in DTS
  kernel: add qca-nss-gmac as a new module
  ipq806x: initialize the network on AP148

 package/kernel/qca-nss-gmac/Makefile   |  50 ++
 .../ipq806x/base-files/etc/uci-defaults/network|  32 
 target/linux/ipq806x/config-3.18   |   3 +
 .../ipq806x/patches/700-add-gmac-dts-suport.patch  | 172 +
 4 files changed, 257 insertions(+)
 create mode 100644 package/kernel/qca-nss-gmac/Makefile
 create mode 100755 target/linux/ipq806x/base-files/etc/uci-defaults/network
 create mode 100644 target/linux/ipq806x/patches/700-add-gmac-dts-suport.patch

-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 4/4] ipq806x: initialize the network on AP148

2015-02-23 Thread Mathieu Olivari
Signed-off-by: Mathieu Olivari 
---
 .../ipq806x/base-files/etc/uci-defaults/network| 32 ++
 1 file changed, 32 insertions(+)
 create mode 100755 target/linux/ipq806x/base-files/etc/uci-defaults/network

diff --git a/target/linux/ipq806x/base-files/etc/uci-defaults/network 
b/target/linux/ipq806x/base-files/etc/uci-defaults/network
new file mode 100755
index 000..34e9fe4
--- /dev/null
+++ b/target/linux/ipq806x/base-files/etc/uci-defaults/network
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Copyright (c) 2015 The Linux Foundation. All rights reserved.
+# Copyright (C) 2011 OpenWrt.org
+#
+
+[ -e /etc/config/network ] && exit 0
+
+touch /etc/config/network
+
+. /lib/functions/uci-defaults.sh
+. /lib/ipq806x.sh
+
+ucidef_set_interface_loopback
+
+board=$(ipq806x_board_name)
+
+case "$board" in
+ap148)
+   ucidef_set_interfaces_lan_wan "eth1" "eth0"
+   ucidef_add_switch "switch0" "1" "1"
+   ucidef_add_switch_vlan "switch0" "1" "6 1 2 3 4"
+   ucidef_add_switch_vlan "switch0" "2" "0 5"
+   ;;
+*)
+   echo "Unsupported hardware. Network interfaces not intialized"
+   ;;
+esac
+
+uci commit network
+
+exit 0
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/4] ipq806x: enable ar8xxx switch family support

2015-02-23 Thread Mathieu Olivari
Signed-off-by: Mathieu Olivari 
---
 target/linux/ipq806x/config-3.18 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/ipq806x/config-3.18 b/target/linux/ipq806x/config-3.18
index 7cda416..51f2de7 100644
--- a/target/linux/ipq806x/config-3.18
+++ b/target/linux/ipq806x/config-3.18
@@ -3,6 +3,7 @@ CONFIG_ALIGNMENT_TRAP=y
 # CONFIG_APM_EMULATION is not set
 CONFIG_APQ_GCC_8084=y
 CONFIG_APQ_MMCC_8084=y
+CONFIG_AR8216_PHY=y
 CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE=y
 CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y
 CONFIG_ARCH_HAS_SG_CHAIN=y
@@ -103,7 +104,9 @@ CONFIG_DTC=y
 # CONFIG_DW_DMAC_PCI is not set
 CONFIG_DYNAMIC_DEBUG=y
 # CONFIG_EMAC_ROCKCHIP is not set
+CONFIG_ETHERNET_PACKET_MANGLE=y
 CONFIG_FREEZER=y
+CONFIG_FW_LOADER_USER_HELPER=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_CLOCKEVENTS=y
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/4] kernel: add qca-nss-gmac as a new module

2015-02-23 Thread Mathieu Olivari
This driver is used on IPQ806x to instanciate & drive the ethernet
interfaces.

Signed-off-by: Mathieu Olivari 
---
 package/kernel/qca-nss-gmac/Makefile | 50 
 1 file changed, 50 insertions(+)
 create mode 100644 package/kernel/qca-nss-gmac/Makefile

diff --git a/package/kernel/qca-nss-gmac/Makefile 
b/package/kernel/qca-nss-gmac/Makefile
new file mode 100644
index 000..d994770
--- /dev/null
+++ b/package/kernel/qca-nss-gmac/Makefile
@@ -0,0 +1,50 @@
+#
+# Copyright (c) 2015 The Linux Foundation. All rights reserved.
+#
+
+include $(TOPDIR)/rules.mk
+include $(INCLUDE_DIR)/kernel.mk
+
+PKG_NAME:=qca-nss-gmac
+PKG_VERSION:=20150210
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=git://codeaurora.org/quic/qsdk/oss/lklm/nss-gmac
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE_VERSION:=969aab0aff40a3a5afe70d0f00e783b1c57aaea6
+
+PKG_LICENSE:=ISC
+
+include $(INCLUDE_DIR)/package.mk
+
+define KernelPackage/qca-nss-gmac
+  SECTION:=kernel
+  CATEGORY:=Kernel modules
+  SUBMENU:=Network Devices
+  DEPENDS:=@TARGET_ipq806x
+  TITLE:=Kernel driver for NSS gmac
+  FILES:=$(PKG_BUILD_DIR)/ipq806x/qca-nss-gmac.ko
+  AUTOLOAD:=$(call AutoProbe,qca-nss-gmac)
+endef
+
+define KernelPackage/qca-nss-gmac/Description
+This package contains a NSS driver for QCA chipset
+endef
+
+EXTRA_CFLAGS+= \
+   -DCONFIG_NSS_DEBUG_LEVEL=4 \
+   -I$(PKG_BUILD_DIR)/nss_hal/include \
+   -I$(PKG_BUILD_DIR)/nss_hal/$(BOARD)
+
+define Build/Compile
+   $(MAKE) -C "$(LINUX_DIR)" \
+   CROSS_COMPILE="$(TARGET_CROSS)" \
+   ARCH="$(LINUX_KARCH)" \
+   SUBDIRS="$(PKG_BUILD_DIR)" \
+   EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
+   modules
+endef
+
+$(eval $(call KernelPackage,qca-nss-gmac))
-- 
1.9.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/4] ipq806x: enable GMAC support in DTS

2015-02-23 Thread Mathieu Olivari
This adds the GMAC entries in the ipq806x dtsi file as well as in the
ap148 specific dts file.

This also adds the MDIO change as well.

Signed-off-by: Mathieu Olivari 
---
 .../ipq806x/patches/700-add-gmac-dts-suport.patch  | 172 +
 1 file changed, 172 insertions(+)
 create mode 100644 target/linux/ipq806x/patches/700-add-gmac-dts-suport.patch

diff --git a/target/linux/ipq806x/patches/700-add-gmac-dts-suport.patch 
b/target/linux/ipq806x/patches/700-add-gmac-dts-suport.patch
new file mode 100644
index 000..89ebe66
--- /dev/null
+++ b/target/linux/ipq806x/patches/700-add-gmac-dts-suport.patch
@@ -0,0 +1,172 @@
+--- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
 b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
+@@ -18,8 +18,15 @@
+   bootargs = "console=ttyMSM0,115200 root=/dev/mtdblock12 
rootfstype=squashfs,jffs2";
+   };
+ 
++  aliases {
++  mdio-gpio0 = &mdio0;
++  };
++
+   soc {
+   pinmux@80 {
++  pinctrl-0 = <&mdio0_pins &rgmii2_pins>;
++  pinctrl-names = "default";
++
+   i2c4_pins: i2c4_pinmux {
+   pins = "gpio12", "gpio13";
+   function = "gsbi4";
+@@ -34,6 +41,25 @@
+   bias-none;
+   };
+   };
++
++  mdio0_pins: mdio0_pins {
++  mux {
++  pins = "gpio0", "gpio1";
++  function = "gpio";
++  drive-strength = <8>;
++  bias-disable;
++  };
++  };
++
++  rgmii2_pins: rgmii2_pins {
++  mux {
++  pins = "gpio27", "gpio28", "gpio29", 
"gpio30", "gpio31", "gpio32",
++ "gpio51", "gpio52", "gpio59", 
"gpio60", "gpio61", "gpio62" ;
++  function = "rgmii2";
++  drive-strength = <8>;
++  bias-disable;
++  };
++  };
+   };
+ 
+   gsbi@1630 {
+@@ -72,6 +98,7 @@
+   #size-cells = <1>;
+   spi-max-frequency = <5000>;
+   reg = <0>;
++  m25p,fast-read;
+ 
+   partition@0 {
+   label = "0:SBL1";
+@@ -148,5 +175,66 @@
+   sata@2900 {
+   status = "ok";
+   };
++
++  mdio0: mdio {
++  compatible = "virtual,mdio-gpio";
++  #address-cells = <1>;
++  #size-cells = <0>;
++  gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
++
++  phy0: ethernet-phy@0 {
++  device_type = "ethernet-phy";
++  reg = <0>;
++  qca,ar8327-initvals = <
++  0x4 0x760   /* PAD0_MODE */
++  0x8 0x100   /* PAD5_MODE */
++  0xc 0x80/* PAD6_MODE */
++  0x000e4 0xaa545 /* MAC_POWER_SEL */
++  0x000e0 0xc74164de  /* SGMII_CTRL */
++  0x0007c 0x4e/* PORT0_STATUS */
++  0x00094 0x4e/* PORT6_STATUS */
++  >;
++  };
++
++  phy4: ethernet-phy@4 {
++  device_type = "ethernet-phy";
++  reg = <4>;
++  };
++  };
++
++  nss-gmac-common {
++  reg = <0x0300 0x 0x1bb0 0x 
0x0090 0x4000>;
++  reg-names = "nss_reg_base" , "qsgmii_reg_base", 
"clk_ctl_base";
++  };
++
++  gmac1: ethernet@3720 {
++  status = "ok";
++  phy-mode = "rgmii";
++  qcom,id = <1>;
++  

  1   2   >