Bug#803159: linux: Enable DT support for armel/orion5x arch

2016-02-01 Thread Roger Shimizu
Control: reopen -1

On Fri, Jan 8, 2016 at 1:24 AM, Roger Shimizu  wrote:
> Dear Kernel Maintainers,
>
> I'm wondering whether it's possible to add armel/orion5x support to
> "jessie proposed update kernel" series.
> If so, here's the changes need to be made:
> - cherry-pick DT from upstream's repo [0]
> - apply 0001 patch (or cherry pick cb4af0fef2 [1])
>
> Thanks for your understanding!
>
> [0]: 
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=dc57844a736f10bf3799d63d7c0d0efc29b1ad7d
> [1]: 
> https://anonscm.debian.org/cgit/kernel/linux.git/commit/?id=cb4af0fef2da7ed2cb337a9a0a97b2a3db9ca645

I still hope that device tree can be supported by jessie kernel
(3.16-ckt branch).
Maybe I asked for too much, but for tiny device like orion5x, smaller
kernel is always better.

Backport of DTS can be low priority, because user always can put their
local DTB under /etc/flash-kernel/dtbs/.
What I want is just backporting defconfig patch [1] to jessie-updates.
Thank you!

> [1]: 
> https://anonscm.debian.org/cgit/kernel/linux.git/commit/?id=cb4af0fef2da7ed2cb337a9a0a97b2a3db9ca645

-- 
Roger Shimizu, GMT +9 Tokyo
PGP/GPG: 17B3ACB1



Bug#803159: linux: Enable DT support for armel/orion5x arch

2016-02-01 Thread Ben Hutchings
Control: fixed -1 4.3-1~exp2

On Tue, 2016-02-02 at 00:39 +0900, Roger Shimizu wrote:
> Control: reopen -1

It was not necessary to reopen this bug, as the BTS can keep track of
whether it is actually fixed in each suite.

Ben.

-- 
Ben Hutchings
Larkinson's Law: All laws are basically false.

signature.asc
Description: This is a digitally signed message part


Bug#803159: linux: Enable DT support for armel/orion5x arch

2015-11-09 Thread Roger Shimizu
> Thanks, I'd already set a build going with your first patch and my variant
> of your second patch for the UART thing. The build went fine and I have now
> pushed the result to our git tree so it will be in the next upload. I don't
> have any orion5x to test on.
> My version of the UART change is below, with your variant (without the
> "ICEDCC is not set") I would expect CONFIG_DEBUG_ICEDCC to be on by default
> and according to the Kconfig help text for things to not work without a
> debugger attached.

I believe your patch will generate the exact same final .config for
orion5x flavour.
Thank you!

> Did you try your version and find it worked?

Yes, I tested on the following kernel, confirmed booting well on
LS-WTGL (orion5x):
- jessie 3.16.7-ckt11-1+deb8u5 kernel with my 0001 patch
- sid 4.2.5-1 kernel with my 0001 and 0002 patch

Looking forward to see the upcoming upload. Thank you!

Cheers,
Roger



Bug#803159: linux: Enable DT support for armel/orion5x arch

2015-11-09 Thread Ian Campbell
On Sat, 2015-11-07 at 11:45 +0900, Roger Shimizu wrote:
> Patch appended, to avoid any misunderstanding.
>  - 0001 is both OK for sid and jessie
>  - 0002 is only necessary for sid, or other 4.x kernel series (e.g.
> jessie-backport)

Thanks, I'd already set a build going with your first patch and my variant
of your second patch for the UART thing. The build went fine and I have now
pushed the result to our git tree so it will be in the next upload. I don't
have any orion5x to test on.

My version of the UART change is below, with your variant (without the
"ICEDCC is not set") I would expect CONFIG_DEBUG_ICEDCC to be on by default
and according to the Kconfig help text for things to not work without a
debugger attached.

Did you try your version and find it worked?

Ian.

@@ -16,6 +16,14 @@ CONFIG_ATAGS_PROC=y
 CONFIG_VFP=y
 
 ##
