Re: [PATCH 1/2] Kconfig: Change SYS_MALLOC_F_LEN default to 0x2000

2022-04-07 Thread Thomas Chou

Hi Tom,

On 4/7/22 09:33, Tom Rini wrote:

The most commonly used value today is 0x2000 and not 0x400.  Rework the
Kconfig logic to use this more frequently used value as the default.
Signed-off-by: Tom Rini 
---
To make this patch more reviewable, I've omitted the defconfigs where
the in-use value is now the default value.  I've cc'd so many
maintainers however as a frequent issue when enabling more DM migrations
is SYS_MALLOC_F_LEN being too small and 0x400 not being enough and
something like 0x2000 being more reasonable, especially on platforms
that can otherwise easily handle a little more memory usage.
---
  Kconfig   | 9 +++--
  configs/10m50_defconfig   | 1 +
  configs/3c120_defconfig   | 1 +


Reviewed-by: Thomas Chou 


Re: [U-Boot] (no subject)

2019-07-03 Thread Thomas Chou

On 7/1/19 9:20 PM, Tom Rini wrote:

On Sun, Jun 30, 2019 at 10:06:35AM +0800, Thomas Chou wrote:



Add gcc-8.1.0 support to buildman toolchain.

The old gcc-7.3.0 has shared libraries issues on Ubuntu 18.04LTS and
19.04.


Can you not resolve those shared library issues via one of the toolchain
PPAs ?



I switched to Fedora 30, which does not have such shared libraries 
issues. Fedora has more cross compiler supported, with gcc-9. I am 
trying them, and will feedback later.


Cheers,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] (no subject)

2019-07-03 Thread Thomas Chou

Hi Tom,

On 7/1/19 9:19 PM, Tom Rini wrote:

On Sun, Jun 30, 2019 at 06:31:10PM +0800, Bin Meng wrote:
Unfortunately the kernel.org gcc-8.1 toolchain just isn't usable for us
due to a number of later-fixed regressions.  We need to use gcc-8.3, I
think, for something that should work again everywhere.  And when I last
looked (mid-May, from my WIP branch) while I could get gcc-8.3 for ARM I
couldn't find one for x86.  The Bootlin toolchains are only 8.2 and
that's not new enough to have the problem Bin notes as a regression
fixed.



Agree. We shall wait until they are ready.

Cheers,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] (no subject)

2019-07-03 Thread Thomas Chou

Hi Bin,

On 6/30/19 6:31 PM, Bin Meng wrote:

On Sun, Jun 30, 2019 at 10:07 AM Thomas Chou  wrote:

x86:  +   efi-x86_app
+{standard input}: Assembler messages:
+{standard input}:21695: Error: junk at end of line, first unrecognized 
character is `@'
+{standard input}:21740: Error: junk at end of line, first unrecognized 
character is `@'
+{standard input}:21695: Error: can't resolve `end.7382' 
{.u_boot_list_2_fit_loadable_3 section} - `start.7379' 
{.u_boot_list_2_fit_loadable_1 section}
+{standard input}:21740: Error: can't resolve `end.7382' 
{.u_boot_list_2_fit_loadable_3 section} - `start.7379' 
{.u_boot_list_2_fit_loadable_1 section}
+make[2]: *** [scripts/Makefile.build:279: common/image.o] Error 1
+make[1]: *** [Makefile:1594: common] Error 2
+make: *** [Makefile:148: sub-make] Error 2


For the x86 failure, it is a known regression issue of GCC 8.

Regards,
Bin



Good to know. Thanks.

Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] tools: buildman: add gcc-8.1.0 support

2019-07-03 Thread Thomas Chou

Hi Bin,

On 6/30/19 6:32 PM, Bin Meng wrote:

We should fix all issues before we turn on the 8.1 for buildman,
otherwise the travis-ci will break.



I agree. It is not ready yet.

CHeers,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] tools: buildman: add gcc-8.1.0 support

2019-06-29 Thread Thomas Chou
Add gcc-8.1.0 support to buildman toolchain.

The old gcc-7.3.0 has shared libraries issues on Ubuntu 18.04 and 19.04.

Signed-off-by: Thomas Chou 
---
 tools/buildman/toolchain.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py
index a65737fdf8..3ad18c472e 100644
--- a/tools/buildman/toolchain.py
+++ b/tools/buildman/toolchain.py
@@ -460,7 +460,7 @@ class Toolchains:
 """
 arch = command.OutputOneLine('uname', '-m')
 base = 'https://www.kernel.org/pub/tools/crosstool/files/bin'
-versions = ['7.3.0', '6.4.0', '4.9.4']
+versions = ['8.1.0', '7.3.0', '6.4.0', '4.9.4']
 links = []
 for version in versions:
 url = '%s/%s/%s/' % (base, arch, version)
-- 
2.20.1

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] (no subject)

2019-06-29 Thread Thomas Chou

Add gcc-8.1.0 support to buildman toolchain.

The old gcc-7.3.0 has shared libraries issues on Ubuntu 18.04LTS and
19.04.

Though both 7.3.0 and 8.1.0 have arc and nds32 compilers, the following
errors were generated on Ubuntu 19.04.

   arc:  +   iot_devkit   
+arc-linux-ld.bfd: error: examples/standalone/hello_world: unable to merge CPU 
base attributes ARC7xx with ARCEM.
+
+arc-linux-ld.bfd: failed to merge target specific data of file 
/home/thomas/.buildman-toolchains/gcc-8.1.0-nolibc/arc-linux/bin/../lib/gcc/arc-linux/8.1.0/libgcc.a(_millicodethunk_st.o)
+arc-linux-ld.bfd: failed to merge target specific data of file 
/home/thomas/.buildman-toolchains/gcc-8.1.0-nolibc/arc-linux/bin/../lib/gcc/arc-linux/8.1.0/libgcc.a(_millicodethunk_ret.o)
+make[3]: *** [examples/standalone/Makefile:62: 
examples/standalone/hello_world] Error 1
+make[2]: *** [scripts/Makefile.build:432: examples/standalone] Error 2
+make[1]: *** [Makefile:1594: examples] Error 2
+make: *** [Makefile:148: sub-make] Error 2


 nds32:  +   adp-ae3xx 
+nds32le-elf-gcc: error: unrecognized command line option '-mno-ext-fpu-dp'
+nds32le-elf-gcc: error: unrecognized command line option '-mfloat-abi=soft'
+make[2]: *** [scripts/Makefile.autoconf:77: u-boot.cfg] Error 1
+make[1]: *** No rule to make target 'include/config/auto.conf', needed by 
'include/config/uboot.release'.  Stop.
+make: *** [Makefile:148: sub-make] Error 2

 nds32:  +   adp-ag101p   
+nds32le-elf-gcc: error: unrecognized command line option '-mno-ext-fpu-dp'
+nds32le-elf-gcc: error: unrecognized command line option '-mfloat-abi=soft'
+make[2]: *** [scripts/Makefile.autoconf:77: u-boot.cfg] Error 1
+make[1]: *** No rule to make target 'include/config/auto.conf', needed by 
'include/config/uboot.release'.  Stop.
+make: *** [Makefile:148: sub-make] Error 2

   x86:  +   efi-x86_app   
+{standard input}: Assembler messages:
+{standard input}:21695: Error: junk at end of line, first unrecognized 
character is `@'
+{standard input}:21740: Error: junk at end of line, first unrecognized 
character is `@'
+{standard input}:21695: Error: can't resolve `end.7382' 
{.u_boot_list_2_fit_loadable_3 section} - `start.7379' 
{.u_boot_list_2_fit_loadable_1 section}
+{standard input}:21740: Error: can't resolve `end.7382' 
{.u_boot_list_2_fit_loadable_3 section} - `start.7379' 
{.u_boot_list_2_fit_loadable_1 section}
+make[2]: *** [scripts/Makefile.build:279: common/image.o] Error 1
+make[1]: *** [Makefile:1594: common] Error 2
+make: *** [Makefile:148: sub-make] Error 2



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] nios2: 10m50: Add CPU pre-relocation in device tree

2018-09-19 Thread Thomas Chou

On 09/13/2017 02:19 PM, Marek Vasut wrote:

On 07/28/2017 07:07 AM, Gan, Yau Wai wrote:

Tag CPU with dm-pre-reloc to enable driver before
relocation.

Signed-off-by: Gan, Yau Wai 
Cc: Thomas Chou 


Reviewed-by: Marek Vasut 

Tom, please apply directly as the maintainer seems N/A.


Dear all,

Sorry for being missing for a long long time. I am looking at this right 
now.


Best regards,
Thomas






---
  arch/nios2/dts/10m50_devboard.dts | 1 +
  1 file changed, 1 insertion(+)

diff --git a/arch/nios2/dts/10m50_devboard.dts 
b/arch/nios2/dts/10m50_devboard.dts
index 05eac30..461ae68 100644
--- a/arch/nios2/dts/10m50_devboard.dts
+++ b/arch/nios2/dts/10m50_devboard.dts
@@ -19,6 +19,7 @@
#size-cells = <0>;
  
  		cpu: cpu@0 {

+   u-boot,dm-pre-reloc;
device_type = "cpu";
compatible = "altr,nios2-1.1";
reg = <0x>;






___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] Nios2 altera: add reference to in_be32, out_be32

2017-01-20 Thread Thomas Chou

Hi Kostya,

On 01/20/2017 09:58 AM, Kostya Belezko wrote:

Fixing compilation problem
u-boot-socfpga/drivers/serial/ns16550.c:144: undefined reference to `out_be32'



The u-boot-socfpga branch you referred is old. Please follow the latest 
stable release tag v2017.01 .


URL git://git.denx.de/u-boot.git
http://git.denx.de/u-boot.git

Best regards,
Thomas Chou
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net: fix m88e1111s PHY auto negotiation timeout

2016-02-24 Thread Thomas Chou

Hi Stefan,

On 2016年02月18日 15:47, Stefan Roese wrote:

I've also stumbled over this problem on some boards equipped with the
Marvell PHY. Could you please take a look at these patches instead:

http://patchwork.ozlabs.org/patch/581316/
http://patchwork.ozlabs.org/patch/581317/

Do they work for you?


Yes, they work great. Thanks a lot. I should have found your patches 
earlier. :)


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] net: fix m88e1111s PHY auto negotiation timeout

2016-02-15 Thread Thomas Chou
After commit a058052c358c
("net: phy: do not read configuration register on reset")

both 3c120 and 10m50 devboard which use Marvel m88es PHY got this
error message,

Net:   eth0: ethernet@400
=> ping 192.168.1.5
ethernet@400 Waiting for PHY auto negotiation to complete TIMEOUT !
Using ethernet@400 device
host 192.168.1.5 is alive

This is because the auto negotiation control bit was cleared by the new
phy_reset(). But the m88es_config() does the soft-reset already,
there is no need to reset twice. The extra phy_reset() should be
removed.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 drivers/net/phy/marvell.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c
index eab1558..5badfac 100644
--- a/drivers/net/phy/marvell.c
+++ b/drivers/net/phy/marvell.c
@@ -271,8 +271,6 @@ static int m88es_config(struct phy_device *phydev)
 
genphy_config_aneg(phydev);
 
-   phy_reset(phydev);
-
return 0;
 }
 
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] nios2: set up the debug UART early

2016-02-05 Thread Thomas Chou



On 2015年12月30日 20:32, Thomas Chou wrote:

Set up the debug UART early if enabled, so that it is ready to use.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
  arch/nios2/cpu/start.S | 7 +++
  1 file changed, 7 insertions(+)



Applied to u-boot-nios.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PULL] Please pull u-boot-nios/master

2016-02-05 Thread Thomas Chou
The following changes since commit 94985cc9d3d7ed991ca8b2627d5894df5ea68f49:

  Merge branch 'master' of git://git.denx.de/u-boot-usb (2016-02-04 06:56:23 
-0500)

are available in the git repository at:

  git://git.denx.de/u-boot-nios.git master

for you to fetch changes up to e4f348ba6f070789e6505cc65cf6683421674637:

  nios2: set up the debug UART early (2016-02-06 15:14:25 +0800)


Thomas Chou (1):
  nios2: set up the debug UART early

 arch/nios2/cpu/start.S | 7 +++
 1 file changed, 7 insertions(+)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] arm: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2016-01-05 Thread Thomas Chou

Hi Masahiro,

On 2016年01月06日 10:22, Masahiro Yamada wrote:

Hi Thomas,

2016-01-06 10:57 GMT+09:00 Thomas Chou <tho...@wytron.com.tw>:

Thanks for the explanation. Now I understand. But there is no harm to add
list support for building DT to configs. Please review and pick 1/9 and 2/9
of PATCH v2. And leave the rest to arch custodians.



I want this consistent throughout U-Boot tree.
Please do not leave it to each custodian.


OK.



1/9 is OK.



Thanks. This is actually a bug fix.


If we decide to not do 3/9 - 9/9,
2/9 will be useless.



OK. Please drop them.

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] arm: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2016-01-05 Thread Thomas Chou

Hi Simon,

On 2016年01月05日 08:56, Simon Glass wrote:

One of the benefits of device tree is that we can run the same code
paths on multiple boards. Then buildman has less work to do. For
example, if it builds 'snow' then we know that 'pit' and 'pi' are good
also. If you change the way device trees work then we lose this
benefit. It would be great if we could build (say) 100 boards for 100%
code coverage instead of 1000 boards.

If you can find a way to build all the device tree files for a
particular SoC without listing them out in the Makefile, then fine.
But I really don't want to lose that feature. It is very useful.



I am preparing an update v2 to support building list of DT from configs.

By adding support of list to DEFAULT_DEVICE_TREE,
This option specifies a space-separated list of Device Tree used
for DT control.  Each DT in the list will be compiled. The first will be 
used as default to ship.



Another example is sandbox, which builds both 'sandbox.dts' and
'test.dts'. It allows us to run a test easily:

./sandbox/u-boot -d sandbox/arch/sandbox/dts/test.dtb -c "ut dm
usb_kdb" for example.

If we didn't have that it would be a right pain to run tests.



No problem. The test.dtb rules is retained.


I still don't understand what problem you are trying to solve. Can you
explain again what is wrong with the status quo?


The current build generate too many DTB that users probably don't 
want/need. And the arch//dts/Makefile grows fat as every new 
board/target add lines to it. There should be some way to handle it in a 
cleaner style.


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 5/9] arm: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2016-01-05 Thread Thomas Chou
Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards
in Makefile.

Support list of Device Tree in DEFAULT_DEVICE_TREE. Each DT in the
list will be compiled. The first will be used as default to ship.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Cc: Albert Aribaud <albert.u.b...@aribaud.net>
---
v2
  add list support as Simon suggested.

 arch/arm/dts/Makefile | 193 +-
 1 file changed, 2 insertions(+), 191 deletions(-)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 0bcd316..41a6ab5 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -2,197 +2,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-$(CONFIG_S5PC100) += s5pc1xx-smdkc100.dtb
-dtb-$(CONFIG_S5PC110) += s5pc1xx-goni.dtb
-dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
-   exynos4210-smdkv310.dtb \
-   exynos4210-universal_c210.dtb \
-   exynos4210-trats.dtb \
-   exynos4412-trats2.dtb \
-   exynos4412-odroid.dtb
-
-dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
-   exynos5250-snow.dtb \
-   exynos5250-spring.dtb \
-   exynos5250-smdk5250.dtb \
-   exynos5420-smdk5420.dtb \
-   exynos5420-peach-pit.dtb \
-   exynos5800-peach-pi.dtb \
-   exynos5422-odroidxu3.dtb
-dtb-$(CONFIG_ARCH_ROCKCHIP) += \
-   rk3288-firefly.dtb \
-   rk3288-jerry.dtb \
-   rk3036-sdk.dtb
-dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
-   tegra20-medcom-wide.dtb \
-   tegra20-paz00.dtb \
-   tegra20-plutux.dtb \
-   tegra20-seaboard.dtb \
-   tegra20-tec.dtb \
-   tegra20-trimslice.dtb \
-   tegra20-ventana.dtb \
-   tegra20-whistler.dtb \
-   tegra20-colibri.dtb \
-   tegra30-apalis.dtb \
-   tegra30-beaver.dtb \
-   tegra30-cardhu.dtb \
-   tegra30-colibri.dtb \
-   tegra30-tec-ng.dtb \
-   tegra114-dalmore.dtb \
-   tegra124-jetson-tk1.dtb \
-   tegra124-nyan-big.dtb \
-   tegra124-venice2.dtb \
-   tegra210-e2220-1170.dtb \
-   tegra210-p2371-.dtb \
-   tegra210-p2371-2180.dtb \
-   tegra210-p2571.dtb
-
-dtb-$(CONFIG_ARCH_MVEBU) +=\
-   armada-388-gp.dtb   \
-   armada-xp-gp.dtb
-
-dtb-$(CONFIG_ARCH_UNIPHIER) += \
-   uniphier-ph1-ld4-ref.dtb \
-   uniphier-ph1-ld6b-ref.dtb \
-   uniphier-ph1-pro4-ref.dtb \
-   uniphier-ph1-pro5-4kbox.dtb \
-   uniphier-ph1-sld3-ref.dtb \
-   uniphier-ph1-sld8-ref.dtb \
-   uniphier-proxstream2-gentil.dtb \
-   uniphier-proxstream2-vodka.dtb
-dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
-   zynq-zc706.dtb \
-   zynq-zed.dtb \
-   zynq-zybo.dtb \
-   zynq-microzed.dtb \
-   zynq-picozed.dtb \
-   zynq-zc770-xm010.dtb \
-   zynq-zc770-xm011.dtb \
-   zynq-zc770-xm012.dtb \
-   zynq-zc770-xm013.dtb
-dtb-$(CONFIG_ARCH_ZYNQMP) += \
-   zynqmp-ep108.dtb
-dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-evm.dtb
-dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb
-
-dtb-$(CONFIG_ARCH_SOCFPGA) +=  \
-   socfpga_arria5_socdk.dtb\
-   socfpga_cyclone5_mcvevk.dtb \
-   socfpga_cyclone5_socdk.dtb  \
-   socfpga_cyclone5_de0_nano_soc.dtb   \
-   socfpga_cyclone5_sockit.dtb \
-   socfpga_cyclone5_socrates.dtb   \
-   socfpga_cyclone5_sr1500.dtb
-
-dtb-$(CONFIG_TARGET_DRA7XX_EVM) += dra72-evm.dtb dra7-evm.dtb
-dtb-$(CONFIG_TARGET_BEAGLE_X15) += am57xx-beagle-x15.dtb
-dtb-$(CONFIG_TARGET_STV0991) += stv0991.dtb
-
-dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \
-   ls1021a-twr.dtb
-dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2080a-qds.dtb \
-   fsl-ls2080a-rdb.dtb
-dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-qds.dtb \
-   fsl-ls1043a-rdb.dtb
-
-dtb-$(CONFIG_MACH_SUN4I) += \
-   sun4i-a10-a1000.dtb \
-   sun4i-a10-ba10-tvbox.dtb \
-   sun4i-a10-chuwi-v7-cw0825.dtb \
-   sun4i-a10-cubieboard.dtb \
-   sun4i-a10-gemei-g9.dtb \
-   sun4i-a10-hackberry.dtb \
-   sun4i-a10-hyundai-a7hd.dtb \
-   sun4i-a10-inet1.dtb \
-   sun4i-a10-inet-3f.dtb \
-   sun4i-a10-inet-3w.dtb \
-   sun4i-a10-inet97fv2.dtb \
-   sun4i-a10-inet9f-rev03.dtb \
-   sun4i-a10-itead-iteaduino-plus.dtb \
-   sun4i-a10-jesurun-q5.dtb \
-   sun4i-a10-marsboard.dtb \
-   sun4i-a10-mini-xplus.dtb \
-   sun4i-a10-mk802.dtb \
-   sun4i-a10-mk802ii.dtb \
-   sun4i-a10-olinuxino-lime.dtb \
-   sun4i-a10-pcduino.dtb \
-   sun4i-a10-pov-protab2-ips9.dtb
-dtb-$(CONFIG_MACH_SUN5I) += \
-   sun5i-a10s-auxtek-t003.dtb \
-   sun5i-a10s-auxtek-t004.dtb \
-   sun5i-a10s-mk802.dtb \
-   sun5i-a10s-olinuxino-micro.dtb \
-   sun5i-a10s-r7-tv-dongle.dtb \
-   sun5i-a10s-wobo-i5.dtb \
-

[U-Boot] [PATCH v2 7/9] powerpc: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2016-01-05 Thread Thomas Chou
Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards
in Makefile.

Support list of Device Tree in DEFAULT_DEVICE_TREE. Each DT in the
list will be compiled. The first will be used as default to ship.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Cc: Wolfgang Denk <w...@denx.de>
---
v2
  add list support as Simon suggested.

 arch/powerpc/dts/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/dts/Makefile b/arch/powerpc/dts/Makefile
index 5d9f5c2..eaeb26f 100644
--- a/arch/powerpc/dts/Makefile
+++ b/arch/powerpc/dts/Makefile
@@ -2,7 +2,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-$(CONFIG_TARGET_CANYONLANDS) += arches.dtb canyonlands.dtb glacier.dtb
+DEVICE_TREE_LIST ?= $(subst $\",,$(CONFIG_DEFAULT_DEVICE_TREE))
+dtb-y += $(DEVICE_TREE_LIST:=.dtb)
 
 targets += $(dtb-y)
 
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 1/9] devicetree: use wildcard to clean arch subdir

2016-01-05 Thread Thomas Chou
Use wildcard to clean arch subdirectories, as it is cleaner than
listing all the arch which builds dtb.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Reviewed-by: Bin Meng <bmeng...@gmail.com>
---
v2
  no change

 dts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dts/Makefile b/dts/Makefile
index d3122aa..dbde703 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -45,4 +45,4 @@ dtbs: $(obj)/dt.dtb
 clean-files := dt.dtb.S
 
 # Let clean descend into dts directories
-subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts 
../arch/x86/dts
+subdir- += ../arch/*/dts
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 2/9] devicetree: support list of Device Tree in DEFAULT_DEVICE_TREE

2016-01-05 Thread Thomas Chou
Support list of Device Tree in DEFAULT_DEVICE_TREE. Each DT in the
list will be compiled. The first will be used as default to ship.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
v2
  add list support as Simon suggested.

 dts/Kconfig  | 3 ++-
 dts/Makefile | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dts/Kconfig b/dts/Kconfig
index fb2d79e..8d8b448 100644
--- a/dts/Kconfig
+++ b/dts/Kconfig
@@ -54,7 +54,8 @@ endchoice
 config DEFAULT_DEVICE_TREE
string "Default Device Tree for DT control"
help
- This option specifies the default Device Tree used for DT control.
+ This option specifies a space-separated list of Device Tree used
+ for DT control. The first will be used as default to ship.
  It can be overridden from the command line:
  $ make DEVICE_TREE=
 
diff --git a/dts/Makefile b/dts/Makefile
index dbde703..8278caf 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -7,7 +7,8 @@
 # This Makefile builds the internal U-Boot fdt if CONFIG_OF_CONTROL is
 # enabled. See doc/README.fdt-control for more details.
 
-DEVICE_TREE ?= $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%)
+DEVICE_TREE_LIST ?= $(subst $\",,$(CONFIG_DEFAULT_DEVICE_TREE))
+DEVICE_TREE ?= $(firstword $(DEVICE_TREE_LIST))
 ifeq ($(DEVICE_TREE),)
 DEVICE_TREE := unset
 endif
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 3/9] nios2: support list of Device Tree in DEFAULT_DEVICE_TREE

2016-01-05 Thread Thomas Chou
Support list of Device Tree in DEFAULT_DEVICE_TREE. Each DT in the
list will be compiled. The first will be used as default to ship.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
v2
  add list support as Simon suggested.

 arch/nios2/dts/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/nios2/dts/Makefile b/arch/nios2/dts/Makefile
index f22fabf..eaeb26f 100644
--- a/arch/nios2/dts/Makefile
+++ b/arch/nios2/dts/Makefile
@@ -2,7 +2,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-y += $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%).dtb
+DEVICE_TREE_LIST ?= $(subst $\",,$(CONFIG_DEFAULT_DEVICE_TREE))
+dtb-y += $(DEVICE_TREE_LIST:=.dtb)
 
 targets += $(dtb-y)
 
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 9/9] x86: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2016-01-05 Thread Thomas Chou
Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards
in Makefile.

Support list of Device Tree in DEFAULT_DEVICE_TREE. Each DT in the
list will be compiled. The first will be used as default to ship.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Cc: Bin Meng <bmeng...@gmail.com>
---
v2
  add list support as Simon suggested.

 arch/x86/dts/Makefile | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/arch/x86/dts/Makefile b/arch/x86/dts/Makefile
index 64e5694..eaeb26f 100644
--- a/arch/x86/dts/Makefile
+++ b/arch/x86/dts/Makefile
@@ -2,16 +2,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-y += bayleybay.dtb \
-   chromebook_link.dtb \
-   chromebox_panther.dtb \
-   crownbay.dtb \
-   efi.dtb \
-   galileo.dtb \
-   minnowmax.dtb \
-   qemu-x86_i440fx.dtb \
-   qemu-x86_q35.dtb \
-   broadwell_som-6896.dtb
+DEVICE_TREE_LIST ?= $(subst $\",,$(CONFIG_DEFAULT_DEVICE_TREE))
+dtb-y += $(DEVICE_TREE_LIST:=.dtb)
 
 targets += $(dtb-y)
 
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 4/9] arc: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2016-01-05 Thread Thomas Chou
Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards
in Makefile.

Support list of Device Tree in DEFAULT_DEVICE_TREE. Each DT in the
list will be compiled. The first will be used as default to ship.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Cc: Alexey Brodkin <alexey.brod...@synopsys.com>
---
v2
  add list support as Simon suggested.

 arch/arc/dts/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile
index d4772ec..eaeb26f 100644
--- a/arch/arc/dts/Makefile
+++ b/arch/arc/dts/Makefile
@@ -2,9 +2,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-$(CONFIG_TARGET_AXS101) +=  axs10x.dtb
-dtb-$(CONFIG_TARGET_ARCANGEL4) +=  arcangel4.dtb
-dtb-$(CONFIG_TARGET_TB100) +=  abilis_tb100.dtb
+DEVICE_TREE_LIST ?= $(subst $\",,$(CONFIG_DEFAULT_DEVICE_TREE))
+dtb-y += $(DEVICE_TREE_LIST:=.dtb)
 
 targets += $(dtb-y)
 
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 6/9] microblaze: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2016-01-05 Thread Thomas Chou
Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards
in Makefile.

Support list of Device Tree in DEFAULT_DEVICE_TREE. Each DT in the
list will be compiled. The first will be used as default to ship.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Cc: Michal Simek <michal.si...@xilinx.com>
---
v2
  add list support as Simon suggested.

 arch/microblaze/dts/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile
index 5e70d9e..eaeb26f 100644
--- a/arch/microblaze/dts/Makefile
+++ b/arch/microblaze/dts/Makefile
@@ -2,7 +2,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-y += microblaze-generic.dtb
+DEVICE_TREE_LIST ?= $(subst $\",,$(CONFIG_DEFAULT_DEVICE_TREE))
+dtb-y += $(DEVICE_TREE_LIST:=.dtb)
 
 targets += $(dtb-y)
 
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 8/9] sandbox: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2016-01-05 Thread Thomas Chou
Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards
in Makefile.

Support list of Device Tree in DEFAULT_DEVICE_TREE. Each DT in the
list will be compiled. The first will be used as default to ship.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
v2
  add list support as Simon suggested.

 arch/sandbox/dts/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile
index 0197569..7260256 100644
--- a/arch/sandbox/dts/Makefile
+++ b/arch/sandbox/dts/Makefile
@@ -2,7 +2,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-$(CONFIG_SANDBOX) += sandbox.dtb
+DEVICE_TREE_LIST ?= $(subst $\",,$(CONFIG_DEFAULT_DEVICE_TREE))
+dtb-y += $(DEVICE_TREE_LIST:=.dtb)
 dtb-$(CONFIG_UT_DM) += test.dtb
 
 targets += $(dtb-y)
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] arm: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2016-01-05 Thread Thomas Chou

Hi Simon,

On 2016年01月06日 08:24, Simon Glass wrote:

+Masahiro

Hi Thomas,

On 5 January 2016 at 06:16, Thomas Chou <tho...@wytron.com.tw> wrote:

Hi Simon,

On 2016年01月05日 08:56, Simon Glass wrote:


One of the benefits of device tree is that we can run the same code
paths on multiple boards. Then buildman has less work to do. For
example, if it builds 'snow' then we know that 'pit' and 'pi' are good
also. If you change the way device trees work then we lose this
benefit. It would be great if we could build (say) 100 boards for 100%
code coverage instead of 1000 boards.

If you can find a way to build all the device tree files for a
particular SoC without listing them out in the Makefile, then fine.
But I really don't want to lose that feature. It is very useful.



I am preparing an update v2 to support building list of DT from configs.

By adding support of list to DEFAULT_DEVICE_TREE,
This option specifies a space-separated list of Device Tree used
for DT control.  Each DT in the list will be compiled. The first will be
used as default to ship.


It would be better if we could ship all of them, and select the right
tone at run-time.




Another example is sandbox, which builds both 'sandbox.dts' and
'test.dts'. It allows us to run a test easily:

./sandbox/u-boot -d sandbox/arch/sandbox/dts/test.dtb -c "ut dm
usb_kdb" for example.

If we didn't have that it would be a right pain to run tests.



No problem. The test.dtb rules is retained.


I still don't understand what problem you are trying to solve. Can you
explain again what is wrong with the status quo?



The current build generate too many DTB that users probably don't want/need.
And the arch//dts/Makefile grows fat as every new board/target add lines to
it. There should be some way to handle it in a cleaner style.


But at least we get a clear list of what is includes, and what SoC it
relates to. Linux uses the same approach. I'm really not sold on this
idea.



Thanks for the explanation. Now I understand. But there is no harm to 
add list support for building DT to configs. Please review and pick 1/9 
and 2/9 of PATCH v2. And leave the rest to arch custodians.


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6 01/10] mips: implement to access the KSEG0/1 memory range in map_physmem

2016-01-04 Thread Thomas Chou

Hi Wills,

On 2016年01月04日 19:14, Wills Wang wrote:

U-boot just use the no MMU virtual address segment(KSEG0/1), this
patch enable access the uncached memory range(KSEG1) by flag
"MAP_NOCACHE", other flag for KSEG0 access.

Signed-off-by: Wills Wang 
---

Changes in v6:
- Remove useless "else"

Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

  arch/mips/include/asm/io.h | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index a7ab087..77353e5 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -485,7 +485,7 @@ static inline void sync(void)
   * that can be used to access the memory range with the caching
   * properties specified by "flags".
   */
-#define MAP_NOCACHE(0)
+#define MAP_NOCACHE(1)
  #define MAP_WRCOMBINE (0)
  #define MAP_WRBACK(0)
  #define MAP_WRTHROUGH (0)
@@ -493,7 +493,9 @@ static inline void sync(void)
  static inline void *
  map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
  {
-   return (void *)paddr;
+   if (flags)
+   return (void *)KSEG1ADDR(paddr);
+   return (void *)KSEG0ADDR(paddr);
  }

  /*



But Daniel has suggested CKSEG1ADDR() instead. :)

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6 08/10] mips: ath79: add spi driver

2016-01-04 Thread Thomas Chou
I_REG_IOC);
+   }
+
+   restbits = (bitlen % 8);
+   if (restbits)
+   bytes++;
+
+   out = AR71XX_SPI_IOC_CS_ALL & ~(AR71XX_SPI_IOC_CS(slave->cs));
+   while (bytes > 0) {
+   bytes--;
+   curbyte = 0;
+   if (tx)
+   curbyte = *tx++;
+
+   if (restbits && !bytes) {
+   curbitlen = restbits;
+   curbyte <<= 8 - restbits;
+   } else {
+   curbitlen = 8;
+   }
+
+   for (curbyte <<= (8 - curbitlen); curbitlen; curbitlen--) {
+   if (curbyte & 0x80)
+   out |= AR71XX_SPI_IOC_DO;
+   else
+   out &= ~(AR71XX_SPI_IOC_DO);
+
+   ath79_spi_write(bus, out, AR71XX_SPI_REG_IOC);
+
+   /* delay for low level */
+   if (priv->rrw_delay) {
+   tick = get_ticks() + priv->rrw_delay;
+   while (get_ticks() < tick)
+   /*NOP*/;
+   }
+
+   ath79_spi_write(bus, out | AR71XX_SPI_IOC_CLK,
+   AR71XX_SPI_REG_IOC);
+
+   /* delay for high level */
+   if (priv->rrw_delay) {
+   tick = get_ticks() + priv->rrw_delay;
+   while (get_ticks() < tick)
+   /*NOP*/;
+   }
+
+   curbyte <<= 1;
+   }
+
+   if (!bytes)
+   ath79_spi_write(bus, out, AR71XX_SPI_REG_IOC);
+
+   in = ath79_spi_read(bus, AR71XX_SPI_REG_RDS);
+   if (rx) {
+   if (restbits && !bytes)
+   *rx++ = (in << (8 - restbits));
+   else
+   *rx++ = in;
+   }
+   }
+
+   if (flags & SPI_XFER_END) {
+   ath79_spi_write(bus, AR71XX_SPI_IOC_CS(slave->cs),
+   AR71XX_SPI_REG_IOC);
+   ath79_spi_write(bus, AR71XX_SPI_IOC_CS_ALL, AR71XX_SPI_REG_IOC);
+   ath79_spi_write(bus, 0, AR71XX_SPI_REG_FS);
+   }
+
+   return 0;
+}
+
+
+static int ath79_spi_set_speed(struct udevice *bus, uint speed)
+{
+   struct ath79_spi_priv *priv = dev_get_priv(bus);
+   u32 val, div = 0;
+   u64 time;
+
+   if (speed)
+   div = get_bus_freq(0) / speed;
+
+   if (div > 63)
+   div = 63;
+
+   if (div < 5)
+   div = 5;
+
+   /* calculate delay */
+   time = get_tbclk();
+   do_div(time, speed / 2);
+   val = ATH79_SPI_RRW_DELAY_FACTOR / (get_bus_freq(0) / MHZ);
+   if (time > val)
+   priv->rrw_delay = time - val + 1;
+   else
+   priv->rrw_delay = 0;
+
+   ath79_spi_write(bus, AR71XX_SPI_FS_GPIO, AR71XX_SPI_REG_FS);
+   val = ath79_spi_read(bus, AR71XX_SPI_REG_CTRL);
+   val &= ~AR71XX_SPI_CTRL_DIV_MASK;
+   val |= ATH79_SPI_CLK_DIV(div);
+   ath79_spi_write(bus, val, AR71XX_SPI_REG_CTRL);
+   ath79_spi_write(bus, 0, AR71XX_SPI_REG_FS);
+   return 0;
+}
+
+static int ath79_spi_set_mode(struct udevice *bus, uint mode)
+{
+   return 0;
+}
+
+static int ath79_spi_probe(struct udevice *bus)
+{
+   struct ath79_spi_priv *priv = dev_get_priv(bus);
+   fdt_addr_t addr;
+
+   addr = dev_get_addr(bus);
+   if (addr == FDT_ADDR_T_NONE)
+   return -EINVAL;
+
+   priv->regs = map_physmem(addr,
+AR71XX_SPI_SIZE,
+MAP_NOCACHE);
+
+   /* Init SPI Hardware, disable remap, set clock */
+   ath79_spi_write(bus, AR71XX_SPI_FS_GPIO, AR71XX_SPI_REG_FS);
+   ath79_spi_write(bus, AR71XX_SPI_CTRL_RD | ATH79_SPI_CLK_DIV(8),
+   AR71XX_SPI_REG_CTRL);
+   ath79_spi_write(bus, 0, AR71XX_SPI_REG_FS);
+
+   return 0;
+}
+
+static int ath79_cs_info(struct udevice *bus, uint cs,
+  struct spi_cs_info *info)
+{
+   /* Always allow activity on CS 0/1/2 */
+   if (cs >= 3)
+   return -ENODEV;
+
+   return 0;
+}
+
+static const struct dm_spi_ops ath79_spi_ops = {
+   .claim_bus  = ath79_spi_claim_bus,
+   .release_bus= ath79_spi_release_bus,
+   .xfer   = ath79_spi_xfer,
+   .set_speed  = ath79_spi_set_speed,
+   .set_mode   = ath79_spi_set_mode,
+   .cs_info= ath79_cs_info,
+};
+
+static const struct udevice_id ath79_spi_ids[] = {
+   { .compatible = "qca,ar7100-spi" },
+   {}
+};
+
+U_BOOT_DRIVER(ath79_spi) = {
+   .name   = &

Re: [U-Boot] [PATCH v6 07/10] ns16550: map register base address for debug UART

2016-01-04 Thread Thomas Chou

Hi Wills,

On 2016年01月04日 19:14, Wills Wang wrote:

MIPS need to use KSEG1 address for register operation, this patch
add map_physmem to convert CONFIG_DEBUG_UART_BASE for debug UART.

Signed-off-by: Wills Wang <wills.w...@live.com>
---

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

  drivers/serial/ns16550.c | 6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 3b24af0..1e2538e 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -270,7 +270,8 @@ int NS16550_tstc(NS16550_t com_port)

  static inline void _debug_uart_init(void)
  {
-   struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE;
+   struct NS16550 *com_port = (struct NS16550 *)map_physmem(
+   CONFIG_DEBUG_UART_BASE, 0, MAP_NOCACHE);
int baud_divisor;

/*
@@ -293,7 +294,8 @@ static inline void _debug_uart_init(void)

  static inline void _debug_uart_putc(int ch)
  {
-   struct NS16550 *com_port = (struct NS16550 *)CONFIG_DEBUG_UART_BASE;
+   struct NS16550 *com_port = (struct NS16550 *)map_physmem(
+   CONFIG_DEBUG_UART_BASE, 0, MAP_NOCACHE);

while (!(serial_din(_port->lsr) & UART_LSR_THRE))
;



As debug uart may be used in very early stage and SPL, I would suggest 
the CONFIG_DEBUG_UART_BASE here is mapped to uncached space already. So 
that we can keep the code and stack usage minimal.


My concern is that the uncache mapping in nios2 arch is different 
between NOMMU and MMU core, which will be decoded from device tree. So 
it won't work for nios2 until DM initialized.


Naked-by: Thomas Chou <tho...@wytron.com.tw>

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6 05/10] mips: ath79: add serial driver for ar933x SOC

2016-01-04 Thread Thomas Chou
iomem *regs;
+   u32 val, scale, step;
+
+   regs = map_physmem(CONFIG_DEBUG_UART_BASE,
+AR933X_UART_SIZE,
+MAP_NOCACHE);
+


Please see my comment on your patch v6 07/10.


+   /*
+* UART controller configuration:
+* - no DMA
+* - no interrupt
+* - DCE mode
+* - no flow control
+* - set RX ready oride
+* - set TX ready oride
+*/
+   val = (AR933X_UART_CS_IF_MODE_DCE << AR933X_UART_CS_IF_MODE_S) |
+ AR933X_UART_CS_TX_RDY_ORIDE | AR933X_UART_CS_RX_RDY_ORIDE;
+   writel(val, regs + AR933X_UART_CS_REG);
+
+   ar933x_serial_get_scale_step(CONFIG_DEBUG_UART_CLOCK,
+CONFIG_BAUDRATE, , );
+
+   val  = (scale & AR933X_UART_CLK_SCALE_M)
+   << AR933X_UART_CLK_SCALE_S;
+   val |= (step & AR933X_UART_CLK_STEP_M)
+   << AR933X_UART_CLK_STEP_S;
+   writel(val, regs + AR933X_UART_CLK_REG);
+}
+
+static inline void _debug_uart_putc(int c)
+{
+   void __iomem *regs;
+   u32 data;
+
+   regs = map_physmem(CONFIG_DEBUG_UART_BASE,
+AR933X_UART_SIZE,
+MAP_NOCACHE);
+
+   do {
+   data = readl(regs + AR933X_UART_DATA_REG);
+   } while (!(data & AR933X_UART_DATA_TX_CSR));
+
+   data  = (u32)c | AR933X_UART_DATA_TX_CSR;
+   writel(data, regs + AR933X_UART_DATA_REG);
+}
+
+DEBUG_UART_FUNCS
+
+#endif



Otherwise,

Reviewed-by: Thomas Chou <tho...@wytron.com.tw>

Best regards,
Thomas

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v6 06/10] ns16550: add support for mips