+## file: arch/arm/Kconfig.debug
+##
+## choice: Kernel low-level debugging port
+# CONFIG_DEBUG_ICEDCC is not set
+CONFIG_DEBUG_LL_UART_8250=y
+## end choice
+
+##
 ## file: arch/arm/mach-imx/Kconfig
 ##
 # CONFIG_ARCH_MXC is not set



Bug#803159: linux: Enable DT support for armel/orion5x arch

2015-11-06 Thread Roger Shimizu
Patch appended, to avoid any misunderstanding.
 - 0001 is both OK for sid and jessie
 - 0002 is only necessary for sid, or other 4.x kernel series (e.g.
jessie-backport)

Thank you!

Cheers,
Roger
From ecc1733be537bf5c2583b50a0664b583cf294b37 Mon Sep 17 00:00:00 2001
From: Roger Shimizu 
Date: Tue, 27 Oct 2015 22:28:43 +0900
Subject: [PATCH 1/2] [armel/orion5x] enable DT support

Signed-off-by: Roger Shimizu 
---
 debian/config/armel/config.orion5x | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/debian/config/armel/config.orion5x b/debian/config/armel/config.orion5x
index a7f4888..1e4703f 100644
--- a/debian/config/armel/config.orion5x
+++ b/debian/config/armel/config.orion5x
@@ -8,6 +8,8 @@ CONFIG_PCI=y
 CONFIG_UACCESS_WITH_MEMCPY=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_CMDLINE=""
 # CONFIG_XIP_KERNEL is not set
 CONFIG_ATAGS_PROC=y
@@ -23,6 +25,7 @@ CONFIG_VFP=y
 ##
 CONFIG_MACH_DB88F5281=y
 CONFIG_MACH_RD88F5182=y
+CONFIG_MACH_RD88F5182_DT=y
 CONFIG_MACH_KUROBOX_PRO=y
 CONFIG_MACH_DNS323=y
 CONFIG_MACH_TS209=y
@@ -264,6 +267,7 @@ CONFIG_MTD=y
 # CONFIG_MTD_REDBOOT_PARTS is not set
 CONFIG_MTD_CMDLINE_PARTS=y
 # CONFIG_MTD_AFS_PARTS is not set
+CONFIG_MTD_OF_PARTS=y
 CONFIG_MTD_BLOCK=y
 CONFIG_FTL=m
 CONFIG_NFTL=m
@@ -318,6 +322,7 @@ CONFIG_MTD_CFI_STAA=m
 ## file: drivers/mtd/maps/Kconfig
 ##
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP_OF=y
 # CONFIG_MTD_IMPA7 is not set
 # CONFIG_MTD_INTEL_VR_NOR is not set
 # CONFIG_MTD_PLATRAM is not set
@@ -487,6 +492,11 @@ CONFIG_RTC_DRV_S35390A=y
 # CONFIG_SSB is not set
 
 ##
+## file: drivers/tty/serial/Kconfig
+##
+CONFIG_SERIAL_OF_PLATFORM=y
+
+##
 ## file: drivers/tty/serial/8250/Kconfig
 ##
 CONFIG_SERIAL_8250=y
-- 
2.1.4

From d2f7318266850e3dd87ea9b045031a3871b8a055 Mon Sep 17 00:00:00 2001
From: Roger Shimizu 
Date: Sat, 7 Nov 2015 11:35:57 +0900
Subject: [PATCH 2/2] [armel/orion5x] Enable DEBUG_LL_UART_8250, to replace
 DEBUG_ICEDCC, which is default since Linux 4.0 and hangs booting on
 armel/orion5x

Signed-off-by: Roger Shimizu 
---
 debian/config/armel/config.orion5x | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/debian/config/armel/config.orion5x b/debian/config/armel/config.orion5x
index 1e4703f..00404b9 100644
--- a/debian/config/armel/config.orion5x
+++ b/debian/config/armel/config.orion5x
@@ -16,6 +16,13 @@ CONFIG_ATAGS_PROC=y
 CONFIG_VFP=y
 
 ##