2016-01-04 Thread Thomas Chou

Hi Wills,

On 2016年01月04日 19:14, Wills Wang wrote:

MIPS archtecture have no "in_le32/in_be32/out_le32/out_be32" macro,
but usually define CONFIG_SYS_BIG_ENDIAN, this patch use readl/writel
for register operation in mips when define CONFIG_SYS_NS16550_MEM32.

Signed-off-by: Wills Wang 
---


As Marek might have suggested, you should consider add these macro first.

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] nios2: set up the debug UART early

2015-12-30 Thread Thomas Chou
Set up the debug UART early if enabled, so that it is ready to use.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 arch/nios2/cpu/start.S | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/nios2/cpu/start.S b/arch/nios2/cpu/start.S
index 54787c5..1caee0c 100644
--- a/arch/nios2/cpu/start.S
+++ b/arch/nios2/cpu/start.S
@@ -106,6 +106,13 @@ _reloc:
stw r0, 4(sp)
mov fp, sp
 
+#ifdef CONFIG_DEBUG_UART
+   /* Set up the debug UART */
+   movhi   r2, %hi(debug_uart_init@h)
+   ori r2, r2, %lo(debug_uart_init@h)
+   callr   r2
+#endif
+
/* Allocate and zero GD, update SP */
mov r4, sp
movhi   r2, %hi(board_init_f_mem@h)
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 4/5] mips: ath79: add spi driver

2015-12-29 Thread Thomas Chou

Hi Marek,

On 2015年12月29日 21:25, Marek Vasut wrote:

On Tuesday, December 29, 2015 at 02:00:27 PM, Thomas Chou wrote:

Hi Wills,

On 2015年12月29日 19:17, Wills Wang wrote:

diff --git a/arch/mips/mach-ath79/Kconfig b/arch/mips/mach-ath79/Kconfig
index 1d92a5b..b5668e9 100644
--- a/arch/mips/mach-ath79/Kconfig
+++ b/arch/mips/mach-ath79/Kconfig
@@ -15,6 +15,7 @@ config SOC_AR933X

select SYS_MIPS_CACHE_INIT_RAM_LOAD
select MIPS_TUNE_24KC
select AR933X_UART

+   select ATH79_SPI


Both AR933X_UART and ATH79_SPI should not be selected with mach Kconfig.
They should go with board defconfig.


diff --git a/drivers/spi/ath79_spi.c b/drivers/spi/ath79_spi.c

+static inline void ath79_spi_delay(int max_hz)
+{
+   uint64_t tick = get_tbclk();
+
+   do_div(tick, max_hz);
+   tick = get_ticks() + tick + 1;  /* get current timestamp */
+   while (get_ticks() < tick)   /* loop till event */
+/*NOP*/;
+}


Use udelay() instead.


You mean get_timer() based delay loop, yes ?


Sorry, my mistake. Just realized that we don't have nano delay yet. The 
code above is fine.


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 4/5] mips: ath79: add spi driver

2015-12-29 Thread Thomas Chou

Hi Marek and Wills,

On 2015年12月30日 08:51, Marek Vasut wrote:

Just skimming through the code, it seems like bitbanging the SPI using the
generic soft-spi driver might be easier ;-/



I read the data sheet and Linux driver. Now I have clearer picture of 
this device. In serial flash mode, it reads like CFI flash. But we need 
to switch to bitbanging mode to write flash. In bitbanging, we have 
shift in data as word read. Though the cs, clk and dout are gpio. And 
the soft-spi of u-boot won't fit well.


So the current ath79_spi_delay() is fine. as we don't have ndelay() in 
u-boot yet. But the set_speed() code is for serial flash mode, and does 
not apply to bitbanging mode. You should save the result of do_div(tick, 
max_hz) to priv data, because dividing can take some time. You may trim 
the count with rrw_delay like that of Linux driver for more accurate timing.


BTW, the usage of uint8_t,uint32_t and uint64_t is deprecated. Please 
change them to u8, u32 and u64. It will be helpful to run checkpatch.pl.


Thanks a lot for your work.

Best regards,
Thomas




___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 3/5] mips: ath79: add serial driver for ar933x SOC

2015-12-29 Thread Thomas Chou

Hi Wills,

On 2015年12月29日 19:17, Wills Wang wrote:

> +DECLARE_GLOBAL_DATA_PTR;

The gd is not used in this patch. It can be removed.


+static int ar933x_serial_putc(struct udevice *dev, const char c)
+{
+   u32 data;
+



+   do {
+   data = ar933x_serial_read(dev, AR933X_UART_DATA_REG);
+   } while (!(data & AR933X_UART_DATA_TX_CSR));


data = ar933x_serial_read(dev, AR933X_UART_DATA_REG);
if (!(data & AR933X_UART_DATA_TX_CSR))
return -EAGAIN;


+
+   data  = (u32)c | AR933X_UART_DATA_TX_CSR;
+   ar933x_serial_write(dev, data, AR933X_UART_DATA_REG);
+
+   return 0;
+}
+
+static int ar933x_serial_getc(struct udevice *dev)
+{
+   u32 data;
+



+   do {
+   data = ar933x_serial_read(dev, AR933X_UART_DATA_REG);
+   } while (!(data & AR933X_UART_DATA_RX_CSR));


data = ar933x_serial_read(dev, AR933X_UART_DATA_REG);
if (!(data & AR933X_UART_DATA_RX_CSR))
return -EAGAIN;


+
+   data = ar933x_serial_read(dev, AR933X_UART_DATA_REG);
+   ar933x_serial_write(dev, AR933X_UART_DATA_RX_CSR,
+   AR933X_UART_DATA_REG);
+   return data & AR933X_UART_DATA_TX_RX_MASK;
+}
+


> +static int ar933x_serial_probe(struct udevice *dev)
> +{
> +  struct ar933x_serial_priv *priv = dev_get_priv(dev);
> +  u32 val;
> +
> +  fdt_addr_t addr;

Why extra blank line above "fdt_addr_t addr;"?

=

checkpatch.pl,

WARNING: Missing a blank line after declarations
#206: FILE: drivers/serial/serial_ar933x.c:45:
+   struct ar933x_serial_priv *priv = dev_get_priv(dev);
+   return readl(priv->regs + offset);

CHECK: Alignment should match open parenthesis
#210: FILE: drivers/serial/serial_ar933x.c:49:
+static inline void ar933x_serial_write(struct udevice *dev,
+   u32 val, u32 offset)

WARNING: Missing a blank line after declarations
#213: FILE: drivers/serial/serial_ar933x.c:52:
+   struct ar933x_serial_priv *priv = dev_get_priv(dev);
+   writel(val, priv->regs + offset);

CHECK: Alignment should match open parenthesis
#234: FILE: drivers/serial/serial_ar933x.c:73:
+static void ar933x_serial_get_scale_step(u32 clk, u32 baud,
+  u32 *scale, u32 *step)

CHECK: Please don't use multiple blank lines
#393: FILE: drivers/serial/serial_ar933x.c:232:
+
+

Thanks.

Regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 4/5] mips: ath79: add spi driver

2015-12-29 Thread Thomas Chou

Hi Wills,

On 2015年12月29日 19:17, Wills Wang wrote:

diff --git a/arch/mips/mach-ath79/Kconfig b/arch/mips/mach-ath79/Kconfig
index 1d92a5b..b5668e9 100644
--- a/arch/mips/mach-ath79/Kconfig
+++ b/arch/mips/mach-ath79/Kconfig
@@ -15,6 +15,7 @@ config SOC_AR933X
select SYS_MIPS_CACHE_INIT_RAM_LOAD
select MIPS_TUNE_24KC
select AR933X_UART
+   select ATH79_SPI


Both AR933X_UART and ATH79_SPI should not be selected with mach Kconfig. 
They should go with board defconfig.



diff --git a/drivers/spi/ath79_spi.c b/drivers/spi/ath79_spi.c



+static inline void ath79_spi_delay(int max_hz)
+{
+   uint64_t tick = get_tbclk();
+
+   do_div(tick, max_hz);
+   tick = get_ticks() + tick + 1;  /* get current timestamp */
+   while (get_ticks() < tick)   /* loop till event */
+/*NOP*/;
+}


Use udelay() instead.

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] altera_qspi: show erase progress

2015-12-28 Thread Thomas Chou

Hi Marek,

On 2015年12月28日 13:35, Marek Vasut wrote:

On Monday, December 28, 2015 at 02:17:46 AM, Thomas Chou wrote:

Hi Marek,

On 2015年12月25日 17:58, Marek Vasut wrote:

On Friday, December 25, 2015 at 09:33:52 AM, Thomas Chou wrote:

Hi Marek,

On 2015年12月25日 12:08, Marek Vasut wrote:

Well, it is only a putc() which is plain and simple.


Sure, but then I still don't understand why this cannot be in the
common code.


Yes, it can be in the common code. Do you have an idea how should it
look like?


No, I don't, I am not a CFI expert, sorry.


Then I shall push these first and find way to put it to common code some
time later. Thanks.


Is this any way to deal with feedback ? Why don't you put it into flash_erase()
for example, in drivers/mtd/cfi_flash.c ?


Though altera-qspi works like CFI flash, it is not CFI flash as it does 
not have CFI info. It is a separate driver to cfi_flash.c.


Both drivers and many other parallel flash drivers under the board/arch 
directories are called by common/cmd_flash.c, which is very old and 
somewhat nasty. It could be the place for common feedback. But this is 
too far and deeply involved. I wanted to touch it a month ago, made some 
patches but withdrew then.


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/7] arm: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2015-12-28 Thread Thomas Chou

Hi Simon,

On 2015年12月29日 08:22, Simon Glass wrote:

Hi Thomas,

On 27 December 2015 at 19:16, Bin Meng <bmeng...@gmail.com> wrote:

On Sun, Dec 27, 2015 at 9:44 PM, Thomas Chou <tho...@wytron.com.tw> wrote:

Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Cc: Albert Aribaud <albert.u.b...@aribaud.net>
---
  arch/arm/dts/Makefile | 192 +-
  1 file changed, 1 insertion(+), 191 deletions(-)



Reviewed-by: Bin Meng <bmeng...@gmail.com>


The problem with these patches is that it prevents building all the
compatible device tree files for a board family. The default device
tree is just that - it is not the only one that can be used. A build
system can taken one of the output device tree files and package it
with U-Boot. If we don't build then, then that becomes impossible.

What is the purpose of these patches?

A better solution might be to add an option to list the files which
should be built. Then we gain control over this, if that is what you
are trying to achieve.


The device tree describes hardware. Each board is a hardware, and should 
have only one device tree. The u-boot is a boot loader, which might have 
different options to load the next stage, eg. Linux. As I see in the 
configs/ dir, there can be several defconfig for a board and uses the 
same device tree. With device tree controlled u-boot, the output is 
u-boot-dtb.bin for each configuration.


The next stage, say, Linux, gets device tree from u-boot. A single 
kernel can work on many different boards bond with possibly different 
device tree blob and booting configuration.


We can use buildman to build a family of target binary including device 
tree blob. So I don't see the reason to keep the list of device tree per 
target.


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 4/8] mips: ath79: add serial driver for ar933x SOC

2015-12-27 Thread Thomas Chou

Hi Wills,

On 2015年12月27日 14:28, Wills Wang wrote:

+static int ar933x_serial_putc(struct udevice *dev, const char c)
+{
+u32 data;
+
+if (c == '\n')
+ar933x_serial_putc(dev, '\r');

remove this, the serial core driver takes care of it


+
+do {
+data = ar933x_serial_read(dev, AR933X_UART_DATA_REG);
+} while (!(data & AR933X_UART_DATA_TX_CSR));

remove this, the serial core driver takes care of it via your pending
callback (ar933x_serial_pending)



Serial core driver don't query and wait the pending function before
"serial_getc" and "serial_putc", so these statements can't remove,
or board don't work.


As I wrote in the v3 patch review, both the getc() and putc() should 
return -EAGAIN if there is no available data to read or not ready to 
write. The polling is done in the serial-uclass.c


Regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 4/8] mips: ath79: add serial driver for ar933x SOC

2015-12-27 Thread Thomas Chou

Hi Wills,

On 2015年12月26日 21:20, Daniel Schwierzeck wrote:

+static int ar933x_serial_probe(struct udevice *dev)
+{
+   struct ar933x_serial_priv *priv = dev_get_priv(dev);
+   struct ar933x_serial_platdata *plat = dev_get_platdata(dev);
+   u32 val;
+
+   priv->regs = plat->regs;
+
+   /*
+* UART controller configuration:
+* - no DMA
+* - no interrupt
+* - DCE mode
+* - no flow control
+* - set RX ready oride
+* - set TX ready oride
+*/
+   val = (AR933X_UART_CS_IF_MODE_DCE << AR933X_UART_CS_IF_MODE_S) |
+ AR933X_UART_CS_TX_RDY_ORIDE | AR933X_UART_CS_RX_RDY_ORIDE;
+   ar933x_serial_write(dev, val, AR933X_UART_CS_REG);
+   return 0;
+}
+
+static int ar933x_serial_ofdata_to_platdata(struct udevice *dev)
+{
+   struct ar933x_serial_platdata *plat = dev_get_platdata(dev);
+   fdt_addr_t addr;
+
+   addr = dev_get_addr(dev);
+   if (addr == FDT_ADDR_T_NONE)
+   return -EINVAL;
+
+   plat->regs = map_physmem(addr,
+AR933X_UART_SIZE,
+MAP_NOCACHE);


move this code to function ar933x_serial_probe and drop this function


+   return 0;
+}
+
+static const struct dm_serial_ops ar933x_serial_ops = {
+   .putc = ar933x_serial_putc,
+   .pending = ar933x_serial_pending,
+   .getc = ar933x_serial_getc,
+   .setbrg = ar933x_serial_setbrg,
+};
+
+static const struct udevice_id ar933x_serial_ids[] = {
+   { .compatible = "ath79,ar933x-uart" },
+   { }
+};
+
+U_BOOT_DRIVER(serial_ar933x) = {
+   .name   = "serial_ar933x",
+   .id = UCLASS_SERIAL,
+   .of_match = ar933x_serial_ids,
+   .ofdata_to_platdata = ar933x_serial_ofdata_to_platdata,
+   .platdata_auto_alloc_size = sizeof(struct ar933x_serial_platdata),


drop the two lines, you do not need to allocate platdata



It might be another option to keep platdata and ofdata_to_platdata(), 
and remove the priv data. Let ofdata_to_platdata() do the DT conversion 
and probe() detect and initialize the hardware. This is what these func 
expected to do. The priv data is needed only when there is variable data 
to save per device.


Best regards,
Thomas

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 7/7] x86: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2015-12-27 Thread Thomas Chou
Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Cc: Bin Meng <bmeng...@gmail.com>
---
 arch/x86/dts/Makefile | 11 +--
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/arch/x86/dts/Makefile b/arch/x86/dts/Makefile
index 64e5694..f22fabf 100644
--- a/arch/x86/dts/Makefile
+++ b/arch/x86/dts/Makefile
@@ -2,16 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-y += bayleybay.dtb \
-   chromebook_link.dtb \
-   chromebox_panther.dtb \
-   crownbay.dtb \
-   efi.dtb \
-   galileo.dtb \
-   minnowmax.dtb \
-   qemu-x86_i440fx.dtb \
-   qemu-x86_q35.dtb \
-   broadwell_som-6896.dtb
+dtb-y += $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%).dtb
 
 targets += $(dtb-y)
 
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 6/7] sandbox: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2015-12-27 Thread Thomas Chou
Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 arch/sandbox/dts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile
index 0197569..4969969 100644
--- a/arch/sandbox/dts/Makefile
+++ b/arch/sandbox/dts/Makefile
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-$(CONFIG_SANDBOX) += sandbox.dtb
+dtb-y += $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%).dtb
 dtb-$(CONFIG_UT_DM) += test.dtb
 
 targets += $(dtb-y)
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/7] arc: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2015-12-27 Thread Thomas Chou
Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Cc: Alexey Brodkin <alexey.brod...@synopsys.com>
---
 arch/arc/dts/Makefile | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile
index d4772ec..f22fabf 100644
--- a/arch/arc/dts/Makefile
+++ b/arch/arc/dts/Makefile
@@ -2,9 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-$(CONFIG_TARGET_AXS101) +=  axs10x.dtb
-dtb-$(CONFIG_TARGET_ARCANGEL4) +=  arcangel4.dtb
-dtb-$(CONFIG_TARGET_TB100) +=  abilis_tb100.dtb
+dtb-y += $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%).dtb
 
 targets += $(dtb-y)
 
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/7] devicetree: use wildcard to clean arch subdir

2015-12-27 Thread Thomas Chou
Use wildcard to clean arch subdirectories, as it is cleaner than
listing all the arch which builds dtb.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 dts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dts/Makefile b/dts/Makefile
index d3122aa..dbde703 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -45,4 +45,4 @@ dtbs: $(obj)/dt.dtb
 clean-files := dt.dtb.S
 
 # Let clean descend into dts directories
-subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts 
../arch/x86/dts
+subdir- += ../arch/*/dts
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/7] arm: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2015-12-27 Thread Thomas Chou
Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Cc: Albert Aribaud <albert.u.b...@aribaud.net>
---
 arch/arm/dts/Makefile | 192 +-
 1 file changed, 1 insertion(+), 191 deletions(-)

diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 0bcd316..6c57200 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -2,197 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-$(CONFIG_S5PC100) += s5pc1xx-smdkc100.dtb
-dtb-$(CONFIG_S5PC110) += s5pc1xx-goni.dtb
-dtb-$(CONFIG_EXYNOS4) += exynos4210-origen.dtb \
-   exynos4210-smdkv310.dtb \
-   exynos4210-universal_c210.dtb \
-   exynos4210-trats.dtb \
-   exynos4412-trats2.dtb \
-   exynos4412-odroid.dtb
-
-dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
-   exynos5250-snow.dtb \
-   exynos5250-spring.dtb \
-   exynos5250-smdk5250.dtb \
-   exynos5420-smdk5420.dtb \
-   exynos5420-peach-pit.dtb \
-   exynos5800-peach-pi.dtb \
-   exynos5422-odroidxu3.dtb
-dtb-$(CONFIG_ARCH_ROCKCHIP) += \
-   rk3288-firefly.dtb \
-   rk3288-jerry.dtb \
-   rk3036-sdk.dtb
-dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
-   tegra20-medcom-wide.dtb \
-   tegra20-paz00.dtb \
-   tegra20-plutux.dtb \
-   tegra20-seaboard.dtb \
-   tegra20-tec.dtb \
-   tegra20-trimslice.dtb \
-   tegra20-ventana.dtb \
-   tegra20-whistler.dtb \
-   tegra20-colibri.dtb \
-   tegra30-apalis.dtb \
-   tegra30-beaver.dtb \
-   tegra30-cardhu.dtb \
-   tegra30-colibri.dtb \
-   tegra30-tec-ng.dtb \
-   tegra114-dalmore.dtb \
-   tegra124-jetson-tk1.dtb \
-   tegra124-nyan-big.dtb \
-   tegra124-venice2.dtb \
-   tegra210-e2220-1170.dtb \
-   tegra210-p2371-.dtb \
-   tegra210-p2371-2180.dtb \
-   tegra210-p2571.dtb
-
-dtb-$(CONFIG_ARCH_MVEBU) +=\
-   armada-388-gp.dtb   \
-   armada-xp-gp.dtb
-
-dtb-$(CONFIG_ARCH_UNIPHIER) += \
-   uniphier-ph1-ld4-ref.dtb \
-   uniphier-ph1-ld6b-ref.dtb \
-   uniphier-ph1-pro4-ref.dtb \
-   uniphier-ph1-pro5-4kbox.dtb \
-   uniphier-ph1-sld3-ref.dtb \
-   uniphier-ph1-sld8-ref.dtb \
-   uniphier-proxstream2-gentil.dtb \
-   uniphier-proxstream2-vodka.dtb
-dtb-$(CONFIG_ARCH_ZYNQ) += zynq-zc702.dtb \
-   zynq-zc706.dtb \
-   zynq-zed.dtb \
-   zynq-zybo.dtb \
-   zynq-microzed.dtb \
-   zynq-picozed.dtb \
-   zynq-zc770-xm010.dtb \
-   zynq-zc770-xm011.dtb \
-   zynq-zc770-xm012.dtb \
-   zynq-zc770-xm013.dtb
-dtb-$(CONFIG_ARCH_ZYNQMP) += \
-   zynqmp-ep108.dtb
-dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-evm.dtb
-dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb
-
-dtb-$(CONFIG_ARCH_SOCFPGA) +=  \
-   socfpga_arria5_socdk.dtb\
-   socfpga_cyclone5_mcvevk.dtb \
-   socfpga_cyclone5_socdk.dtb  \
-   socfpga_cyclone5_de0_nano_soc.dtb   \
-   socfpga_cyclone5_sockit.dtb \
-   socfpga_cyclone5_socrates.dtb   \
-   socfpga_cyclone5_sr1500.dtb
-
-dtb-$(CONFIG_TARGET_DRA7XX_EVM) += dra72-evm.dtb dra7-evm.dtb
-dtb-$(CONFIG_TARGET_BEAGLE_X15) += am57xx-beagle-x15.dtb
-dtb-$(CONFIG_TARGET_STV0991) += stv0991.dtb
-
-dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \
-   ls1021a-twr.dtb
-dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2080a-qds.dtb \
-   fsl-ls2080a-rdb.dtb
-dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-qds.dtb \
-   fsl-ls1043a-rdb.dtb
-
-dtb-$(CONFIG_MACH_SUN4I) += \
-   sun4i-a10-a1000.dtb \
-   sun4i-a10-ba10-tvbox.dtb \
-   sun4i-a10-chuwi-v7-cw0825.dtb \
-   sun4i-a10-cubieboard.dtb \
-   sun4i-a10-gemei-g9.dtb \
-   sun4i-a10-hackberry.dtb \
-   sun4i-a10-hyundai-a7hd.dtb \
-   sun4i-a10-inet1.dtb \
-   sun4i-a10-inet-3f.dtb \
-   sun4i-a10-inet-3w.dtb \
-   sun4i-a10-inet97fv2.dtb \
-   sun4i-a10-inet9f-rev03.dtb \
-   sun4i-a10-itead-iteaduino-plus.dtb \
-   sun4i-a10-jesurun-q5.dtb \
-   sun4i-a10-marsboard.dtb \
-   sun4i-a10-mini-xplus.dtb \
-   sun4i-a10-mk802.dtb \
-   sun4i-a10-mk802ii.dtb \
-   sun4i-a10-olinuxino-lime.dtb \
-   sun4i-a10-pcduino.dtb \
-   sun4i-a10-pov-protab2-ips9.dtb
-dtb-$(CONFIG_MACH_SUN5I) += \
-   sun5i-a10s-auxtek-t003.dtb \
-   sun5i-a10s-auxtek-t004.dtb \
-   sun5i-a10s-mk802.dtb \
-   sun5i-a10s-olinuxino-micro.dtb \
-   sun5i-a10s-r7-tv-dongle.dtb \
-   sun5i-a10s-wobo-i5.dtb \
-   sun5i-a13-ampe-a76.dtb \
-   sun5i-a13-empire-electronix-d709.dtb \
-   sun5i-a13-hsg-h702.dtb \
-   sun5i-a13-inet-86vs.dtb \
-   sun5i-a13-inet-98v-rev2.dtb \
-

[U-Boot] [PATCH 4/7] microblaze: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2015-12-27 Thread Thomas Chou
Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Cc: Michal Simek <michal.si...@xilinx.com>
---
 arch/microblaze/dts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/microblaze/dts/Makefile b/arch/microblaze/dts/Makefile
index 5e70d9e..f22fabf 100644
--- a/arch/microblaze/dts/Makefile
+++ b/arch/microblaze/dts/Makefile
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-y += microblaze-generic.dtb
+dtb-y += $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%).dtb
 
 targets += $(dtb-y)
 
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 5/7] powerpc: use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE

2015-12-27 Thread Thomas Chou
Use generic dtb rule with CONFIG_DEFAULT_DEVICE_TREE, so that
there is no need to list all the dtb for different targets/boards.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Cc: Wolfgang Denk <w...@denx.de>
---
 arch/powerpc/dts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/dts/Makefile b/arch/powerpc/dts/Makefile
index 5d9f5c2..f22fabf 100644
--- a/arch/powerpc/dts/Makefile
+++ b/arch/powerpc/dts/Makefile
@@ -2,7 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-dtb-$(CONFIG_TARGET_CANYONLANDS) += arches.dtb canyonlands.dtb glacier.dtb
+dtb-y += $(CONFIG_DEFAULT_DEVICE_TREE:"%"=%).dtb
 
 targets += $(dtb-y)
 
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PULL] Please pull u-boot-nios/master

2015-12-27 Thread Thomas Chou
The following changes since commit 78680314c53a95c0bb25e942662979843b60d7b9:

  Merge branch 'master' of http://git.denx.de/u-boot-sunxi (2015-12-27 09:15:57 
-0500)

are available in the git repository at:

  git://git.denx.de/u-boot-nios.git master

for you to fetch changes up to 8e8106dcd540e4c735da6a0b71919747c15ce93a:

  altera_qspi: allow ctrl-c to abort the erase ops (2015-12-28 09:32:43 +0800)


Thomas Chou (5):
  altera_qspi: call callback even if the erase failed
  altera_qspi: set fail_addr for erase ops
  altera_qspi: skip erase if the sector is blank
  altera_qspi: show erase progress
  altera_qspi: allow ctrl-c to abort the erase ops

 drivers/mtd/altera_qspi.c | 56 ++-
 1 file changed, 46 insertions(+), 10 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] altera_qspi: show erase progress

2015-12-27 Thread Thomas Chou

Hi Marek,

On 2015年12月25日 17:58, Marek Vasut wrote:

On Friday, December 25, 2015 at 09:33:52 AM, Thomas Chou wrote:

Hi Marek,

On 2015年12月25日 12:08, Marek Vasut wrote:

Well, it is only a putc() which is plain and simple.


Sure, but then I still don't understand why this cannot be in the common
code.


Yes, it can be in the common code. Do you have an idea how should it
look like?


No, I don't, I am not a CFI expert, sorry.


Then I shall push these first and find way to put it to common code some 
time later. Thanks.


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] altera_qspi: show erase progress

2015-12-27 Thread Thomas Chou



On 2015年12月24日 08:51, Thomas Chou wrote:

Show sector erase progress with dot and comma.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
  drivers/mtd/altera_qspi.c | 14 ++
  1 file changed, 14 insertions(+)



Applied to u-boot-nios.

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5] altera_qspi: skip erase if the sector is blank

2015-12-27 Thread Thomas Chou



On 2015年12月24日 08:51, Thomas Chou wrote:

Skip erase if the sector is blank. The sector erase is slow, and
may take 0.7 sec typically or up to 3 sec worst-case.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
  drivers/mtd/altera_qspi.c | 39 +--
  1 file changed, 25 insertions(+), 14 deletions(-)



Applied to u-boot-nios.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/5] altera_qspi: call callback even if the erase failed

2015-12-27 Thread Thomas Chou



On 2015年12月24日 08:51, Thomas Chou wrote:

Erase is an asynchronous operation.  Device drivers are supposed
to call instr->callback() whenever the operation completes, even
if it completes with a failure.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
  drivers/mtd/altera_qspi.c | 1 +
  1 file changed, 1 insertion(+)



Applied to u-boot-nios.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/5] altera_qspi: set fail_addr for erase ops

2015-12-27 Thread Thomas Chou



On 2015年12月24日 08:51, Thomas Chou wrote:

If the erase fails, fail_addr might indicate exactly which block
failed. If fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not
at the device level or was not specific to any particular block.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
  drivers/mtd/altera_qspi.c | 1 +
  1 file changed, 1 insertion(+)



Applied to u-boot-nios.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/5] altera_qspi: allow ctrl-c to abort the erase ops

2015-12-27 Thread Thomas Chou



On 2015年12月24日 08:51, Thomas Chou wrote:

Allow ctrl-c to abort the erase ops.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
  drivers/mtd/altera_qspi.c | 9 +
  1 file changed, 9 insertions(+)



Applied to u-boot-nios.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 4/8] mips: ath79: add serial driver for ar933x SOC

2015-12-27 Thread Thomas Chou

Hi Wills,

Please note the following,

1. add this uart to drivers/serial/Kconfig .

2. add debug uart support. see include/debug_uart.h . also add it to Kconfig

3. cp linux/Documentation/devicetree/bindings/serial/qca,ar9330-uart.txt
  u-boot/doc/device-tree-bindings/serial/

4. to save change to xxx_defconfig, run
   make savedefconfig
   cp defconfig configs/xxx_defconfig

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] altera_qspi: show erase progress

2015-12-25 Thread Thomas Chou

Hi Marek,

On 2015年12月25日 12:08, Marek Vasut wrote:

Well, it is only a putc() which is plain and simple.


Sure, but then I still don't understand why this cannot be in the common code.


Yes, it can be in the common code. Do you have an idea how should it 
look like?


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/4] mips: ath79: add serial driver for ar933x SOC

2015-12-24 Thread Thomas Chou



On 2015年12月25日 14:05, Wills Wang wrote:



On 12/25/2015 10:39 AM, Thomas Chou wrote:

Hi Wills,

Is there any reason that you need to support pre-DM serial driver? It
should be safe to support DM only. You may add debug_uart support
which might be helpful during debug. The ops for DM serial is
different to pre-DM though the name look similar. Please see the
comments below.


I will remove the code about pre-DM serial driver.

I worked on mips before I moved to nios very long ago (20 yr). And
nios2 mostly followed mips.

I understand there is not device tree control for u-boot on mips yet.
But I added it to nios2 recently. It might be worthy if you could add
it to mips. You may find the dts binding on Linux kernel. And please
add dts binding to doc/ and you might copy them from Linux kernel.


I has taken a long time to add base device tree for this patch, but i
can't get the driver serial number if don't specify explicitly "aliases"
section in dts file. but It seems to not need for ARM device.

+


You will need to add "stdout-path=..." property with your serial path to 
the chosen

node, like this,
chosen {
stdout-path = 
};



+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 


Please sort the sequence of header files inclusion.


+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct ar933x_serial_baudrate{
+u32 baudrate;
+u32 scale;
+u32 step;
+};
+
+const struct ar933x_serial_baudrate baudrate_table_40mhz[] = {
+/*  baudrate,   scale,  step */
+{600,   255,503},
+{1200,  249,983},
+{2400,  167,1321},
+{4800,  87, 1384},
+{9600,  45, 1447},
+{14400, 53, 2548},
+{19200, 22, 1447},
+{28800, 26, 2548},
+{38400, 28, 3649},
+{56000, 7,  1468},
+{57600, 34, 6606},
+{115200,28, 10947},
+{128000,6,  2936},
+{153600,18, 9563},
+{230400,16, 12834},
+{25,4,  4096},
+{256000,6,  5872},
+{460800,7,  12079},
+{576000,4,  9437},
+{921600,3,  12079},
+{100,   2,  9830},
+{1152000,   2,  11324},
+{150,   0,  4915},
+{200,   0,  6553},
+ };
+
+const struct ar933x_serial_baudrate baudrate_table_25mhz[] = {
+/*  baudrate,   scale,  step */
+{600,   255,805},
+{1200,  209,1321},
+{2400,  104,1321},
+{4800,  54, 1384},
+{9600,  78, 3976},
+{14400, 98, 7474},
+{19200, 55, 5637},
+{28800, 77, 11777},
+{38400, 36, 7449},
+{56000, 4,  1468},
+{57600, 35, 10871},
+{115200,20, 12683},
+{128000,11, 8053},
+{153600,9,  8053},
+{230400,9,  12079},
+{25,6,  9175},
+{256000,5,  8053},
+{460800,4,  12079},
+{576000,3,  12079},
+{921600,1,  9663},
+{100,   1,  10485},
+{1152000,   1,  12079},
+{150,   0,  7864},
+{200,   0,  10485},
+};


The requirement of u-boot is much simpler than Linux kernel. For the
uart header, you should include only the macros that the driver really
used. Or you can add it to the driver directly without the additional
header file. The same rule applies to the baudrate tables. You need
only some practical rates, not every possible one.


+
+static inline u32 ar933x_read(u32 base, u32 offset)
+{
+return readl(KSEG1ADDR(base + offset));
+}
+
+static inline void ar933x_write(u32 base, u32 offset, u32 val)
+{
+writel(val, KSEG1ADDR(base + offset));
+}
+


For the KSEG1ADDR mapping, which Marek also mentioned, I would suggest
rework map_physmem() in asm/io.h on mips to map K1 kernel space, which
is very similar to ioremap() on Linux kernel. So that you don't need
to map it for every IO.

plat->regs = map_physmem(dev_get_addr(dev),
sizeof(...),
MAP_NOCACHE);


In MIPS,  function "map_physmem" is empty.


Yes. But you may improve it to do the real work. For example, not tested,

#define MAP_NOCACHE 1
#define MAP_WRCOMBINE   0
#define MAP_WRBACK  0
#define MAP_WRTHROUGH   0

static inline void *
map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
{
if (flags)
return (void *)KSEG1ADDR(paddr);
else
return (void *)KSEG0ADDR(paddr);
}



+static int ar933x_serial_init(void)
+{
+u32 val;
+
+/*
+ * Set GPIO10 (UART_SO) as output and enable UART,
+ * BIT(15) in GPIO_FUNCTION_1 register must be written with 1
+ */
+val = ar933x_read(AR71XX_GPIO_BASE, AR71XX_GPIO_REG_OE);
+val |= BIT(10);
+ar933x_write(AR71XX_GPIO_BASE, AR71XX_GPIO_REG_OE, val);
+
+val = ar933x_read(AR71XX_GPIO_BASE, AR71XX_GPIO_REG_FUNC);
+val |= (

Re: [U-Boot] [PATCH 4/5] altera_qspi: show erase progress

2015-12-24 Thread Thomas Chou

Hi Marek,

On 2015年12月24日 13:37, Marek Vasut wrote:

On Thursday, December 24, 2015 at 06:24:45 AM, Thomas Chou wrote:

Hi Marek,

On 2015年12月24日 11:42, Marek Vasut wrote:

On Thursday, December 24, 2015 at 04:26:57 AM, Thomas Chou wrote:

Hi Marek,


Hi Thomas,


On 2015年12月24日 11:02, Marek Vasut wrote:

On Thursday, December 24, 2015 at 03:50:57 AM, Thomas Chou wrote:

Hi Marek,

On 2015年12月24日 09:29, Marek Vasut wrote:

On Thursday, December 24, 2015 at 01:51:23 AM, Thomas Chou wrote:

Show sector erase progress with dot and comma.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---


Shouldn't this go into common code ?


The code to print a dot is minimal. It will cost more if this go into
common code.


But then this driver behaves in a non-standard manner AND noone
benefits from this functionality but this driver.


The sector erase might take very long when there are a lot of sectors to
erase, say 12 min to 50 min for 1024 sectors on the 10m50 board. Without
the display of progress, it will look like the board hangs.


Yeah, that I do understand and I agree this is a good idea :)


The dotting code comes from the old cfi_flash.c. Some other parallel
flash have this, but not spi-flash. It is trivial to add though.


Urm, altera_qspi is CFI, right ? So can we stuff this into common code or
not? Sorry if I am confused and off the mark.


No worries. I think the dotting is best done per driver.


Well why do you think so ?


Well, it is only a putc() which is plain and simple.

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/4] mips: ath79: add serial driver for ar933x SOC

2015-12-24 Thread Thomas Chou

Hi Wills,

Is there any reason that you need to support pre-DM serial driver? It 
should be safe to support DM only. You may add debug_uart support which 
might be helpful during debug. The ops for DM serial is different to 
pre-DM though the name look similar. Please see the comments below.


I worked on mips before I moved to nios very long ago (20 yr). And nios2 
mostly followed mips.


I understand there is not device tree control for u-boot on mips yet. 
But I added it to nios2 recently. It might be worthy if you could add it 
to mips. You may find the dts binding on Linux kernel. And please add 
dts binding to doc/ and you might copy them from Linux kernel.



+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 


Please sort the sequence of header files inclusion.


+
+DECLARE_GLOBAL_DATA_PTR;
+
+struct ar933x_serial_baudrate{
+   u32 baudrate;
+   u32 scale;
+   u32 step;
+};
+
+const struct ar933x_serial_baudrate baudrate_table_40mhz[] = {
+/*  baudrate,   scale,  step */
+   {600,   255,503},
+   {1200,  249,983},
+   {2400,  167,1321},
+   {4800,  87, 1384},
+   {9600,  45, 1447},
+   {14400, 53, 2548},
+   {19200, 22, 1447},
+   {28800, 26, 2548},
+   {38400, 28, 3649},
+   {56000, 7,  1468},
+   {57600, 34, 6606},
+   {115200,28, 10947},
+   {128000,6,  2936},
+   {153600,18, 9563},
+   {230400,16, 12834},
+   {25,4,  4096},
+   {256000,6,  5872},
+   {460800,7,  12079},
+   {576000,4,  9437},
+   {921600,3,  12079},
+   {100,   2,  9830},
+   {1152000,   2,  11324},
+   {150,   0,  4915},
+   {200,   0,  6553},
+ };
+
+const struct ar933x_serial_baudrate baudrate_table_25mhz[] = {
+/*  baudrate,   scale,  step */
+   {600,   255,805},
+   {1200,  209,1321},
+   {2400,  104,1321},
+   {4800,  54, 1384},
+   {9600,  78, 3976},
+   {14400, 98, 7474},
+   {19200, 55, 5637},
+   {28800, 77, 11777},
+   {38400, 36, 7449},
+   {56000, 4,  1468},
+   {57600, 35, 10871},
+   {115200,20, 12683},
+   {128000,11, 8053},
+   {153600,9,  8053},
+   {230400,9,  12079},
+   {25,6,  9175},
+   {256000,5,  8053},
+   {460800,4,  12079},
+   {576000,3,  12079},
+   {921600,1,  9663},
+   {100,   1,  10485},
+   {1152000,   1,  12079},
+   {150,   0,  7864},
+   {200,   0,  10485},
+};


The requirement of u-boot is much simpler than Linux kernel. For the 
uart header, you should include only the macros that the driver really 
used. Or you can add it to the driver directly without the additional 
header file. The same rule applies to the baudrate tables. You need only 
some practical rates, not every possible one.



+
+static inline u32 ar933x_read(u32 base, u32 offset)
+{
+   return readl(KSEG1ADDR(base + offset));
+}
+
+static inline void ar933x_write(u32 base, u32 offset, u32 val)
+{
+   writel(val, KSEG1ADDR(base + offset));
+}
+


For the KSEG1ADDR mapping, which Marek also mentioned, I would suggest 
rework map_physmem() in asm/io.h on mips to map K1 kernel space, which 
is very similar to ioremap() on Linux kernel. So that you don't need to 
map it for every IO.


plat->regs = map_physmem(dev_get_addr(dev),
sizeof(...),
MAP_NOCACHE);


+static int ar933x_serial_init(void)
+{
+   u32 val;
+
+   /*
+* Set GPIO10 (UART_SO) as output and enable UART,
+* BIT(15) in GPIO_FUNCTION_1 register must be written with 1
+*/
+   val = ar933x_read(AR71XX_GPIO_BASE, AR71XX_GPIO_REG_OE);
+   val |= BIT(10);
+   ar933x_write(AR71XX_GPIO_BASE, AR71XX_GPIO_REG_OE, val);
+
+   val = ar933x_read(AR71XX_GPIO_BASE, AR71XX_GPIO_REG_FUNC);
+   val |= (AR933X_GPIO_FUNC_UART_EN | BIT(15));
+   ar933x_write(AR71XX_GPIO_BASE, AR71XX_GPIO_REG_FUNC, val);


These might go to the pinctrl driver or board initialization.


+
+   /*
+* UART controller configuration:
+* - no DMA
+* - no interrupt
+* - DCE mode
+* - no flow control
+* - set RX ready oride
+* - set TX ready oride
+*/
+   val = AR933X_UART_CS_TX_READY_ORIDE | AR933X_UART_CS_RX_READY_ORIDE
+   | (AR933X_UART_CS_IF_MODE_DCE << AR933X_UART_CS_IF_MODE_S);
+   ar933x_write(AR933X_UART_BASE, AR933X_UART_CS_REG, val);
+   return 0;
+}
+
+#ifdef CONFIG_DM_SERIAL
+static int ar933x_serial_setbrg(struct udevice *dev, int baudrate)
+{
+#else
+static void ar933x_serial_setbrg(void)
+{
+   int baudrate = 

Re: [U-Boot] [PATCH v3 2/4] mips: ath79: add serial driver for ar933x SOC

2015-12-24 Thread Thomas Chou

Hi Wills,

There is code to set baud rate in Linux kernel,

drivers/tty/serial/ar933x_uart.c

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] altera_qspi: show erase progress

2015-12-23 Thread Thomas Chou

Hi Marek,

On 2015年12月24日 09:29, Marek Vasut wrote:

On Thursday, December 24, 2015 at 01:51:23 AM, Thomas Chou wrote:

Show sector erase progress with dot and comma.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---


Shouldn't this go into common code ?



The code to print a dot is minimal. It will cost more if this go into 
common code.


Alternatively, we might set the flash_verbose directly and remove the 
flash_set_verbose().


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/5] altera_qspi: call callback even if the erase failed

2015-12-23 Thread Thomas Chou
Erase is an asynchronous operation.  Device drivers are supposed
to call instr->callback() whenever the operation completes, even
if it completes with a failure.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 drivers/mtd/altera_qspi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
index c7e37ad..627a8cc 100644
--- a/drivers/mtd/altera_qspi.c
+++ b/drivers/mtd/altera_qspi.c
@@ -146,6 +146,7 @@ static int altera_qspi_erase(struct mtd_info *mtd, struct 
erase_info *instr)
debug("erase %08x fail %x\n", sect, stat);
writel(stat, >isr); /* clear isr */
instr->state = MTD_ERASE_FAILED;
+   mtd_erase_callback(instr);
return -EIO;
}
addr += mtd->erasesize;
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/5] altera_qspi: skip erase if the sector is blank

2015-12-23 Thread Thomas Chou
Skip erase if the sector is blank. The sector erase is slow, and
may take 0.7 sec typically or up to 3 sec worst-case.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 drivers/mtd/altera_qspi.c | 39 +--
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
index b0d4f2c..8a630a6 100644
--- a/drivers/mtd/altera_qspi.c
+++ b/drivers/mtd/altera_qspi.c
@@ -131,24 +131,35 @@ static int altera_qspi_erase(struct mtd_info *mtd, struct 
erase_info *instr)
size_t end = addr + len;
u32 sect;
u32 stat;
+   u32 *flash, *last;
 
instr->state = MTD_ERASING;
addr &= ~(mtd->erasesize - 1); /* get lower aligned address */
while (addr < end) {
-   sect = addr / mtd->erasesize;
-   sect <<= 8;
-   sect |= QUADSPI_MEM_OP_SECTOR_ERASE;
-   debug("erase %08x\n", sect);
-   writel(sect, >mem_op);
-   stat = readl(>isr);
-   if (stat & QUADSPI_ISR_ILLEGAL_ERASE) {
-   /* erase failed, sector might be protected */
-   debug("erase %08x fail %x\n", sect, stat);
-   writel(stat, >isr); /* clear isr */
-   instr->fail_addr = addr;
-   instr->state = MTD_ERASE_FAILED;
-   mtd_erase_callback(instr);
-   return -EIO;
+   flash = pdata->base + addr;
+   last = pdata->base + addr + mtd->erasesize;
+   /* skip erase if sector is blank */
+   while (flash < last) {
+   if (readl(flash) != 0x)
+   break;
+   flash++;
+   }
+   if (flash < last) {
+   sect = addr / mtd->erasesize;
+   sect <<= 8;
+   sect |= QUADSPI_MEM_OP_SECTOR_ERASE;
+   debug("erase %08x\n", sect);
+   writel(sect, >mem_op);
+   stat = readl(>isr);
+   if (stat & QUADSPI_ISR_ILLEGAL_ERASE) {
+   /* erase failed, sector might be protected */
+   debug("erase %08x fail %x\n", sect, stat);
+   writel(stat, >isr); /* clear isr */
+   instr->fail_addr = addr;
+   instr->state = MTD_ERASE_FAILED;
+   mtd_erase_callback(instr);
+   return -EIO;
+   }
}
addr += mtd->erasesize;
}
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5] altera_qspi: skip erase if the sector is blank

2015-12-23 Thread Thomas Chou

Hi Marek,

On 2015年12月24日 09:28, Marek Vasut wrote:

On Thursday, December 24, 2015 at 01:51:22 AM, Thomas Chou wrote:

Skip erase if the sector is blank. The sector erase is slow, and
may take 0.7 sec typically or up to 3 sec worst-case.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
  drivers/mtd/altera_qspi.c | 39 +--
  1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
index b0d4f2c..8a630a6 100644
--- a/drivers/mtd/altera_qspi.c
+++ b/drivers/mtd/altera_qspi.c
@@ -131,24 +131,35 @@ static int altera_qspi_erase(struct mtd_info *mtd,
struct erase_info *instr) size_t end = addr + len;
u32 sect;
u32 stat;
+   u32 *flash, *last;

instr->state = MTD_ERASING;
addr &= ~(mtd->erasesize - 1); /* get lower aligned address */
while (addr < end) {
-   sect = addr / mtd->erasesize;
-   sect <<= 8;
-   sect |= QUADSPI_MEM_OP_SECTOR_ERASE;
-   debug("erase %08x\n", sect);
-   writel(sect, >mem_op);
-   stat = readl(>isr);
-   if (stat & QUADSPI_ISR_ILLEGAL_ERASE) {
-   /* erase failed, sector might be protected */
-   debug("erase %08x fail %x\n", sect, stat);
-   writel(stat, >isr); /* clear isr */
-   instr->fail_addr = addr;
-   instr->state = MTD_ERASE_FAILED;
-   mtd_erase_callback(instr);
-   return -EIO;
+   flash = pdata->base + addr;
+   last = pdata->base + addr + mtd->erasesize;
+   /* skip erase if sector is blank */
+   while (flash < last) {
+   if (readl(flash) != 0x)
+   break;
+   flash++;


Shouldn't $last be divided by 4 ? $flash is u32 * afterall .


No. Both flash and last are assigned with byte addressing from 
pdata->base, which is void *.


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] sf: call callback even if the mtd erase failed

2015-12-23 Thread Thomas Chou
Erase is an asynchronous operation.  Device drivers are supposed
to call instr->callback() whenever the operation completes, even
if it completes with a failure.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 drivers/mtd/spi/sf_mtd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/spi/sf_mtd.c b/drivers/mtd/spi/sf_mtd.c
index 0b9cb62..6140a35 100644
--- a/drivers/mtd/spi/sf_mtd.c
+++ b/drivers/mtd/spi/sf_mtd.c
@@ -24,6 +24,7 @@ static int spi_flash_mtd_erase(struct mtd_info *mtd, struct 
erase_info *instr)
if (err) {
instr->state = MTD_ERASE_FAILED;
instr->fail_addr = MTD_FAIL_ADDR_UNKNOWN;
+   mtd_erase_callback(instr);
return -EIO;
}
 
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5] altera_qspi: skip erase if the sector is blank

2015-12-23 Thread Thomas Chou

Hi Marek,

On 2015年12月24日 11:01, Marek Vasut wrote:

On Thursday, December 24, 2015 at 03:23:05 AM, Thomas Chou wrote:

Hi Marek,

On 2015年12月24日 09:28, Marek Vasut wrote:

On Thursday, December 24, 2015 at 01:51:22 AM, Thomas Chou wrote:

Skip erase if the sector is blank. The sector erase is slow, and
may take 0.7 sec typically or up to 3 sec worst-case.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---

   drivers/mtd/altera_qspi.c | 39 +--
   1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
index b0d4f2c..8a630a6 100644
--- a/drivers/mtd/altera_qspi.c
+++ b/drivers/mtd/altera_qspi.c
@@ -131,24 +131,35 @@ static int altera_qspi_erase(struct mtd_info *mtd,
struct erase_info *instr) size_t end = addr + len;

u32 sect;
u32 stat;

+   u32 *flash, *last;

instr->state = MTD_ERASING;
addr &= ~(mtd->erasesize - 1); /* get lower aligned address */
while (addr < end) {

-   sect = addr / mtd->erasesize;
-   sect <<= 8;
-   sect |= QUADSPI_MEM_OP_SECTOR_ERASE;
-   debug("erase %08x\n", sect);
-   writel(sect, >mem_op);
-   stat = readl(>isr);
-   if (stat & QUADSPI_ISR_ILLEGAL_ERASE) {
-   /* erase failed, sector might be protected */
-   debug("erase %08x fail %x\n", sect, stat);
-   writel(stat, >isr); /* clear isr */
-   instr->fail_addr = addr;
-   instr->state = MTD_ERASE_FAILED;
-   mtd_erase_callback(instr);
-   return -EIO;
+   flash = pdata->base + addr;
+   last = pdata->base + addr + mtd->erasesize;
+   /* skip erase if sector is blank */
+   while (flash < last) {
+   if (readl(flash) != 0x)
+   break;
+   flash++;


Shouldn't $last be divided by 4 ? $flash is u32 * afterall .


No. Both flash and last are assigned with byte addressing from
pdata->base, which is void *.


The data type of both $flash and $last is u32 * though?


Yes.

flash = pdata->base + addr;

will be the same as,

flash = pdata->base;
flash += addr / 4;

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 4/5] altera_qspi: show erase progress

2015-12-23 Thread Thomas Chou
Show sector erase progress with dot and comma.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 drivers/mtd/altera_qspi.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
index 8a630a6..0624ff4 100644
--- a/drivers/mtd/altera_qspi.c
+++ b/drivers/mtd/altera_qspi.c
@@ -52,6 +52,7 @@ struct altera_qspi_platdata {
unsigned long size;
 };
 
+static uint flash_verbose;
 flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];   /* FLASH chips info */
 
 static void altera_qspi_get_locked_range(struct mtd_info *mtd, loff_t *ofs,
@@ -74,6 +75,11 @@ void flash_print_info(flash_info_t *info)
putc('\n');
 }
 
+void flash_set_verbose(uint v)
+{
+   flash_verbose = v;
+}
+
 int flash_erase(flash_info_t *info, int s_first, int s_last)
 {
struct mtd_info *mtd = info->mtd;
@@ -84,10 +90,13 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
instr.mtd = mtd;
instr.addr = mtd->erasesize * s_first;
instr.len = mtd->erasesize * (s_last + 1 - s_first);
+   flash_set_verbose(1);
ret = mtd_erase(mtd, );
+   flash_set_verbose(0);
if (ret)
return ERR_PROTECTED;
 
+   puts(" done\n");
return 0;
 }
 
@@ -160,6 +169,11 @@ static int altera_qspi_erase(struct mtd_info *mtd, struct 
erase_info *instr)
mtd_erase_callback(instr);
return -EIO;
}
+   if (flash_verbose)
+   putc('.');
+   } else {
+   if (flash_verbose)
+   putc(',');
}
addr += mtd->erasesize;
}
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 5/5] altera_qspi: allow ctrl-c to abort the erase ops

2015-12-23 Thread Thomas Chou
Allow ctrl-c to abort the erase ops.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 drivers/mtd/altera_qspi.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
index 0624ff4..a9148a7 100644
--- a/drivers/mtd/altera_qspi.c
+++ b/drivers/mtd/altera_qspi.c
@@ -5,6 +5,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -145,6 +146,14 @@ static int altera_qspi_erase(struct mtd_info *mtd, struct 
erase_info *instr)
instr->state = MTD_ERASING;
addr &= ~(mtd->erasesize - 1); /* get lower aligned address */
while (addr < end) {
+   if (ctrlc()) {
+   if (flash_verbose)
+   putc('\n');
+   instr->fail_addr = MTD_FAIL_ADDR_UNKNOWN;
+   instr->state = MTD_ERASE_FAILED;
+   mtd_erase_callback(instr);
+   return -EIO;
+   }
flash = pdata->base + addr;
last = pdata->base + addr + mtd->erasesize;
/* skip erase if sector is blank */
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/5] altera_qspi: set fail_addr for erase ops

2015-12-23 Thread Thomas Chou
If the erase fails, fail_addr might indicate exactly which block
failed. If fail_addr = MTD_FAIL_ADDR_UNKNOWN, the failure was not
at the device level or was not specific to any particular block.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 drivers/mtd/altera_qspi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
index 627a8cc..b0d4f2c 100644
--- a/drivers/mtd/altera_qspi.c
+++ b/drivers/mtd/altera_qspi.c
@@ -145,6 +145,7 @@ static int altera_qspi_erase(struct mtd_info *mtd, struct 
erase_info *instr)
/* erase failed, sector might be protected */
debug("erase %08x fail %x\n", sect, stat);
writel(stat, >isr); /* clear isr */
+   instr->fail_addr = addr;
instr->state = MTD_ERASE_FAILED;
mtd_erase_callback(instr);
return -EIO;
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] altera_qspi: show erase progress

2015-12-23 Thread Thomas Chou

Hi Marek,

On 2015年12月24日 11:02, Marek Vasut wrote:

On Thursday, December 24, 2015 at 03:50:57 AM, Thomas Chou wrote:

Hi Marek,

On 2015年12月24日 09:29, Marek Vasut wrote:

On Thursday, December 24, 2015 at 01:51:23 AM, Thomas Chou wrote:

Show sector erase progress with dot and comma.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---


Shouldn't this go into common code ?


The code to print a dot is minimal. It will cost more if this go into
common code.


But then this driver behaves in a non-standard manner AND noone benefits
from this functionality but this driver.


The sector erase might take very long when there are a lot of sectors to 
erase, say 12 min to 50 min for 1024 sectors on the 10m50 board. Without 
the display of progress, it will look like the board hangs.


The dotting code comes from the old cfi_flash.c. Some other parallel 
flash have this, but not spi-flash. It is trivial to add though.


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] altera_qspi: show erase progress

2015-12-23 Thread Thomas Chou

Hi Marek,

On 2015年12月24日 11:42, Marek Vasut wrote:

On Thursday, December 24, 2015 at 04:26:57 AM, Thomas Chou wrote:

Hi Marek,


Hi Thomas,


On 2015年12月24日 11:02, Marek Vasut wrote:

On Thursday, December 24, 2015 at 03:50:57 AM, Thomas Chou wrote:

Hi Marek,

On 2015年12月24日 09:29, Marek Vasut wrote:

On Thursday, December 24, 2015 at 01:51:23 AM, Thomas Chou wrote:

Show sector erase progress with dot and comma.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---


Shouldn't this go into common code ?


The code to print a dot is minimal. It will cost more if this go into
common code.


But then this driver behaves in a non-standard manner AND noone benefits
from this functionality but this driver.


The sector erase might take very long when there are a lot of sectors to
erase, say 12 min to 50 min for 1024 sectors on the 10m50 board. Without
the display of progress, it will look like the board hangs.


Yeah, that I do understand and I agree this is a good idea :)


The dotting code comes from the old cfi_flash.c. Some other parallel
flash have this, but not spi-flash. It is trivial to add though.


Urm, altera_qspi is CFI, right ? So can we stuff this into common code or not?
Sorry if I am confused and off the mark.


No worries. I think the dotting is best done per driver. We can have 
common behavior. But there is little advantage to make it common code.


Merry Xmas.

Thomas Chou
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/4] mips: ath79: add serial driver for ar933x SOC

2015-12-22 Thread Thomas Chou

Hi Wills,

On 2015年12月22日 15:44, Wills Wang wrote:

Signed-off-by: Wills Wang 
---

  drivers/serial/Makefile|   1 +
  drivers/serial/serial_ar933x.c | 337 +
  2 files changed, 338 insertions(+)
  create mode 100644 drivers/serial/serial_ar933x.c



Please convert the serial driver to driver model. Please check 
u-boot/doc/driver-model/serial-howto.txt.


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] net: eth_designware: select PHYLIB in Kconfig

2015-12-19 Thread Thomas Chou

Hi Marek,

On 2015年12月19日 13:47, Marek Vasut wrote:

On Saturday, December 19, 2015 at 04:56:38 AM, Thomas Chou wrote:

Hi Marek,