+## file: arch/arm/Kconfig.debug
+##
+## choice: Kernel low-level debugging port
+CONFIG_DEBUG_LL_UART_8250=y
+## end choice
+
+##
 ## file: arch/arm/mach-imx/Kconfig
 ##
 # CONFIG_ARCH_MXC is not set
-- 
2.1.4



Bug#803159: linux: Enable DT support for armel/orion5x arch

2015-11-06 Thread Roger Shimizu
I have good news.

> If you can figure out why the LS-WTGL doesn't work and that can be
> fixed (i.e. it turns out to be something other than the size) then I
> see no problem with adding support for the LS-WTGL platform.

I finished "git bisect" and good commit is 1553282b11e and bad one is
c544d987d9572 (in debian kernel repo).
So 3.19.3-1~exp2 is bootable, but 4.0-1~exp1 is non-bootable.
I compared the configs, and find former has DEBUG_ICEDCC and latter
has DEBUG_LL_UART_NONE.
I also find it's not possible to set DEBUG_LL_UART_NONE for 4.0 kernel.
After some searches, I tried to set DEBUG_LL_UART_8250 for 4.0 kernel,
then the kernel became bootable on my orion5x device!

I also find evidences this change is necessary starting for new 4.x kernel:
1. kirkwood changed from 3.16's DEBUG_LL_UART_NONE to 4.x's
DEBUG_MVEBU_UART0_ALTERNATE: commit bf56620e4 and 58669ce1 (in debian
kernel repo)
2. mainline kernel changed to DEBUG_LL_UART_8250 for orion5x arch:
commit 34c64a5d8 (in upstream repo)

So I think it's now safe to turn on DEBUG_LL_UART_8250 and merge my patch.
Thank you!

Cheers,
Roger



Bug#803159: linux: Enable DT support for armel/orion5x arch

2015-11-06 Thread Ian Campbell
On Fri, 2015-11-06 at 23:53 +0900, Roger Shimizu wrote:
> So I think it's now safe to turn on DEBUG_LL_UART_8250 and merge my
> patch.

Great, thanks for tracking that down. 

It's a bit odd that DEBUG_LL_UART_NONE fails (after all it should be
doing nothing) but given that this flavour supports a single SOC which
all have the same UART (AFAICT, it's on in upstream orion5x defconfig
at least) I think there's no reason not to do this.

When I tried this I also got CONFIG_DEBUG_ICEDCC coming on. From the
Kconfig help I don't think we want this at all ("Note that the system
will appear to hang during boot if there is nothing connected to read
from the DCC.") so I have disabled it. Please let me know if you think
we want this for some reason.

I'll kick off a local build with this in now and push once it's done.
(I'm away this w/e, so might be next week)

Ian.



Bug#803159: linux: Enable DT support for armel/orion5x arch

2015-11-06 Thread Roger Shimizu
Thanks for the feedback!

> It's a bit odd that DEBUG_LL_UART_NONE fails (after all it should be
> doing nothing) but given that this flavour supports a single SOC which
> all have the same UART (AFAICT, it's on in upstream orion5x defconfig
> at least) I think there's no reason not to do this.

DEBUG_LL_UART_NONE seems to be removed from upstream, that's why both
orion5x and kirkwood changed behavior.

> When I tried this I also got CONFIG_DEBUG_ICEDCC coming on. From the
> Kconfig help I don't think we want this at all ("Note that the system
> will appear to hang during boot if there is nothing connected to read
> from the DCC.") so I have disabled it. Please let me know if you think
> we want this for some reason.

I don't need DEBUG_ICEDCC.
DEBUG_LL seems only have one implementation. I just append
DEBUG_LL_UART_8250 to debian/config/armel/config.orion5x, then
DEBUG_ICEDCC went away by itself.