On 2015年12月07日 20:53, Thomas Chou wrote:

Select PHYLIB in drivers/net/Kconfig. And remove CONFIG_PHYLIB
from legacy board header files.

This fixed the warnings when both ALTERA_TSE and ETH_DESIGNWARE
are selected.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Reported-by: Pavel Machek <pa...@denx.de>
Acked-by: Chin Liang See <cl...@altera.com>
Acked-by: Pavel Machek <pa...@denx.de>
Tested-by: Pavel Machek <pa...@denx.de>
Reviewed-by: Bin Meng <bmeng...@gmail.com>
---
v2

remove the PHYLIB check as suggested by Marek.

   drivers/net/Kconfig  | 1 +
   drivers/net/designware.c | 4 
   include/configs/axs101.h | 1 -
   include/configs/bf609-ezkit.h| 1 -
   include/configs/galileo.h| 1 -
   include/configs/socfpga_common.h | 1 -
   include/configs/spear-common.h   | 1 -
   include/configs/stv0991.h| 1 -
   include/configs/sunxi-common.h   | 1 -
   include/configs/tb100.h  | 1 -
   include/configs/x600.h   | 1 -
   11 files changed, 1 insertion(+), 13 deletions(-)


Would you please pick this one? I didn't notice that it was delegated to
me before I sent a PR for nios. Thanks.


You mean via socfpga ?


Yes, please. It was reported on socfpga.

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] serial: uartlite: Move driver to DM

2015-12-18 Thread Thomas Chou

Hi Michal,

On 2015年12月18日 15:52, Michal Simek wrote:

On 18.12.2015 00:35, Thomas Chou wrote:

Hi Michal,

On 2015年12月17日 21:58, Michal Simek wrote:

On 17.12.2015 14:37, Thomas Chou wrote:

Hi Michal,

On 2015年12月17日 20:00, Michal Simek wrote:

Enable SPL DM too.

Signed-off-by: Michal Simek <michal.si...@xilinx.com>
---

Changes in v2:
- Remove unneeded headers
- Use get_dev_addr instead of fdtdec_get_addr
- Use platdata instead of private data
- Add opb compatible string to be in sync with Linux
- Add binding documentation

arch/microblaze/Kconfig|   1 +
configs/microblaze-generic_defconfig   |   2 +
.../serial/xilinx_uartlite.txt |  13 ++
doc/driver-model/serial-howto.txt  |   1 -
drivers/serial/serial_xuartlite.c  | 170
-
5 files changed, 78 insertions(+), 109 deletions(-)
create mode 100644
doc/device-tree-bindings/serial/xilinx_uartlite.txt

diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 604f6815af5b..30ea484f48aa 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -13,6 +13,7 @@ config TARGET_MICROBLAZE_GENERIC
select SUPPORT_SPL
select OF_CONTROL
select DM
+select DM_SERIAL

endchoice

diff --git a/configs/microblaze-generic_defconfig
b/configs/microblaze-generic_defconfig
index 54aa3ef3d26f..5df080b6a87c 100644
--- a/configs/microblaze-generic_defconfig
+++ b/configs/microblaze-generic_defconfig
@@ -1,9 +1,11 @@
CONFIG_MICROBLAZE=y
CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_DM=y
CONFIG_TARGET_MICROBLAZE_GENERIC=y
CONFIG_DEFAULT_DEVICE_TREE="microblaze-generic"
CONFIG_SPL=y
CONFIG_SYS_PROMPT="U-Boot-mONStR> "
CONFIG_CMD_GPIO=y
# CONFIG_CMD_SETEXPR is not set
+CONFIG_SPL_OF_CONTROL=y
CONFIG_OF_EMBED=y
diff --git a/doc/device-tree-bindings/serial/xilinx_uartlite.txt
b/doc/device-tree-bindings/serial/xilinx_uartlite.txt
new file mode 100644
index ..d15753c8c380
--- /dev/null
+++ b/doc/device-tree-bindings/serial/xilinx_uartlite.txt
@@ -0,0 +1,13 @@
+Binding for Xilinx Uartlite Controller
+
+Required properties:
+- compatible : should be "xlnx,xps-uartlite-1.00.a", or
"xlnx,opb-uartlite-1.00.b"
+- reg: Should contain UART controller registers location and length.
+- interrupts: Should contain UART controller interrupts.
+
+Example:
+serial@4060 {
+compatible = "xlnx,xps-uartlite-1.00.a";
+interrupts = <1 0>;
+reg = <0x4060 0x1>;
+};
diff --git a/doc/driver-model/serial-howto.txt
b/doc/driver-model/serial-howto.txt
index 76ad629ef9cb..381a2a084562 100644
--- a/doc/driver-model/serial-howto.txt
+++ b/doc/driver-model/serial-howto.txt
@@ -18,7 +18,6 @@ is time for maintainers to start converting over the
remaining serial drivers:
   serial_pxa.c
   serial_s3c24x0.c
   serial_sa1100.c
-   serial_xuartlite.c
   usbtty.c

You should complete this by the end of January 2016.
diff --git a/drivers/serial/serial_xuartlite.c
b/drivers/serial/serial_xuartlite.c
index 988438e75471..8225d9a320a5 100644
--- a/drivers/serial/serial_xuartlite.c
+++ b/drivers/serial/serial_xuartlite.c
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 2008-2011 Michal Simek <mon...@monstr.eu>
+ * (C) Copyright 2008 - 2015 Michal Simek <mon...@monstr.eu>
 * Clean driver and add xilinx constant from header file
 *
 * (C) Copyright 2004 Atmark Techno, Inc.
@@ -10,11 +10,15 @@

#include 
#include 
+#include 
#include 
#include 
#include 

+DECLARE_GLOBAL_DATA_PTR;
+
#define SR_TX_FIFO_FULL0x08 /* transmit FIFO full */
+#define SR_TX_FIFO_EMPTY0x04 /* transmit FIFO empty */
#define SR_RX_FIFO_VALID_DATA0x01 /* data in receive FIFO */
#define SR_RX_FIFO_FULL0x02 /* receive FIFO full */

@@ -28,135 +32,85 @@ struct uartlite {
unsigned int control;
};

-static struct uartlite *userial_ports[4] = {
-#ifdef XILINX_UARTLITE_BASEADDR
-[0] = (struct uartlite *)XILINX_UARTLITE_BASEADDR,
-#endif
-#ifdef XILINX_UARTLITE_BASEADDR1
-[1] = (struct uartlite *)XILINX_UARTLITE_BASEADDR1,
-#endif
-#ifdef XILINX_UARTLITE_BASEADDR2
-[2] = (struct uartlite *)XILINX_UARTLITE_BASEADDR2,
-#endif
-#ifdef XILINX_UARTLITE_BASEADDR3
-[3] = (struct uartlite *)XILINX_UARTLITE_BASEADDR3
-#endif
+struct uartlite_platdata {
+struct uartlite *regs;
};

-static void uartlite_serial_putc(const char c, const int port)
+static int uartlite_serial_putc(struct udevice *dev, const char ch)
{
-struct uartlite *regs = userial_ports[port];
+struct uartlite_platdata *plat = dev_get_platdata(dev);
+struct uartlite *regs = plat->regs;

-if (c == '\n')
-uartlite_serial_putc('\r', port);
+if (in_be32(>status) & SR_TX_FIFO_FULL)
+return -EAGAIN;

[U-Boot] [PATCH] altera_qspi: initialize instr.mtd in flash_erase

2015-12-18 Thread Thomas Chou
Initialize instr.mtd in flash_erase(). This fixes the system
hang issue when CONFIG_MTD_PARTITIONS is selected.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 drivers/mtd/altera_qspi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
index 617bf5d..c7e37ad 100644
--- a/drivers/mtd/altera_qspi.c
+++ b/drivers/mtd/altera_qspi.c
@@ -81,6 +81,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
int ret;
 
memset(, 0, sizeof(instr));
+   instr.mtd = mtd;
instr.addr = mtd->erasesize * s_first;
instr.len = mtd->erasesize * (s_last + 1 - s_first);
ret = mtd_erase(mtd, );
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PULL] Please pull u-boot-nios/master

2015-12-18 Thread Thomas Chou
The following changes since commit 4832e17787acb29734d895751bc7a594908aecc6:

  Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze (2015-12-18 
07:28:24 -0500)

are available in the git repository at:

  git://git.denx.de/u-boot-nios.git master

for you to fetch changes up to 1c0e84ca829a09948a61107744402296566aa076:

  altera_qspi: initialize instr.mtd in flash_erase (2015-12-19 09:51:19 +0800)


Marek Vasut (5):
  nios2: Calculate the env position from monitor size
  nios2: Up the monitor size to 512kiB
  nios2: Preconfigure $loadaddr variable
  nios2: Enable support for fitImage
  nios2: Soup up the shell experience

Thomas Chou (3):
  nios2: display altera sysid at startup
  serial-howto: remove altera_jtag_uart and altera_uart from the list
  altera_qspi: initialize instr.mtd in flash_erase

 arch/nios2/cpu/cpu.c  |  8 
 configs/10m50_defconfig   |  1 +
 configs/3c120_defconfig   |  1 +
 doc/driver-model/serial-howto.txt |  2 --
 drivers/mtd/altera_qspi.c |  1 +
 include/configs/10m50_devboard.h  | 33 ++---
 include/configs/3c120_devboard.h  | 33 ++---
 7 files changed, 47 insertions(+), 32 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] net: eth_designware: select PHYLIB in Kconfig

2015-12-18 Thread Thomas Chou

Hi Marek,

On 2015年12月07日 20:53, Thomas Chou wrote:

Select PHYLIB in drivers/net/Kconfig. And remove CONFIG_PHYLIB
from legacy board header files.

This fixed the warnings when both ALTERA_TSE and ETH_DESIGNWARE
are selected.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
Reported-by: Pavel Machek <pa...@denx.de>
Acked-by: Chin Liang See <cl...@altera.com>
Acked-by: Pavel Machek <pa...@denx.de>
Tested-by: Pavel Machek <pa...@denx.de>
Reviewed-by: Bin Meng <bmeng...@gmail.com>
---
v2
   remove the PHYLIB check as suggested by Marek.

  drivers/net/Kconfig  | 1 +
  drivers/net/designware.c | 4 
  include/configs/axs101.h | 1 -
  include/configs/bf609-ezkit.h| 1 -
  include/configs/galileo.h| 1 -
  include/configs/socfpga_common.h | 1 -
  include/configs/spear-common.h   | 1 -
  include/configs/stv0991.h| 1 -
  include/configs/sunxi-common.h   | 1 -
  include/configs/tb100.h  | 1 -
  include/configs/x600.h   | 1 -
  11 files changed, 1 insertion(+), 13 deletions(-)



Would you please pick this one? I didn't notice that it was delegated to 
me before I sent a PR for nios. Thanks.


Best regards,
Thomas


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] serial: uartlite: Move driver to DM

2015-12-17 Thread Thomas Chou
gt;tx_fifo, ch & 0xff);

-static void uartlite_serial_puts(const char *s, const int port)
-{
-   while (*s)
-   uartlite_serial_putc(*s++, port);
+   return 0;
  }

-static int uartlite_serial_getc(const int port)
+static int uartlite_serial_getc(struct udevice *dev)
  {
-   struct uartlite *regs = userial_ports[port];
+   struct uartlite_platdata *plat = dev_get_platdata(dev);
+   struct uartlite *regs = plat->regs;
+
+   if (!(in_be32(>status) & SR_RX_FIFO_VALID_DATA))
+   return -EAGAIN;

-   while (!(in_be32(>status) & SR_RX_FIFO_VALID_DATA))
-   ;
return in_be32(>rx_fifo) & 0xff;
  }

-static int uartlite_serial_tstc(const int port)
+static int uartlite_serial_pending(struct udevice *dev, bool input)
  {
-   struct uartlite *regs = userial_ports[port];
+   struct uartlite_platdata *plat = dev_get_platdata(dev);
+   struct uartlite *regs = plat->regs;

-   return in_be32(>status) & SR_RX_FIFO_VALID_DATA;
+   if (input)
+   return in_be32(>status) & SR_RX_FIFO_VALID_DATA;
+
+   return in_be32(>status) & SR_TX_FIFO_EMPTY;


Should be inversed.

Otherwise,
Reviewed-by: Thomas Chou <tho...@wytron.com.tw>


  }

-static int uartlite_serial_init(const int port)
+static int uartlite_serial_probe(struct udevice *dev)
  {
-   struct uartlite *regs = userial_ports[port];
-
-   if (regs) {
-   out_be32(>control, 0);
-   out_be32(>control,
-ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX);
-   in_be32(>control);
-   return 0;
-   }
+   struct uartlite_platdata *plat = dev_get_platdata(dev);
+   struct uartlite *regs = plat->regs;

-   return -1;
-}
+   out_be32(>control, 0);
+   out_be32(>control, ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX);
+   in_be32(>control);

-/* Multi serial device functions */
-#define DECLARE_ESERIAL_FUNCTIONS(port) \
-   static int userial##port##_init(void) \
-   { return uartlite_serial_init(port); } \
-   static void userial##port##_setbrg(void) {} \
-   static int userial##port##_getc(void) \
-   { return uartlite_serial_getc(port); } \
-   static int userial##port##_tstc(void) \
-   { return uartlite_serial_tstc(port); } \
-   static void userial##port##_putc(const char c) \
-   { uartlite_serial_putc(c, port); } \
-   static void userial##port##_puts(const char *s) \
-   { uartlite_serial_puts(s, port); }
-
-/* Serial device descriptor */
-#define INIT_ESERIAL_STRUCTURE(port, __name) { \
-   .name   = __name,   \
-   .start  = userial##port##_init, \
-   .stop   = NULL, \
-   .setbrg = userial##port##_setbrg,   \
-   .getc   = userial##port##_getc, \
-   .tstc   = userial##port##_tstc, \
-   .putc   = userial##port##_putc, \
-   .puts   = userial##port##_puts, \
+   return 0;
  }

-DECLARE_ESERIAL_FUNCTIONS(0);
-struct serial_device uartlite_serial0_device =
-   INIT_ESERIAL_STRUCTURE(0, "ttyUL0");
-DECLARE_ESERIAL_FUNCTIONS(1);
-struct serial_device uartlite_serial1_device =
-   INIT_ESERIAL_STRUCTURE(1, "ttyUL1");
-DECLARE_ESERIAL_FUNCTIONS(2);
-struct serial_device uartlite_serial2_device =
-   INIT_ESERIAL_STRUCTURE(2, "ttyUL2");
-DECLARE_ESERIAL_FUNCTIONS(3);
-struct serial_device uartlite_serial3_device =
-   INIT_ESERIAL_STRUCTURE(3, "ttyUL3");
-
-__weak struct serial_device *default_serial_console(void)
+static int uartlite_serial_ofdata_to_platdata(struct udevice *dev)
  {
-   if (userial_ports[0])
-   return _serial0_device;
-   if (userial_ports[1])
-   return _serial1_device;
-   if (userial_ports[2])
-   return _serial2_device;
-   if (userial_ports[3])
-   return _serial3_device;
-
-   return NULL;
-}
+   struct uartlite_platdata *plat = dev_get_platdata(dev);

-void uartlite_serial_initialize(void)
-{
-#ifdef XILINX_UARTLITE_BASEADDR
-   serial_register(_serial0_device);
-#endif /* XILINX_UARTLITE_BASEADDR */
-#ifdef XILINX_UARTLITE_BASEADDR1
-   serial_register(_serial1_device);
-#endif /* XILINX_UARTLITE_BASEADDR1 */
-#ifdef XILINX_UARTLITE_BASEADDR2
-   serial_register(_serial2_device);
-#endif /* XILINX_UARTLITE_BASEADDR2 */
-#ifdef XILINX_UARTLITE_BASEADDR3
-   serial_register(_serial3_device);
-#endif /* XILINX_UARTLITE_BASEADDR3 */
+   plat->regs = (struct uartlite *)dev_get_addr(dev);
+
+   return 0;
  }
+
+static const struct dm_serial_ops uartlite_serial_ops = {
+   .putc = uartlite_serial_putc,
+   .pending = uartlite_serial_pending,
+   .ge

[U-Boot] [PATCH] serial-howto: remove altera_jtag_uart and altera_uart from the list

2015-12-17 Thread Thomas Chou
Since both altera_jtag_uart and altera_uart are converted to driver
model, remove them from the list of drivers remaining to convert.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 doc/driver-model/serial-howto.txt | 2 --
 1 file changed, 2 deletions(-)

diff --git a/doc/driver-model/serial-howto.txt 
b/doc/driver-model/serial-howto.txt
index 76ad629..4706d56 100644
--- a/doc/driver-model/serial-howto.txt
+++ b/doc/driver-model/serial-howto.txt
@@ -4,8 +4,6 @@ How to port a serial driver to driver model
 About 16 of 33 serial drivers have been converted as at September 2015. It
 is time for maintainers to start converting over the remaining serial drivers:
 
-   altera_jtag_uart.c
-   altera_uart.c
arm_dcc.c
lpc32xx_hsuart.c
mcfuart.c
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/3] serial: uartlite: Add support for debug console

2015-12-17 Thread Thomas Chou

Hi Michal,

On 2015年12月17日 20:00, Michal Simek wrote:

Add support for debug console.

Signed-off-by: Michal Simek <michal.si...@xilinx.com>
---

Changes in v2:
- Add needed header from the first patch
- Remove WATCHDOG_RESET call
- Extend commit description

  drivers/serial/Kconfig|  7 +++
  drivers/serial/serial_xuartlite.c | 26 ++
  2 files changed, 33 insertions(+)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 1fc287ee98ec..f1e221799b81 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -92,6 +92,13 @@ config DEBUG_UART_S5P
  will need to provide parameters to make this work. The driver will
  be available until the real driver-model serial is running.

+config DEBUG_UART_UARTLITE
+   bool "Xilinx Uartlite"
+   help
+ Select this to enable a debug UART using the serial_uartlite driver.
+ You will need to provide parameters to make this work. The driver will
+ be available until the real driver-model serial is running.
+
  config DEBUG_UART_ZYNQ
bool "Xilinx Zynq"
help
diff --git a/drivers/serial/serial_xuartlite.c 
b/drivers/serial/serial_xuartlite.c
index 8225d9a320a5..f42b11eae102 100644
--- a/drivers/serial/serial_xuartlite.c
+++ b/drivers/serial/serial_xuartlite.c
@@ -114,3 +114,29 @@ U_BOOT_DRIVER(serial_uartlite) = {
.ops= _serial_ops,
.flags = DM_FLAG_PRE_RELOC,
  };
+
+#ifdef CONFIG_DEBUG_UART_UARTLITE
+
+#include 
+
+void _debug_uart_init(void)


Still missing, static inline

Otherwise,
Reviewed-by: Thomas Chou <tho...@wytron.com.tw>


+{
+   struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;
+
+   out_be32(>control, 0);
+   out_be32(>control, ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX);
+   in_be32(>control);
+}
+
+static inline void _debug_uart_putc(int ch)
+{
+   struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;
+
+   while (in_be32(>status) & SR_TX_FIFO_FULL)
+   ;
+
+   out_be32(>tx_fifo, ch & 0xff);
+}
+
+DEBUG_UART_FUNCS
+#endif



Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/3] serial: uartlite: Add uartlite to Kconfig

2015-12-17 Thread Thomas Chou

Hi Michal,

On 2015年12月17日 20:00, Michal Simek wrote:

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.si...@xilinx.com>
---

Changes in v2: None

  board/xilinx/microblaze-generic/xparameters.h | 4 
  configs/microblaze-generic_defconfig  | 1 +
  drivers/serial/Kconfig| 7 +++
  include/configs/microblaze-generic.h  | 7 +--
  4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/board/xilinx/microblaze-generic/xparameters.h 
b/board/xilinx/microblaze-generic/xparameters.h
index 8ba146cb88db..11b3c9a4846e 100644
--- a/board/xilinx/microblaze-generic/xparameters.h
+++ b/board/xilinx/microblaze-generic/xparameters.h
@@ -28,10 +28,6 @@
  #define XILINX_TIMER_BASEADDR 0x41c0
  #define XILINX_TIMER_IRQ  0

-/* Uart pheriphery is RS232_Uart */
-#define XILINX_UARTLITE_BASEADDR   0x4060
-#define XILINX_UARTLITE_BAUDRATE   115200
-
  /* IIC pheriphery is IIC_EEPROM */
  #define XILINX_IIC_0_BASEADDR 0x4080
  #define XILINX_IIC_0_FREQ 10
diff --git a/configs/microblaze-generic_defconfig 
b/configs/microblaze-generic_defconfig
index 5df080b6a87c..9a7bb915466f 100644
--- a/configs/microblaze-generic_defconfig
+++ b/configs/microblaze-generic_defconfig
@@ -9,3 +9,4 @@ CONFIG_CMD_GPIO=y
  # CONFIG_CMD_SETEXPR is not set
  CONFIG_SPL_OF_CONTROL=y
  CONFIG_OF_EMBED=y
+CONFIG_XILINX_UARTLITE=y
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index f1e221799b81..ddf49ba9cef3 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -230,4 +230,11 @@ config UNIPHIER_SERIAL
  If you have a UniPhier based board and want to use the on-chip
  serial ports, say Y to this option. If unsure, say N.

+config XILINX_UARTLITE
+   bool "Xilinx Uarlite support"
+   depends on DM_SERIAL && (MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP)
+   help
+ If you have a Xilinx based board and want to use the uartlite
+ serial ports, say Y to this option. If unsure, say N.
+
  endmenu
diff --git a/include/configs/microblaze-generic.h 
b/include/configs/microblaze-generic.h
index 10ac8328b8ff..6e3c80b14350 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -37,10 +37,7 @@
  # define CONFIG_SYS_BAUDRATE_TABLE \
{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400}

-#ifdef XILINX_UARTLITE_BASEADDR
-# define CONFIG_XILINX_UARTLITE
-# define CONFIG_SERIAL_BASEXILINX_UARTLITE_BASEADDR
-#elif XILINX_UART16550_BASEADDR
+#if XILINX_UART16550_BASEADDR
  # define CONFIG_SYS_NS16550_SERIAL
  # if defined(__MICROBLAZEEL__)
  #  define CONFIG_SYS_NS16550_REG_SIZE -4
@@ -51,8 +48,6 @@
  # define CONFIG_SYS_NS16550_COM1 \
((XILINX_UART16550_BASEADDR & ~0xF) + 0x1000)
  # define CONFIG_SYS_NS16550_CLK   XILINX_UART16550_CLOCK_HZ
-#else
-# error Undefined uart
  #endif

  /* setting reset address */



Reviewed-by: Thomas Chou <tho...@wytron.com.tw>

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] serial: uartlite: Move driver to DM

2015-12-17 Thread Thomas Chou

Hi Michal,

On 2015年12月17日 21:58, Michal Simek wrote:

On 17.12.2015 14:37, Thomas Chou wrote:

Hi Michal,

On 2015年12月17日 20:00, Michal Simek wrote:

Enable SPL DM too.

Signed-off-by: Michal Simek <michal.si...@xilinx.com>
---

Changes in v2:
- Remove unneeded headers
- Use get_dev_addr instead of fdtdec_get_addr
- Use platdata instead of private data
- Add opb compatible string to be in sync with Linux
- Add binding documentation

   arch/microblaze/Kconfig|   1 +
   configs/microblaze-generic_defconfig   |   2 +
   .../serial/xilinx_uartlite.txt |  13 ++
   doc/driver-model/serial-howto.txt  |   1 -
   drivers/serial/serial_xuartlite.c  | 170
-
   5 files changed, 78 insertions(+), 109 deletions(-)
   create mode 100644 doc/device-tree-bindings/serial/xilinx_uartlite.txt

diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig
index 604f6815af5b..30ea484f48aa 100644
--- a/arch/microblaze/Kconfig
+++ b/arch/microblaze/Kconfig
@@ -13,6 +13,7 @@ config TARGET_MICROBLAZE_GENERIC
   select SUPPORT_SPL
   select OF_CONTROL
   select DM
+select DM_SERIAL

   endchoice

diff --git a/configs/microblaze-generic_defconfig
b/configs/microblaze-generic_defconfig
index 54aa3ef3d26f..5df080b6a87c 100644
--- a/configs/microblaze-generic_defconfig
+++ b/configs/microblaze-generic_defconfig
@@ -1,9 +1,11 @@
   CONFIG_MICROBLAZE=y
   CONFIG_SPL_SYS_MALLOC_SIMPLE=y
+CONFIG_SPL_DM=y
   CONFIG_TARGET_MICROBLAZE_GENERIC=y
   CONFIG_DEFAULT_DEVICE_TREE="microblaze-generic"
   CONFIG_SPL=y
   CONFIG_SYS_PROMPT="U-Boot-mONStR> "
   CONFIG_CMD_GPIO=y
   # CONFIG_CMD_SETEXPR is not set
+CONFIG_SPL_OF_CONTROL=y
   CONFIG_OF_EMBED=y
diff --git a/doc/device-tree-bindings/serial/xilinx_uartlite.txt
b/doc/device-tree-bindings/serial/xilinx_uartlite.txt
new file mode 100644
index ..d15753c8c380
--- /dev/null
+++ b/doc/device-tree-bindings/serial/xilinx_uartlite.txt
@@ -0,0 +1,13 @@
+Binding for Xilinx Uartlite Controller
+
+Required properties:
+- compatible : should be "xlnx,xps-uartlite-1.00.a", or
"xlnx,opb-uartlite-1.00.b"
+- reg: Should contain UART controller registers location and length.
+- interrupts: Should contain UART controller interrupts.
+
+Example:
+serial@4060 {
+compatible = "xlnx,xps-uartlite-1.00.a";
+interrupts = <1 0>;
+reg = <0x4060 0x1>;
+};
diff --git a/doc/driver-model/serial-howto.txt
b/doc/driver-model/serial-howto.txt
index 76ad629ef9cb..381a2a084562 100644
--- a/doc/driver-model/serial-howto.txt
+++ b/doc/driver-model/serial-howto.txt
@@ -18,7 +18,6 @@ is time for maintainers to start converting over the
remaining serial drivers:
  serial_pxa.c
  serial_s3c24x0.c
  serial_sa1100.c
-   serial_xuartlite.c
  usbtty.c

   You should complete this by the end of January 2016.
diff --git a/drivers/serial/serial_xuartlite.c
b/drivers/serial/serial_xuartlite.c
index 988438e75471..8225d9a320a5 100644
--- a/drivers/serial/serial_xuartlite.c
+++ b/drivers/serial/serial_xuartlite.c
@@ -1,5 +1,5 @@
   /*
- * (C) Copyright 2008-2011 Michal Simek <mon...@monstr.eu>
+ * (C) Copyright 2008 - 2015 Michal Simek <mon...@monstr.eu>
* Clean driver and add xilinx constant from header file
*
* (C) Copyright 2004 Atmark Techno, Inc.
@@ -10,11 +10,15 @@

   #include 
   #include 
+#include 
   #include 
   #include 
   #include 

+DECLARE_GLOBAL_DATA_PTR;
+
   #define SR_TX_FIFO_FULL0x08 /* transmit FIFO full */
+#define SR_TX_FIFO_EMPTY0x04 /* transmit FIFO empty */
   #define SR_RX_FIFO_VALID_DATA0x01 /* data in receive FIFO */
   #define SR_RX_FIFO_FULL0x02 /* receive FIFO full */

@@ -28,135 +32,85 @@ struct uartlite {
   unsigned int control;
   };

-static struct uartlite *userial_ports[4] = {
-#ifdef XILINX_UARTLITE_BASEADDR
-[0] = (struct uartlite *)XILINX_UARTLITE_BASEADDR,
-#endif
-#ifdef XILINX_UARTLITE_BASEADDR1
-[1] = (struct uartlite *)XILINX_UARTLITE_BASEADDR1,
-#endif
-#ifdef XILINX_UARTLITE_BASEADDR2
-[2] = (struct uartlite *)XILINX_UARTLITE_BASEADDR2,
-#endif
-#ifdef XILINX_UARTLITE_BASEADDR3
-[3] = (struct uartlite *)XILINX_UARTLITE_BASEADDR3
-#endif
+struct uartlite_platdata {
+struct uartlite *regs;
   };

-static void uartlite_serial_putc(const char c, const int port)
+static int uartlite_serial_putc(struct udevice *dev, const char ch)
   {
-struct uartlite *regs = userial_ports[port];
+struct uartlite_platdata *plat = dev_get_platdata(dev);
+struct uartlite *regs = plat->regs;

-if (c == '\n')
-uartlite_serial_putc('\r', port);
+if (in_be32(>status) & SR_TX_FIFO_FULL)
+return -EAGAIN;

-while (in_be32(>status) & SR_TX_FIFO_FULL)
-;
-out_be32(>tx_fifo, c & 0xff);
-}
+out_be3

Re: [U-Boot] [PATCH] nios2: display altera sysid at startup

2015-12-16 Thread Thomas Chou

Hi Marek,

On 2015年12月16日 18:25, Marek Vasut wrote:

On Wednesday, December 16, 2015 at 09:07:47 AM, Thomas Chou wrote:

Display altera sysid at startup, which was once removed during
the move.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>


What if the sysid block isn't part of the design ?


If the sysid block is not present, nothing will display and it is not an 
error.


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] nios2: display altera sysid at startup

2015-12-16 Thread Thomas Chou

Hi Marek,

On 2015年12月16日 21:23, Marek Vasut wrote:

On Wednesday, December 16, 2015 at 02:10:26 PM, Thomas Chou wrote:

Hi Marek,


Hi!


On 2015年12月16日 18:25, Marek Vasut wrote:

On Wednesday, December 16, 2015 at 09:07:47 AM, Thomas Chou wrote:

Display altera sysid at startup, which was once removed during
the move.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>


What if the sysid block isn't part of the design ?


If the sysid block is not present, nothing will display and it is not an
error.


Won't this cause bus stall if you try to access unpopulated location ?


It will be accessed though DT binding. As long as DT is correct, it 
won't access unpopulated location.


With the Altera Avalon bus, even a unpopulated access will not stall.

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 1/2] nios2: Enable support for fitImage

2015-12-16 Thread Thomas Chou

Hi Marek,

On 2015年12月16日 18:26, Marek Vasut wrote:

+CONFIG_FIT=y


Amended with savedefconfig and applied to u-boot-nios. Thanks.


Thanks!

How exactly did you regenerate those defconfigs please ? Did you do just
make nnn_config ; make savedefconfig ; cp defconfig configs/nnn_defconfig
?


Yes, make nnn_config ; make savedefconfig ; cp defconfig 
configs/nnn_defconfig .


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] nios2: display altera sysid at startup

2015-12-16 Thread Thomas Chou
Display altera sysid at startup, which was once removed during
the move.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 arch/nios2/cpu/cpu.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/arch/nios2/cpu/cpu.c b/arch/nios2/cpu/cpu.c
index f6d5cd3..be7f99c 100644
--- a/arch/nios2/cpu/cpu.c
+++ b/arch/nios2/cpu/cpu.c
@@ -21,6 +21,14 @@ int print_cpuinfo(void)
 }
 #endif /* CONFIG_DISPLAY_CPUINFO */
 
+#ifdef CONFIG_ALTERA_SYSID
+int checkboard(void)
+{
+   display_sysid();
+   return 0;
+}
+#endif
+
 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
disable_interrupts();
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] serial: Use static inline for _debug_uart_init()

2015-12-15 Thread Thomas Chou

Hi Michal,

On 2015年12月14日 23:53, Michal Simek wrote:

Reported-by: Thomas Chou <tho...@wytron.com.tw>
Signed-off-by: Michal Simek <michal.si...@xilinx.com>
---

  drivers/serial/serial_xuartlite.c | 2 +-
  drivers/serial/serial_zynq.c  | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/serial_xuartlite.c 
b/drivers/serial/serial_xuartlite.c
index fe87b515d902..0238a52380c7 100644
--- a/drivers/serial/serial_xuartlite.c
+++ b/drivers/serial/serial_xuartlite.c
@@ -122,7 +122,7 @@ U_BOOT_DRIVER(serial_uartlite) = {
  };

  #ifdef CONFIG_DEBUG_UART_UARTLITE
-void _debug_uart_init(void)
+static inline void _debug_uart_init(void)
  {
struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;

diff --git a/drivers/serial/serial_zynq.c b/drivers/serial/serial_zynq.c
index b2b98dea1561..3430482f8d8b 100644
--- a/drivers/serial/serial_zynq.c
+++ b/drivers/serial/serial_zynq.c
@@ -192,7 +192,7 @@ U_BOOT_DRIVER(serial_zynq) = {
  };

  #ifdef CONFIG_DEBUG_UART_ZYNQ
-void _debug_uart_init(void)
+static inline void _debug_uart_init(void)
  {
struct uart_zynq *regs = (struct uart_zynq *)CONFIG_DEBUG_UART_BASE;




Reviewed-by: Thomas Chou <tho...@wytron.com.tw>

Thanks,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] serial: uartlite: Add uartlite to Kconfig

2015-12-15 Thread Thomas Chou

Hi Michal,

On 2015年12月15日 23:39, Michal Simek wrote:

On 15.12.2015 05:02, Thomas Chou wrote:

Hi Michal,

On 2015年12月14日 23:42, Michal Simek wrote:

On 14.12.2015 15:35, Thomas Chou wrote:

Hi Michal,

On 2015年12月11日 19:54, Michal Simek wrote:

- Move config option out of board file.
- Remove uartlite address from config file

Signed-off-by: Michal Simek <michal.si...@xilinx.com>
---

board/xilinx/microblaze-generic/xparameters.h | 4 
configs/microblaze-generic_defconfig  | 1 +
drivers/serial/Kconfig| 7 +++
include/configs/microblaze-generic.h  | 7 +--
4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/board/xilinx/microblaze-generic/xparameters.h
b/board/xilinx/microblaze-generic/xparameters.h
index 8ba146cb88db..11b3c9a4846e 100644
--- a/board/xilinx/microblaze-generic/xparameters.h
+++ b/board/xilinx/microblaze-generic/xparameters.h
@@ -28,10 +28,6 @@
#define XILINX_TIMER_BASEADDR0x41c0
#define XILINX_TIMER_IRQ0

-/* Uart pheriphery is RS232_Uart */
-#define XILINX_UARTLITE_BASEADDR0x4060
-#define XILINX_UARTLITE_BAUDRATE115200
-
/* IIC pheriphery is IIC_EEPROM */
#define XILINX_IIC_0_BASEADDR0x4080
#define XILINX_IIC_0_FREQ10
diff --git a/configs/microblaze-generic_defconfig
b/configs/microblaze-generic_defconfig
index 5df080b6a87c..9a7bb915466f 100644
--- a/configs/microblaze-generic_defconfig
+++ b/configs/microblaze-generic_defconfig
@@ -9,3 +9,4 @@ CONFIG_CMD_GPIO=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_SPL_OF_CONTROL=y
CONFIG_OF_EMBED=y
+CONFIG_XILINX_UARTLITE=y
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index f1e221799b81..ddf49ba9cef3 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -230,4 +230,11 @@ config UNIPHIER_SERIAL
  If you have a UniPhier based board and want to use the on-chip
  serial ports, say Y to this option. If unsure, say N.

+config XILINX_UARTLITE
+bool "Xilinx Uarlite support"
+depends on DM_SERIAL && (MICROBLAZE || ARCH_ZYNQ || ARCH_ZYNQMP)
+help
+  If you have a Xilinx based board and want to use the uartlite
+  serial ports, say Y to this option. If unsure, say N.
+
endmenu


Kconfig should be with the driver 1/3. Others are boards related.


It can be. Adding Kconfig fragment can be separate patch out of move to
DM. There is no connection too.
My intention was to show all related changes which are done by this one
step.


Please also make sure the patch series are bisectable.


I am not aware about anything what would caused that this series is not
bisectable. Do you see something like that?


No. Sorry. I didn't find DM and DM_serial in the microblaze repo at 
first. Then I found them in the patches earlier.


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] serial: uartlite: Add support for debug console

2015-12-15 Thread Thomas Chou

Hi Michal,

On 2015年12月15日 23:38, Michal Simek wrote:

Hi,

On 15.12.2015 05:01, Thomas Chou wrote:

Hi Michal,

On 2015年12月14日 23:50, Michal Simek wrote:

Hi,

On 14.12.2015 14:14, Thomas Chou wrote:

Hi Michal,

On 2015年12月11日 19:54, Michal Simek wrote:

Signed-off-by: Michal Simek <michal.si...@xilinx.com>
---

drivers/serial/Kconfig|  7 +++
drivers/serial/serial_xuartlite.c | 23 +++
2 files changed, 30 insertions(+)

diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig
index 1fc287ee98ec..f1e221799b81 100644
--- a/drivers/serial/Kconfig
+++ b/drivers/serial/Kconfig
@@ -92,6 +92,13 @@ config DEBUG_UART_S5P
  will need to provide parameters to make this work. The driver
will
  be available until the real driver-model serial is running.

+config DEBUG_UART_UARTLITE
+bool "Xilinx Uartlite"
+help
+  Select this to enable a debug UART using the serial_uartlite
driver.
+  You will need to provide parameters to make this work. The
driver will
+  be available until the real driver-model serial is running.
+
config DEBUG_UART_ZYNQ
bool "Xilinx Zynq"
help
diff --git a/drivers/serial/serial_xuartlite.c
b/drivers/serial/serial_xuartlite.c
index 10089f5a34b5..fe87b515d902 100644
--- a/drivers/serial/serial_xuartlite.c
+++ b/drivers/serial/serial_xuartlite.c
@@ -120,3 +120,26 @@ U_BOOT_DRIVER(serial_uartlite) = {
.ops= _serial_ops,
.flags = DM_FLAG_PRE_RELOC,
};
+
+#ifdef CONFIG_DEBUG_UART_UARTLITE


Better move the "#include " here.


This is the patch I sent some days ago about removing it from this
location and it was Reviewed twice.
http://lists.denx.de/pipermail/u-boot/2015-December/236341.html