> I'll kick off a local build with this in now and push once it's done.
> (I'm away this w/e, so might be next week)

No problem for me. Thank you!

Cheers,
Roger



Bug#803159: linux: Enable DT support for armel/orion5x arch

2015-11-05 Thread Roger Shimizu
Dear Ian,

Thanks for your comments!

> Given this and the discussions
> https://lists.debian.org/debian-boot/2015/10/msg00221.html
> I wonder how useful it turns out to be to apply this patch.

1. This patch at least works well on jessie kernel (3.16).
2. I'm still trying to figure out why it doesn't work on sid kernel.
I thought it's because of the size, but currently I find it there may
be other reason. Because I tried to remove some kernel feature to let
the size go down below that limit, but it still cannot work.
I also tried to remove the same feature set for jessie kernel, and it
worked. So kernel size is not the root cause for my orion5x device.
3. The reason to support DT for my orion5x device (LS-WTGL) is because
there's no other way to support it. There were some patches to support
the device in legacy way, but it's not merged into mainline kernel, so
need to compile every time upstream get updated.
4. For LS-WSGL, sorry I don't have it. Debian previously support it,
but mainline kernel 4.3 has convert this device to DT, which means
legacy code has been removed and you have to use DT to boot. I notice
it's the same series product with my device, so I included it in my
patch.

I'm still working on "git bisect" for the sid kernel to try to find
out what's the root cause for my LS-WTGL device. It's not easy job
because there's debian kernel repo which manage the defconfig and
there's another linux repo separately which manage the code.
I hope you would not reject this patch immediately.
Thank you for your understanding!

Cheers,
Roger



Bug#803159: linux: Enable DT support for armel/orion5x arch

2015-11-05 Thread Ian Campbell
Control: tag -1 +moreinfo

On Fri, 2015-11-06 at 01:27 +0900, Roger Shimizu wrote:
> Dear Ian,
> 
> Thanks for your comments!
> 
> > Given this and the discussions
> > https://lists.debian.org/debian-boot/2015/10/msg00221.html
> > I wonder how useful it turns out to be to apply this patch.
> 
> 1. This patch at least works well on jessie kernel (3.16).

I'm afraid the only candidate place for this to be applied would be
sid, not in a stable release.

> 2. I'm still trying to figure out why it doesn't work on sid kernel.

OK, please let us know.

> 3. The reason to support DT for my orion5x device (LS-WTGL) is
> because
> there's no other way to support it. There were some patches to support
> the device in legacy way, but it's not merged into mainline kernel, so
> need to compile every time upstream get updated.

There's no doubt that if this device is to be supported it should be
via DT.

But if the kernel image is too big for this device then it may not be a
device which we can support at all.

> 4. For LS-WSGL, sorry I don't have it. Debian previously support it,
> but mainline kernel 4.3 has convert this device to DT, which means
> legacy code has been removed and you have to use DT to boot. I notice
> it's the same series product with my device, so I included it in my
> patch.

OK.

I may be confused regarding which of the two systems mentioned have
issues with the size of the kernel supported by the firmware.

If you can figure out why the LS-WTGL doesn't work and that can be
fixed (i.e. it turns out to be something other than the size) then I
see no problem with adding support for the LS-WTGL platform.

Ian.



Bug#803159: linux: Enable DT support for armel/orion5x arch

2015-11-05 Thread Ian Campbell
On Tue, 2015-10-27 at 23:20 +0900, Roger Shimizu wrote:
> Package: linux
> Severity: normal
> 
> Dear Maintainer,
> 
> There're some updates for armel/orion5x in Linux 4.3 kernel:
>   - Buffalo Linkstation LS-WTGL: DT support newly added
>   - Buffalo Linkstation LS-WSGL: converted to DT
> 
> But currently, armel/orion5x kernel doesn't support DT well.
> Here's the patch to enable DT support for armel/orion5x.
> 
> However, I met some issues during testing on my LS-WTGL box,
> and found it's because the kernel image size exceeded the 
> limit of u-boot.

Given this and the discussions
https://lists.debian.org/debian-boot/2015/10/msg00221.html
I wonder how useful it turns out to be to apply this patch.

I suppose even if the given platform doesn't work due to uboot
limitations the general direction of enabling DT seems sound so long as
it doesn't push us over the current size limit, but if there are no
supported platforms which use this functionality perhaps we should wait
until then.

So I'm in too minds, and other pkg-kernel or ARM folks have any
thoughts?

>  After I revert commit b3b60bbdd13 [0], it 
> boot smoothly.
> 
> I hope this patch can be applied soon. Thank you!
> 
> Cheers,
> Roger
> 
> Reference [0]:
> https://anonscm.debian.org/cgit/kernel/linux.git/commit/debian/config
> /armel/config.orion5x?id=b3b60bbdd13a9702dbd8e00bd9b35d49b625df31



Bug#803159: linux: Enable DT support for armel/orion5x arch

2015-10-27 Thread Roger Shimizu
Package: linux
Severity: normal

Dear Maintainer,

There're some updates for armel/orion5x in Linux 4.3 kernel:
  - Buffalo Linkstation LS-WTGL: DT support newly added
  - Buffalo Linkstation LS-WSGL: converted to DT

But currently, armel/orion5x kernel doesn't support DT well.
Here's the patch to enable DT support for armel/orion5x.

However, I met some issues during testing on my LS-WTGL box,
and found it's because the kernel image size exceeded the 
limit of u-boot. After I revert commit b3b60bbdd13 [0], it 
boot smoothly.

I hope this patch can be applied soon. Thank you!

Cheers,
Roger

Reference [0]:
https://anonscm.debian.org/cgit/kernel/linux.git/commit/debian/config/armel/config.orion5x?id=b3b60bbdd13a9702dbd8e00bd9b35d49b625df31
>From db7027003b6efa8bf75f2572f25770ede21ec066 Mon Sep 17 00:00:00 2001
From: Roger Shimizu 
Date: Tue, 27 Oct 2015 22:28:43 +0900
Subject: [PATCH] [armel/orion5x] enable DT support

Signed-off-by: Roger Shimizu 
---
 debian/config/armel/config.orion5x | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/debian/config/armel/config.orion5x b/debian/config/armel/config.orion5x
index 84e4b91..873704f 100644
--- a/debian/config/armel/config.orion5x
+++ b/debian/config/armel/config.orion5x
@@ -8,6 +8,8 @@ CONFIG_PCI=y
 CONFIG_UACCESS_WITH_MEMCPY=y
 CONFIG_ZBOOT_ROM_TEXT=0x0
 CONFIG_ZBOOT_ROM_BSS=0x0
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_CMDLINE=""
 # CONFIG_XIP_KERNEL is not set
 CONFIG_ATAGS_PROC=y
@@ -24,6 +26,7 @@ CONFIG_VFP=y
 ##
 CONFIG_MACH_DB88F5281=y
 CONFIG_MACH_RD88F5182=y
+CONFIG_MACH_RD88F5182_DT=y
 CONFIG_MACH_KUROBOX_PRO=y
 CONFIG_MACH_DNS323=y
 CONFIG_MACH_TS209=y
@@ -257,6 +260,7 @@ CONFIG_MTD=y
 # CONFIG_MTD_REDBOOT_PARTS is not set
 CONFIG_MTD_CMDLINE_PARTS=y
 # CONFIG_MTD_AFS_PARTS is not set
+CONFIG_MTD_OF_PARTS=y
 CONFIG_MTD_BLOCK=y
 CONFIG_FTL=m
 CONFIG_NFTL=m
@@ -311,6 +315,7 @@ CONFIG_MTD_CFI_STAA=m
 ## file: drivers/mtd/maps/Kconfig
 ##
 # CONFIG_MTD_COMPLEX_MAPPINGS is not set
+CONFIG_MTD_PHYSMAP_OF=y
 # CONFIG_MTD_IMPA7 is not set
 # CONFIG_MTD_INTEL_VR_NOR is not set
 # CONFIG_MTD_PLATRAM is not set
@@ -481,6 +486,11 @@ CONFIG_RTC_DRV_S35390A=y
 # CONFIG_SSB is not set
 
 ##
+## file: drivers/tty/serial/Kconfig
+##
+CONFIG_SERIAL_OF_PLATFORM=y
+
+##
 ## file: drivers/tty/serial/8250/Kconfig
 ##
 CONFIG_SERIAL_8250=y
-- 
2.1.4