This is because commit 42800ffa7997 ("arm: zynq: Move serial driver to
driver model") added the extra #include . It is this one
should be removed. The original one in commit c54c0a4c1c74 ("arm: zynq:
Support the debug UART") is good. The wrong one was removed.


I tend to have headers in the same location for the whole file
It will be easier to include this file when CONFIG_DEBUG_UART is enabled.
But no problem to move it. It is not causing any difference for me.



+void _debug_uart_init(void)


Please add "static inline" to void _debug_uart_init(void).


Ok. Will fix this for uartlite and zynq uart in follow up patch.



+{
+struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;
+
+out_be32(>control, 0);
+out_be32(>control, ULITE_CONTROL_RST_RX |
ULITE_CONTROL_RST_TX);
+in_be32(>control);
+}
+
+static inline void _debug_uart_putc(int ch)
+{
+struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;
+
+while (in_be32(>status) & SR_TX_FIFO_FULL)
+WATCHDOG_RESET();


WATCHDOG_RESET() is not really needed for debug serial output.


TBH I don't think so. There could be watchdog running from early
bootloader and needs to be service even for debugging purpose.



Unless the serial input clock is dead, the serial shift out in UART
won't take so long to trigger watchdog.


Uartlite driver is also the part of MDM which is console over jtag which
can take some time.
But TBH if you like, I will remove it in v2.



Now I understand. Either is fine. Thanks for the explanation.

Best regards,
Thomas

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] nios2: Enable support for fitImage

2015-12-15 Thread Thomas Chou

Hi Marek,

On 2015年12月16日 07:18, Marek Vasut wrote:

On Tuesday, December 15, 2015 at 02:26:44 PM, Thomas Chou wrote:

Hi Marek,

On 2015年12月15日 18:26, Marek Vasut wrote:

On Tuesday, December 15, 2015 at 06:31:11 AM, Thomas Chou wrote:

Hi Marek,

On 2015年12月15日 10:09, Marek Vasut wrote:

The uImage format is legacy for years now, enable support for the
fitImage format, which allows combining multiple files (kernel and
dtb) into a single file, offers better protection of the payload
and so on.

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Thomas Chou <tho...@wytron.com.tw>
---

include/configs/10m50_devboard.h | 2 ++
include/configs/3c120_devboard.h | 2 ++
2 files changed, 4 insertions(+)

diff --git a/include/configs/10m50_devboard.h
b/include/configs/10m50_devboard.h index 608127f..0aa79f7 100644
--- a/include/configs/10m50_devboard.h
+++ b/include/configs/10m50_devboard.h
@@ -14,6 +14,8 @@

 */

#define CONFIG_DISPLAY_CPUINFO
#define CONFIG_DISPLAY_BOARDINFO_LATE

+#define CONFIG_OF_LIBFDT


Already defined.


+#define CONFIG_FIT

/*

 * SERIAL

diff --git a/include/configs/3c120_devboard.h
b/include/configs/3c120_devboard.h index 6c9dc3f..0054d8b 100644
--- a/include/configs/3c120_devboard.h
+++ b/include/configs/3c120_devboard.h
@@ -14,6 +14,8 @@

 */

#define CONFIG_DISPLAY_CPUINFO
#define CONFIG_DISPLAY_BOARDINFO_LATE

+#define CONFIG_OF_LIBFDT


Ditto.


+#define CONFIG_FIT

/*

 * SERIAL


The compiler is not complaining, is it really ?


Hmm, it might be the compiler's problem.

It might be better to move CONFIG_FIT to the misc (the last) config
section.


Apparently, if the macro is defined in the same file twice and it is the same,
CPP will not complain.



Please note that CONFIG_FIT is moved to Kconfig. So it should be added 
to defcofnig.


Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 2/2] nios2: Soup up the shell experience

2015-12-15 Thread Thomas Chou

Hi Marek,

On 2015年12月16日 08:32, Marek Vasut wrote:

Enable command auto completion and enable $version variable. This makes
working with U-Boot far more enjoyable.

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Thomas Chou <tho...@wytron.com.tw>
---
  include/configs/10m50_devboard.h | 2 ++
  include/configs/3c120_devboard.h | 2 ++
  2 files changed, 4 insertions(+)

V2: Drop the default prompt setting

diff --git a/include/configs/10m50_devboard.h b/include/configs/10m50_devboard.h
index 608127f..8dfe2a8 100644
--- a/include/configs/10m50_devboard.h
+++ b/include/configs/10m50_devboard.h
@@ -99,6 +99,8 @@
 CONFIG_ENV_SIZE - \
 CONFIG_SYS_MALLOC_LEN -\
 0x1)
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_AUTO_COMPLETE
  #define CONFIG_CMDLINE_EDITING

  #endif /* __CONFIG_H */
diff --git a/include/configs/3c120_devboard.h b/include/configs/3c120_devboard.h
index 6c9dc3f..2e94b69 100644
--- a/include/configs/3c120_devboard.h
+++ b/include/configs/3c120_devboard.h
@@ -102,6 +102,8 @@
 CONFIG_ENV_SIZE - \
 CONFIG_SYS_MALLOC_LEN -\
 0x1)
+#define CONFIG_VERSION_VARIABLE
+#define CONFIG_AUTO_COMPLETE
  #define CONFIG_CMDLINE_EDITING

  #endif /* __CONFIG_H */



Applied to u-boot-nios. Thanks.

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 1/2] nios2: Enable support for fitImage

2015-12-15 Thread Thomas Chou

Hi Marek,

On 2015年12月16日 08:32, Marek Vasut wrote:

The uImage format is legacy for years now, enable support for the
fitImage format, which allows combining multiple files (kernel and
dtb) into a single file, offers better protection of the payload
and so on.

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Thomas Chou <tho...@wytron.com.tw>
---
  configs/10m50_defconfig | 1 +
  configs/3c120_defconfig | 1 +
  2 files changed, 2 insertions(+)

V2: Move CONFIG_FIT into Kconfig
 Drop duplicate CONFIG_OF_LIBFDT definition

diff --git a/configs/10m50_defconfig b/configs/10m50_defconfig
index 0d18e8d..c179a0f 100644
--- a/configs/10m50_defconfig
+++ b/configs/10m50_defconfig
@@ -25,3 +25,4 @@ CONFIG_ALTERA_TSE=y
  CONFIG_SYS_NS16550=y
  CONFIG_TIMER=y
  CONFIG_ALTERA_TIMER=y
+CONFIG_FIT=y
diff --git a/configs/3c120_defconfig b/configs/3c120_defconfig
index 8bc13f3..2fdff87 100644
--- a/configs/3c120_defconfig
+++ b/configs/3c120_defconfig
@@ -26,3 +26,4 @@ CONFIG_ALTERA_JTAG_UART=y
  CONFIG_ALTERA_JTAG_UART_BYPASS=y
  CONFIG_TIMER=y
  CONFIG_ALTERA_TIMER=y
+CONFIG_FIT=y



Amended with savedefconfig and applied to u-boot-nios. Thanks.

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] nios2: Enable support for fitImage

2015-12-15 Thread Thomas Chou

Hi Marek,

On 2015年12月15日 18:26, Marek Vasut wrote:

On Tuesday, December 15, 2015 at 06:31:11 AM, Thomas Chou wrote:

Hi Marek,

On 2015年12月15日 10:09, Marek Vasut wrote:

The uImage format is legacy for years now, enable support for the
fitImage format, which allows combining multiple files (kernel and
dtb) into a single file, offers better protection of the payload
and so on.

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Thomas Chou <tho...@wytron.com.tw>
---

   include/configs/10m50_devboard.h | 2 ++
   include/configs/3c120_devboard.h | 2 ++
   2 files changed, 4 insertions(+)

diff --git a/include/configs/10m50_devboard.h
b/include/configs/10m50_devboard.h index 608127f..0aa79f7 100644
--- a/include/configs/10m50_devboard.h
+++ b/include/configs/10m50_devboard.h
@@ -14,6 +14,8 @@

*/

   #define CONFIG_DISPLAY_CPUINFO
   #define CONFIG_DISPLAY_BOARDINFO_LATE

+#define CONFIG_OF_LIBFDT


Already defined.


+#define CONFIG_FIT

   /*

* SERIAL

diff --git a/include/configs/3c120_devboard.h
b/include/configs/3c120_devboard.h index 6c9dc3f..0054d8b 100644
--- a/include/configs/3c120_devboard.h
+++ b/include/configs/3c120_devboard.h
@@ -14,6 +14,8 @@

*/

   #define CONFIG_DISPLAY_CPUINFO
   #define CONFIG_DISPLAY_BOARDINFO_LATE

+#define CONFIG_OF_LIBFDT


Ditto.


+#define CONFIG_FIT

   /*

* SERIAL


The compiler is not complaining, is it really ?


Hmm, it might be the compiler's problem.

It might be better to move CONFIG_FIT to the misc (the last) config section.

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/5] nios2: Up the monitor size to 512kiB

2015-12-15 Thread Thomas Chou

Hi Marek,

On 2015年12月15日 10:09, Marek Vasut wrote:

The monitor is growing much larger with various additions, like fitImage,
command line completion, UBI etc. Make the monitor area larger so these
features can be safely added.

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Thomas Chou <tho...@wytron.com.tw>
---
  include/configs/10m50_devboard.h | 2 +-
  include/configs/3c120_devboard.h | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)



Applied to u-boot-nios. Thanks.

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5] nios2: Preconfigure $loadaddr variable

2015-12-15 Thread Thomas Chou

Hi Marek,

On 2015年12月15日 10:09, Marek Vasut wrote:

Preset the $loadaddr environment variable to some sane default, let's
say half of the RAM. This variable is where the kernel is loaded using
all sorts of .*load commands, so it's convenient to have it set.

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Thomas Chou <tho...@wytron.com.tw>
---
  include/configs/10m50_devboard.h | 3 ++-
  include/configs/3c120_devboard.h | 3 ++-
  2 files changed, 4 insertions(+), 2 deletions(-)



Applied to u-boot-nios. Thanks.

Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/5] nios2: Calculate the env position from monitor size

2015-12-15 Thread Thomas Chou

Hi Marek,

On 2015年12月15日 10:09, Marek Vasut wrote:

Reorder the 10m50 and 3c120 config files such, that the environment
position can be calculated from the monitor size. The environment is
placed right after the monitor. This removes one more ad-hoc variable.

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Thomas Chou <tho...@wytron.com.tw>
---
  include/configs/10m50_devboard.h | 26 +-
  include/configs/3c120_devboard.h | 26 +-
  2 files changed, 26 insertions(+), 26 deletions(-)



Applied to u-boot-nios. Thanks.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/2] ns16550: replace with binding files from Linux kernel

2015-12-14 Thread Thomas Chou



On 2015年12月15日 01:03, Stephen Warren wrote:

On 12/14/2015 05:45 AM, Thomas Chou wrote:

Replace ns16550.txt with binding files from Linux kernel. As suggested
by Stephen Warren, we should keep the directory structure, filenames,
and file content identical to the bindings in the Linux kernel.


Acked-by: Stephen Warren <swar...@nvidia.com>

(I assume that the new files are identical to the kernel versions,
although I didn't validate this)



Yes, they are exactly identical to the kernel versions.


(Or, I'd give my ack to simply deleting doc/device-tree-bindings/ so the
redundant copy doesn't have to be maintained).



Best regards,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] include: Correct "requset" typoes in misc.h

2015-12-14 Thread Thomas Chou

Hi Robert,

On 2015年12月14日 19:28, Robert P. J. Day wrote:


Signed-off-by: Robert P. J. Day <rpj...@crashcourse.ca>

---

diff --git a/include/misc.h b/include/misc.h
index 7e9badf..2b78814 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -32,7 +32,7 @@ int misc_write(struct udevice *dev, int offset, void *buf, 
int size);
   *
   * @dev: the device
   * @request: command to be sent to the device
- * @buf: pointer to buffer related to the requset
+ * @buf: pointer to buffer related to the request
   * @return: 0 if OK, -ve on error
   */
  int misc_ioctl(struct udevice *dev, unsigned long request, void *buf);
@@ -70,7 +70,7 @@ struct misc_ops {
 *
 * @dev: the device
 * @request: command to be sent to the device
-* @buf: pointer to buffer related to the requset
+* @buf: pointer to buffer related to the request
 * @return: 0 if OK, -ve on error
 */
int (*ioctl)(struct udevice *dev, unsigned long request, void *buf);



Acked-by: Thomas Chou <tho...@wytron.com.tw>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 1/2] ns16550: replace with binding files from Linux kernel

2015-12-14 Thread Thomas Chou
Replace ns16550.txt with binding files from Linux kernel. As suggested
by Stephen Warren, we should keep the directory structure, filenames,
and file content identical to the bindings in the Linux kernel.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 doc/device-tree-bindings/serial/8250.txt   | 66 +++
 doc/device-tree-bindings/serial/ns16550.txt| 10 ---
 doc/device-tree-bindings/serial/omap_serial.txt| 33 ++
 .../serial/snps-dw-apb-uart.txt| 76 ++
 4 files changed, 175 insertions(+), 10 deletions(-)
 create mode 100644 doc/device-tree-bindings/serial/8250.txt
 delete mode 100644 doc/device-tree-bindings/serial/ns16550.txt
 create mode 100644 doc/device-tree-bindings/serial/omap_serial.txt
 create mode 100644 doc/device-tree-bindings/serial/snps-dw-apb-uart.txt

diff --git a/doc/device-tree-bindings/serial/8250.txt 
b/doc/device-tree-bindings/serial/8250.txt
new file mode 100644
index 000..91d5ab0
--- /dev/null
+++ b/doc/device-tree-bindings/serial/8250.txt
@@ -0,0 +1,66 @@
+* UART (Universal Asynchronous Receiver/Transmitter)
+
+Required properties:
+- compatible : one of:
+   - "ns8250"
+   - "ns16450"
+   - "ns16550a"
+   - "ns16550"
+   - "ns16750"
+   - "ns16850"
+   - For Tegra20, must contain "nvidia,tegra20-uart"
+   - For other Tegra, must contain '"nvidia,-uart",
+ "nvidia,tegra20-uart"' where  is tegra30, tegra114, tegra124,
+ tegra132, or tegra210.
+   - "nxp,lpc3220-uart"
+   - "ralink,rt2880-uart"
+   - "ibm,qpace-nwp-serial"
+   - "altr,16550-FIFO32"
+   - "altr,16550-FIFO64"
+   - "altr,16550-FIFO128"
+   - "fsl,16550-FIFO64"
+   - "fsl,ns16550"
+   - "serial" if the port type is unknown.
+- reg : offset and length of the register set for the device.
+- interrupts : should contain uart interrupt.
+- clock-frequency : the input clock frequency for the UART
+or
+  clocks phandle to refer to the clk used as per Documentation/devicetree
+  /bindings/clock/clock-bindings.txt
+
+Optional properties:
+- current-speed : the current active speed of the UART.
+- reg-offset : offset to apply to the mapbase from the start of the registers.
+- reg-shift : quantity to shift the register offsets by.
+- reg-io-width : the size (in bytes) of the IO accesses that should be
+  performed on the device.  There are some systems that require 32-bit
+  accesses to the UART (e.g. TI davinci).
+- used-by-rtas : set to indicate that the port is in use by the OpenFirmware
+  RTAS and should not be registered.
+- no-loopback-test: set to indicate that the port does not implements loopback
+  test mode
+- fifo-size: the fifo size of the UART.
+- auto-flow-control: one way to enable automatic flow control support. The
+  driver is allowed to detect support for the capability even without this
+  property.
+
+Note:
+* fsl,ns16550:
+  
+  Freescale DUART is very similar to the PC16552D (and to a
+  pair of NS16550A), albeit with some nonstandard behavior such as
+  erratum A-004737 (relating to incorrect BRK handling).
+
+  Represents a single port that is compatible with the DUART found
+  on many Freescale chips (examples include mpc8349, mpc8548,
+  mpc8641d, p4080 and ls2085a).
+
+Example:
+
+   uart@8023 {
+   compatible = "ns8250";
+   reg = <0x8023 0x100>;
+   clock-frequency = <3686400>;
+   interrupts = <10>;
+   reg-shift = <2>;
+   };
diff --git a/doc/device-tree-bindings/serial/ns16550.txt 
b/doc/device-tree-bindings/serial/ns16550.txt
deleted file mode 100644
index ef0b9ae..000
--- a/doc/device-tree-bindings/serial/ns16550.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-NS16550 UART
-
-This UART driver supports many chip variants and is used in mamy SoCs.
-
-Required properties:
-- compatible: "ns16550" or "nvidia,tegra20-uart"
-- reg: start address and size of registers
-- reg-shift: shift value indicating register size: 0=byte, 1=16bit,2=32bit etc.
-- clock-frequency: input clock frequency for the UART (used to calculate the
-baud rate divisor)
diff --git a/doc/device-tree-bindings/serial/omap_serial.txt 
b/doc/device-tree-bindings/serial/omap_serial.txt
new file mode 100644
index 000..7a71b5d
--- /dev/null
+++ b/doc/device-tree-bindings/serial/omap_serial.txt
@@ -0,0 +1,33 @@
+OMAP UART controller
+
+Required properties:
+- compatible : should be "ti,omap2-uart" for OMAP2 controllers
+- compatible : should be "ti,omap3-uart" for OMAP3 controllers
+- compatible : should be "ti,omap4-uart" for OMAP4 controllers
+- compatible : should be "ti,am4372-uart&qu

[U-Boot] [PATCH v2 2/2] ns16550: zap the rockchip serial compatible string

2015-12-14 Thread Thomas Chou
Zap the rockchip serial compatible string, because rockchip
serial has "snps,dw-apb-uart" compatible string in the dts.

Signed-off-by: Thomas Chou <tho...@wytron.com.tw>
---
 drivers/serial/ns16550.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 3fab3f1..06ac005 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -424,11 +424,15 @@ const struct dm_serial_ops ns16550_serial_ops = {
 };
 
 #if CONFIG_IS_ENABLED(OF_CONTROL)
+/*
+ * Please consider existing compatible strings before adding a new
+ * one to keep this table compact. Or you may add a generic "ns16550"
+ * compatible string to your dts.
+ */
 static const struct udevice_id ns16550_serial_ids[] = {
{ .compatible = "ns16550" },
{ .compatible = "ns16550a" },
{ .compatible = "nvidia,tegra20-uart" },
-   { .compatible = "rockchip,rk3036-uart" },
{ .compatible = "snps,dw-apb-uart" },
{ .compatible = "ti,omap2-uart" },
{ .compatible = "ti,omap3-uart" },
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] nios2: Enable support for fitImage

2015-12-14 Thread Thomas Chou

Hi Marek,

On 2015年12月15日 10:09, Marek Vasut wrote:

The uImage format is legacy for years now, enable support for the
fitImage format, which allows combining multiple files (kernel and
dtb) into a single file, offers better protection of the payload
and so on.

Signed-off-by: Marek Vasut <ma...@denx.de>
Cc: Thomas Chou <tho...@wytron.com.tw>
---
  include/configs/10m50_devboard.h | 2 ++
  include/configs/3c120_devboard.h | 2 ++
  2 files changed, 4 insertions(+)

diff --git a/include/configs/10m50_devboard.h b/include/configs/10m50_devboard.h
index 608127f..0aa79f7 100644
--- a/include/configs/10m50_devboard.h
+++ b/include/configs/10m50_devboard.h
@@ -14,6 +14,8 @@
   */
  #define CONFIG_DISPLAY_CPUINFO
  #define CONFIG_DISPLAY_BOARDINFO_LATE
+#define CONFIG_OF_LIBFDT


Already defined.


+#define CONFIG_FIT

  /*
   * SERIAL
diff --git a/include/configs/3c120_devboard.h b/include/configs/3c120_devboard.h
index 6c9dc3f..0054d8b 100644
--- a/include/configs/3c120_devboard.h
+++ b/include/configs/3c120_devboard.h
@@ -14,6 +14,8 @@
   */
  #define CONFIG_DISPLAY_CPUINFO
  #define CONFIG_DISPLAY_BOARDINFO_LATE
+#define CONFIG_OF_LIBFDT


Ditto.


+#define CONFIG_FIT

  /*
   * SERIAL



Thanks,
Thomas
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


  1   2   3   4   5   6   7   8   9   10   >