Re: [U-Boot] [PATCH] am33xx: Add a function to query MPU voltage in uV

2017-10-13 Thread Lokesh Vutla


On Wednesday 11 October 2017 10:12 PM, Felix Brack wrote:
> For the DM TPS65910 driver I'm working on, querying the MPU voltage
> should return a value in uV. This value can then be used by the
> regulator's standard function set_value to set the MPU voltage.
> 
> Signed-off-by: Felix Brack 

Reviewed-by: Lokesh Vutla 

Thanks and regards,
Lokesh


> ---
> 
>  arch/arm/include/asm/arch-am33xx/sys_proto.h |  1 +
>  arch/arm/mach-omap2/am33xx/sys_info.c| 16 
>  2 files changed, 17 insertions(+)
> 
> diff --git a/arch/arm/include/asm/arch-am33xx/sys_proto.h 
> b/arch/arm/include/asm/arch-am33xx/sys_proto.h
> index 4e78aaf..57fbfa4 100644
> --- a/arch/arm/include/asm/arch-am33xx/sys_proto.h
> +++ b/arch/arm/include/asm/arch-am33xx/sys_proto.h
> @@ -40,6 +40,7 @@ void enable_norboot_pin_mux(void);
>  #endif
>  void am33xx_spl_board_init(void);
>  int am335x_get_efuse_mpu_max_freq(struct ctrl_dev *cdev);
> +int am335x_get_mpu_vdd(int sil_rev, int frequency);
>  int am335x_get_tps65910_mpu_vdd(int sil_rev, int frequency);
>  #endif
>  
> diff --git a/arch/arm/mach-omap2/am33xx/sys_info.c 
> b/arch/arm/mach-omap2/am33xx/sys_info.c
> index ea434aa..0181a8c 100644
> --- a/arch/arm/mach-omap2/am33xx/sys_info.c
> +++ b/arch/arm/mach-omap2/am33xx/sys_info.c
> @@ -175,6 +175,22 @@ int am335x_get_efuse_mpu_max_freq(struct ctrl_dev *cdev)
>   return MPUPLL_M_720;
>  }
>  
> +int am335x_get_mpu_vdd(int sil_rev, int frequency)
> +{
> + int sel_mask = am335x_get_tps65910_mpu_vdd(sil_rev, frequency);
> +
> + switch (sel_mask) {
> + case TPS65910_OP_REG_SEL_1_3_2_5:
> + return 1325000;
> + case TPS65910_OP_REG_SEL_1_2_0:
> + return 120;
> + case TPS65910_OP_REG_SEL_1_1_0:
> + return 110;
> + default:
> + return 1262500;
> + }
> +}
> +
>  int am335x_get_tps65910_mpu_vdd(int sil_rev, int frequency)
>  {
>   /* For PG2.0 and later, we have one set of values. */
> 
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PULL] efi patch queue 2017-10-13

2017-10-13 Thread Tom Rini
On Fri, Oct 13, 2017 at 10:37:37AM +0200, Alexander Graf wrote:

> Hi Tom,
> 
> This is my current patch queue for efi.  Please pull.
> 
> Alex
> 
> 
> The following changes since commit 39dd65a059e503883dbf16d4c00ac083d15837da:
> 
>   sandbox: Enable btrfs support (2017-10-03 08:44:55 -0400)
> 
> are available in the git repository at:
> 
>   git://github.com/agraf/u-boot.git tags/signed-efi-next
> 
> for you to fetch changes up to abe994633b2ad56c5eea87c9253873f41dab477d:
> 
>   efi_selftest: correctly check return values (2017-10-13 10:24:22 +0200)
> 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 3/4] omap-common: fastboot: extend cpu type for DRA71x rev 2.1

2017-10-13 Thread Tom Rini
On Thu, Oct 12, 2017 at 10:47:04PM -0500, Praneeth Bajjuri wrote:

> From: Vishal Mahaveer 
> 
> DRA71x processors are reduced pin and software compatible
> derivative of DRA72 processors. Extend support for this
> revision in "getvar cpu" command.
> 
> Signed-off-by: Vishal Mahaveer 
> [prane...@ti.com: rebase to u-boot master]
> Signed-off-by: Praneeth Bajjuri 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH 4/4] arm: dra76: fastboot: extend cpu type for getvar command

2017-10-13 Thread Tom Rini
On Thu, Oct 12, 2017 at 10:47:05PM -0500, Praneeth Bajjuri wrote:

> 'commit fa24eca1f20a ("omap: Add routine for setting fastboot variables")'
> adds initial support and usage of "fastboot getvar" command
> for DRA75x and DRA72x devices.
> 
> and
> 'commit 0f9e6aee9dbc ("arm: dra76: Add support for ES1.0 detection")'
> adds initial dra76 device definition
> 
> This patch is to extend usage of "fastboot getvar" for DRA76 device.
> 
> Signed-off-by: Praneeth Bajjuri 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH 2/4] arm: dra7xx: Add vendor partition to Android GPT table for eMMC

2017-10-13 Thread Tom Rini
On Thu, Oct 12, 2017 at 10:47:03PM -0500, Praneeth Bajjuri wrote:

> From: Vishal Mahaveer 
> 
> Add vendor partition to Android GPT table for eMMC.
> 
> A Vendor image contains SoC-specific code and configuration.
> 
> Prior to Android 8.0, the vendor partition was optional ;
> files belonging to these images were placed in boot.img or system.img
> with symlinks (such as /vendor >/system/vendor ) when absent.
> 
> Android 8.0 makes the vendor partition mandatory
> 
> The goal is to modularize Android partitions with standard interface between
> the Android Platform (on system.img ) and vendor-provided code(on vendor.img).
> 
> This standard interface enables the Android Platform to be updated
> without affecting the SoC partitions. This makes it possible to upgrade a
> device system.img from Android 8.0 to Android P while other images (such as
> vendor.img) remain at Android 8.0. This modularity enables timely
> Android platform upgrades (such as monthly security updates )
> without requiring SoC/ODM partners to update SoC- and device-specific code.
> 
> Signed-off-by: Vishal Mahaveer 
> Signed-off-by: Praneeth Bajjuri 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH 1/4] arm: am57xx: Add vendor partition to Android GPT table for eMMC

2017-10-13 Thread Tom Rini
On Thu, Oct 12, 2017 at 10:47:02PM -0500, Praneeth Bajjuri wrote:

> Add vendor partition to Android GPT table for eMMC.
> 
> A Vendor image contains SoC-specific code and configuration.
> 
> Prior to Android 8.0, the vendor partition was optional ;
> files belonging to these images were placed in boot.img or system.img
> with symlinks (such as /vendor >/system/vendor ) when absent.
> 
> Android 8.0 makes the vendor partition mandatory
> 
> The goal is to modularize Android partitions with standard interface between
> the Android Platform (on system.img ) and vendor-provided code(on vendor.img).
> 
> This standard interface enables the Android Platform to be updated
> without affecting the SoC partitions. This makes it possible to upgrade a
> device system.img from Android 8.0 to Android P while other images (such as
> vendor.img) remain at Android 8.0. This modularity enables timely
> Android platform upgrades (such as monthly security updates )
> without requiring SoC/ODM partners to update SoC- and device-specific code.
> 
> Signed-off-by: Praneeth Bajjuri 

Reviewed-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [PATCH v2 0/3] kbuild: always use relative path for __FILE__

2017-10-13 Thread Tom Rini
On Sat, Oct 14, 2017 at 03:35:23AM +0900, Masahiro Yamada wrote:
> 2017-10-13 22:53 GMT+09:00 Tom Rini :
> > On Fri, Oct 13, 2017 at 09:21:19PM +0900, Masahiro Yamada wrote:
> >> 2017-10-13 21:11 GMT+09:00 Tom Rini :
> >> > On Fri, Oct 13, 2017 at 06:51:42PM +0900, Masahiro Yamada wrote:
> >> >
> >> >> We discussed the __FILE__ problem when U-Boot is built out of tree.
> >> >> https://www.mail-archive.com/u-boot@lists.denx.de/msg242852.html
> >> >>
> >> >> The deeper your build directory is located, the larger
> >> >> your U-Boot image becomes.
> >> >> If your platform has memory footprint limit, this is a problem.
> >> >>
> >> >> Recently, I submitted the following patches to Kbuild ML.
> >> >> (no RFC, this time)
> >> >> https://patchwork.kernel.org/patch/10001419/
> >> >> https://patchwork.kernel.org/patch/10001409/
> >> >>
> >> >> I consider them for Linux 4.15 unless there is
> >> >> a strong objection or a problem report.
> >> >>
> >> >> This series is a port for U-Boot.
> >> >>
> >> >> If Tom wants to pick this up earlier, it is OK.
> >> >> If not in hurry, you can wait for the activity in Linux.
> >> >> Either will do.
> >> >
> >> > Yay.  I plan to pick these up after v2017.11 has been released, so no
> >> > need to re-spin this if it stops applying cleanly until we're closer to
> >> > release.  Thanks!
> >> >
> >>
> >> Good.
> >>
> >> According to this:
> >> http://phb-crystal-ball.org/
> >>
> >> The MW for v4.15 will open 2017-11-12.
> >>
> >> So, the next MW for U-Boot and Linux will be almost lined up.
> >>
> >> You will be able to apply it more confidently
> >> if Linus pulls the Linux counterpart.
> >>
> >> Until then, I will test it in linux-next.
> >
> > FWIW, a world build is:
> > https://gist.github.com/trini/ad0f55b9f46997fd11801aac48bf0c10
> >
> > I wonder why we see size increase in a few cases?  In both cases, the
> > obj directory is /tmp/something/01_of_.. (or 04_of_..)/current/..
> >
> 
> 
> Figured out.
> 
> 
> This patch changes the string in some places
> where BUG() etc. is used in functions
> included from another .c file.
> 
> For example,
> 
> drivers/usb/gadget/composite.c is included from
> drivers/usb/gadget/g_dnl.c
> 
> 
> The BUG_ON() in composite_unbind(),
> previously printed drivers/usb/gadget/composite.c,
> but will print drivers/usb/gadget/g_dnl.c with this patch.
> 
> This is the cause of slight increase/decrease.
> 
> Then, I do not have a solution...

Ah yes, this was the potential complication with going down this path...
Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v4 2/2] wandboard: Add support for the MX6QP variant

2017-10-13 Thread Fabio Estevam
Hi Stefano,

On Wed, Oct 4, 2017 at 9:35 AM, Fabio Estevam  wrote:
> Hi Stefano,
>
> On Wed, Oct 4, 2017 at 6:34 AM, Stefano Babic  wrote:
>
>> mmhhh...it looks to me we are diverging with this SOC. I understand that
>> current funtions are not suitable for the new SOC. However, we were able
>> to manage up now to write tables (mx6dq_iomux_ddr_regs) and use
>> functions to setup the strength and the other parameters. As your tests
>> has proofed that these functions do not work for MX6QP, the logical way
>> to do is to modify these functions instead of putting back all this code
>> in the board file. Do you agree ?
>
> Sure, I will work on using the common code for imx6qp here too.

I worked on converting this patch to using the existing DDR setup functions:
https://pastebin.com/6PGx0pMx

However I do see instability: after lauching the kernel I see a hang
after "Starting the kernel..." sometimes.

The original DDR configuration that I used from Technexion in the
original patch is very stable and never hangs.

The DDR iomux function can be used, but the mx6_dram_cfg() is the one
that gives trouble.

I understand that using the common framework is preferred, but it
seems it will require a great amount of effort to make the qp board
variant stable.

Regards,

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


Re: [U-Boot] [PATCH v2 1/1] test/py/tests/test_sleep.py: test time approximately

2017-10-13 Thread Stephen Warren

On 10/13/2017 02:28 PM, Heinrich Schuchardt wrote:

On qemu errors like
assert 2.999650001525879 >= 3
occur.

According to the comment in the code the test is meant to be
approximate. So we should accept some milliseconds less.


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


[U-Boot] [PATCH v2 1/1] test/py/tests/test_sleep.py: test time approximately

2017-10-13 Thread Heinrich Schuchardt
On qemu errors like
assert 2.999650001525879 >= 3
occur.

According to the comment in the code the test is meant to be
approximate. So we should accept some milliseconds less.

Cc: Stephen Warren 
Signed-off-by: Heinrich Schuchardt 
---
v2
reduce negative tolerance to 0.01 seconds
(instead of 0.25) as proposed by Stephen
---
 test/py/tests/test_sleep.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/py/tests/test_sleep.py b/test/py/tests/test_sleep.py
index b59a4cfc0f..64e0571326 100644
--- a/test/py/tests/test_sleep.py
+++ b/test/py/tests/test_sleep.py
@@ -17,7 +17,7 @@ def test_sleep(u_boot_console):
 u_boot_console.run_command('sleep %d' % sleep_time)
 tend = time.time()
 elapsed = tend - tstart
-assert elapsed >= sleep_time
+assert elapsed >= (sleep_time - 0.01)
 if not u_boot_console.config.gdbserver:
 # 0.25s margin is hopefully enough to account for any system overhead.
 assert elapsed < (sleep_time + 0.25)
-- 
2.14.1

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


Re: [U-Boot] [PATCH 1/1] test/py/tests/test_sleep.py: test time approximately

2017-10-13 Thread Stephen Warren

On 10/05/2017 04:33 PM, Heinrich Schuchardt wrote:

On 10/05/2017 11:10 PM, Stephen Warren wrote:

On 10/05/2017 01:52 PM, Heinrich Schuchardt wrote:

On qemu errors like
assert 2.999650001525879 >= 3
occur.


Can you work out why? I guess 1-999650001525879 is a really tiny amount,
so perhaps it's OK. However, I'd like to keep the test strict if
possible; maybe rather than:


+    assert elapsed >= (sleep_time - 0.25)


can we use:


+    assert elapsed >= (sleep_time - 0.01)


?


According to the comment in the code the test is meant to be
approximate. So we should accept some milliseconds less.


This test is deliberately very strict about the minimum time taken
during sleep, and slightly sloppy about over-sleeping. That's because
sleep should never wait too little time, but we allow a little extra
time due to e.g. the test system being a bit busy and not noticing when
the sleep wakes up.


You are making unreasonable assumptions about the accuracy of system clocks.

I am not aware of U-Boot making any guarantees that the clock is never
too fast.


It depends what you mean by "too fast".

The intention of this test was to validate that the clock isn't e.g. 2x 
or 10x too fast. I think it's reasonable to assume that U-Boot 
guarantees that, even if there's no written statement to that effect.


"Too fast" isn't intended to mean anything like "no more than 0.5% too 
fast" for example. The current test does have a bug in that regard.



If you want sleep to never consume less time than requested you would at
least always have to add 1 timer tick to the requested time in the sleep
function.


Yes. I've pointed this out at times when working on delay functions in 
the past. Simon Glass said this didn't matter:-(



The test does not even use a timer function that is meant to measure
with the accuracy that you expect.

It uses Python function time.time() that is not guaranteed to have a
resolution better than one second and has no guarantee to be non-decreasing.


In practice, the resolution typically is far better than one second 
though. I think that aspect of the test is good enough for now, until 
someone needs to run it on some odd host that doesn't have sub-second 
resolution.



The right way to measure time for performance measurements is Python 3.3
function time.perf_counter().


Unfortunately, that API doesn't seem to be available on Python 2. The 
test/py code currently supports Python 2, although recently some patches 
were sent to make it work on Python 3 too. Is there an alternative 
that's better than time.time() and works on both Python versions?



QEMU provides no guarantees concerning time synchroniation. So shouldn't
we be happy with the little randomness that we see in some systems, e.g.

3.000195026397705
3.35047531128
3.000230073928833
2.9996659755706787
3.0026118755340576
3.0025811195373535
3.0034120082855225
3.002816915512085
3.002542018890381
3.0020010471343994


Yes, I think that level of randomness would be perfectly acceptable. My 
objection is to allowing e.g. the 0.25 second variation that your 
proposed patch allows; I believe that's far too high of a variation. The 
0.01 variation that I proposed for the low side:


>>> +assert elapsed >= (sleep_time - 0.01)

... would work just fine for all those values (there is only one value 
in that list less than 3). The allowed variation on the other side 
should be a bit larger (and already is; 0.25 seconds).

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


Re: [U-Boot] [PATCH v2 0/3] kbuild: always use relative path for __FILE__

2017-10-13 Thread Masahiro Yamada
2017-10-13 22:53 GMT+09:00 Tom Rini :
> On Fri, Oct 13, 2017 at 09:21:19PM +0900, Masahiro Yamada wrote:
>> 2017-10-13 21:11 GMT+09:00 Tom Rini :
>> > On Fri, Oct 13, 2017 at 06:51:42PM +0900, Masahiro Yamada wrote:
>> >
>> >> We discussed the __FILE__ problem when U-Boot is built out of tree.
>> >> https://www.mail-archive.com/u-boot@lists.denx.de/msg242852.html
>> >>
>> >> The deeper your build directory is located, the larger
>> >> your U-Boot image becomes.
>> >> If your platform has memory footprint limit, this is a problem.
>> >>
>> >> Recently, I submitted the following patches to Kbuild ML.
>> >> (no RFC, this time)
>> >> https://patchwork.kernel.org/patch/10001419/
>> >> https://patchwork.kernel.org/patch/10001409/
>> >>
>> >> I consider them for Linux 4.15 unless there is
>> >> a strong objection or a problem report.
>> >>
>> >> This series is a port for U-Boot.
>> >>
>> >> If Tom wants to pick this up earlier, it is OK.
>> >> If not in hurry, you can wait for the activity in Linux.
>> >> Either will do.
>> >
>> > Yay.  I plan to pick these up after v2017.11 has been released, so no
>> > need to re-spin this if it stops applying cleanly until we're closer to
>> > release.  Thanks!
>> >
>>
>> Good.
>>
>> According to this:
>> http://phb-crystal-ball.org/
>>
>> The MW for v4.15 will open 2017-11-12.
>>
>> So, the next MW for U-Boot and Linux will be almost lined up.
>>
>> You will be able to apply it more confidently
>> if Linus pulls the Linux counterpart.
>>
>> Until then, I will test it in linux-next.
>
> FWIW, a world build is:
> https://gist.github.com/trini/ad0f55b9f46997fd11801aac48bf0c10
>
> I wonder why we see size increase in a few cases?  In both cases, the
> obj directory is /tmp/something/01_of_.. (or 04_of_..)/current/..
>


Figured out.


This patch changes the string in some places
where BUG() etc. is used in functions
included from another .c file.

For example,

drivers/usb/gadget/composite.c is included from
drivers/usb/gadget/g_dnl.c


The BUG_ON() in composite_unbind(),
previously printed drivers/usb/gadget/composite.c,
but will print drivers/usb/gadget/g_dnl.c with this patch.

This is the cause of slight increase/decrease.

Then, I do not have a solution...




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


Re: [U-Boot] [PATCH v3 1/7] spl: fix assignment of board info to global data

2017-10-13 Thread York Sun
On 09/28/2017 08:42 AM, York Sun wrote:
> Commit 15eb1d43bf47 ("spl: reorder the assignment of board info to
> global data") intended to move assignment of board info earlier,
> into board_init_r(). However, function preload_console_init() is
> called either from spl_board_init() or from board_init_f(). For the
> latter case, the board info assignment is much earlier than proposed
> board_init_r(). Create a new function to fill gd->bd and call this
> function when needed.
> 
> Signed-off-by: York Sun 
> CC: Lokesh Vutla 
> CC: Ravi Babu 
> CC: Lukasz Majewski 
> CC: Tom Rini 
> 
> ---
> 
> Changes in v3:
> Create new function to fill gd->bd for spl.
> Use git commit description style when mentioning previous commit.
> 
> Changes in v2:
> New patch to fix spl after rebasing to latest master.
> 

This set is applied to fsl-qoriq master.

York

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


Re: [U-Boot] [PATCH v2] armv8: ls1088a: Update MC boot sequence

2017-10-13 Thread York Sun
On 10/04/2017 11:57 PM, Bogdan Purcareata wrote:
> The MC boot sequence is contained in mc_env_boot. Update LS1088A boards
> to use this function, and hook it to reset_phy so that it's called late
> enough, after the ports have been initialized, for proper DPC / DPL
> fixup.
> 
> Signed-off-by: Bogdan Purcareata 
> ---
> This patch follows the work of previous commits:
> 5707dfb02e drivers: net: fsl-mc: Fixup MAC addresses in DPC
> 33a8991a87 drivers: net: fsl-mc: Link MC boot to PHY_RESET_R
> 1161dbcc0a drivers: net: fsl-mc: Include MAC addr fixup to DPL
> 
> v1 -> v2:
> - Refactor commit message
>


Applied to fsl-qoriq master. Thanks.

York

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


Re: [U-Boot] [PATCH] armv8: fsl-layerscape: Allocate Secure memory from first ddr region

2017-10-13 Thread York Sun
On 10/03/2017 03:16 AM, Sumit Garg wrote:
> This change is required due to trusted OS (OP-TEE) not being position
> independent code, it requires compile time fixed base address.
> 
> To take care of this it is assumed that all layerscape armv8 platforms
> has minimum 2G ddr in first region. So we can have fixed address
> space (66 MB -> (2MB for PPA + 64MB for trusted OS)) allocated from
> top of first 2G ddr region and compile trusted OS with this fixed
> base address.
> 
> But one exception here is ls1012 where we have only 1G (rdb) or 512M
> (frdm) ddr memory. For those we can have different fixed compile time
> base addresses for trusted OS.
> 
> Signed-off-by: Sumit Garg 
> ---
> 
> Tested on ls1012ardb, ls1043ardb, ls1046ardb, ls2088ardb, ls1088ardb.
> 

Applied to fsl-qoriq master. Thanks.

York

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


Re: [U-Boot] [PATCH] ls1021aiot: Move CONFIG_CMD_BOOTZ to Kconfig

2017-10-13 Thread York Sun
On 09/28/2017 09:24 AM, Fabio Estevam wrote:
> CONFIG_CMD_BOOTZ symbol does not work in board config file
> anymore, so fix this by moving it to Kconfig.
> 
> Signed-off-by: Fabio Estevam 
> ---


Applied to fsl-qoriq master. Thanks.

York

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


Re: [U-Boot] [PATCH] armv8: Apply workaround for USB erratum A-009007 to LS1088A

2017-10-13 Thread York Sun
On 09/22/2017 12:39 AM, Ran Wang wrote:
> Rx Compliance tests may fail intermittently at high
> jitter frequencies using default register values.
> 
> Program register USB_PHY_RX_OVRD_IN_HI in certain sequence
> to make the Rx compliance test pass.
> 
> Signed-off-by: Ran Wang 
> ---


Applied to fsl-qoriq master. Thanks.

York


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


Re: [U-Boot] [PATCH] armv8: ls1046aqds: Fix NAND offset for Fman ucode and env

2017-10-13 Thread York Sun
On 09/18/2017 02:16 AM, Gong Qianyu wrote:
> Fix a bug of 'commit 8104deb2d6b7 ("armv8: layerscape: Adjust memory
> mapping for Flash/SD card on LS1046A")' as NAND block size is
> 256KB on LS1046AQDS.
> 
> Signed-off-by: Gong Qianyu 
> ---

Applied to fsl-qoriq master. Thanks.

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


Re: [U-Boot] [PATCH v2 0/3] kbuild: always use relative path for __FILE__

2017-10-13 Thread Masahiro Yamada
2017-10-13 22:53 GMT+09:00 Tom Rini :
> On Fri, Oct 13, 2017 at 09:21:19PM +0900, Masahiro Yamada wrote:
>> 2017-10-13 21:11 GMT+09:00 Tom Rini :
>> > On Fri, Oct 13, 2017 at 06:51:42PM +0900, Masahiro Yamada wrote:
>> >
>> >> We discussed the __FILE__ problem when U-Boot is built out of tree.
>> >> https://www.mail-archive.com/u-boot@lists.denx.de/msg242852.html
>> >>
>> >> The deeper your build directory is located, the larger
>> >> your U-Boot image becomes.
>> >> If your platform has memory footprint limit, this is a problem.
>> >>
>> >> Recently, I submitted the following patches to Kbuild ML.
>> >> (no RFC, this time)
>> >> https://patchwork.kernel.org/patch/10001419/
>> >> https://patchwork.kernel.org/patch/10001409/
>> >>
>> >> I consider them for Linux 4.15 unless there is
>> >> a strong objection or a problem report.
>> >>
>> >> This series is a port for U-Boot.
>> >>
>> >> If Tom wants to pick this up earlier, it is OK.
>> >> If not in hurry, you can wait for the activity in Linux.
>> >> Either will do.
>> >
>> > Yay.  I plan to pick these up after v2017.11 has been released, so no
>> > need to re-spin this if it stops applying cleanly until we're closer to
>> > release.  Thanks!
>> >
>>
>> Good.
>>
>> According to this:
>> http://phb-crystal-ball.org/
>>
>> The MW for v4.15 will open 2017-11-12.
>>
>> So, the next MW for U-Boot and Linux will be almost lined up.
>>
>> You will be able to apply it more confidently
>> if Linus pulls the Linux counterpart.
>>
>> Until then, I will test it in linux-next.
>
> FWIW, a world build is:
> https://gist.github.com/trini/ad0f55b9f46997fd11801aac48bf0c10
>
> I wonder why we see size increase in a few cases?  In both cases, the
> obj directory is /tmp/something/01_of_.. (or 04_of_..)/current/..
>


Hmm, this patch seems buggy.

At least, it is not working at all for SPL.

I will take a look.





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


[U-Boot] [PATCH v2 4/9] efi_loader: new function utf8_to_utf16

2017-10-13 Thread Heinrich Schuchardt
Provide a conversion function from utf8 to utf16.

Add missing #include  in include/charset.h.
Remove superfluous #include  in lib/charset.c.

Signed-off-by: Heinrich Schuchardt 
---
v2
new patch
---
 include/charset.h | 15 +++
 lib/charset.c | 57 ++-
 2 files changed, 71 insertions(+), 1 deletion(-)

diff --git a/include/charset.h b/include/charset.h
index 37a3278499..2662c2f7c9 100644
--- a/include/charset.h
+++ b/include/charset.h
@@ -9,6 +9,8 @@
 #ifndef __CHARSET_H_
 #define __CHARSET_H_
 
+#include 
+
 #define MAX_UTF8_PER_UTF16 3
 
 /**
@@ -62,4 +64,17 @@ uint16_t *utf16_strdup(const uint16_t *s);
  */
 uint8_t *utf16_to_utf8(uint8_t *dest, const uint16_t *src, size_t size);
 
+/**
+ * utf8_to_utf16() - Convert an utf8 string to utf16
+ *
+ * Converts up to 'size' characters of the utf16 string 'src' to utf8
+ * written to the 'dest' buffer. Stops at 0x00.
+ *
+ * @dest   the destination buffer to write the utf8 characters
+ * @srcthe source utf16 string
+ * @size   maximum number of utf16 characters to convert
+ * @return the pointer to the first unwritten byte in 'dest'
+ */
+uint16_t *utf8_to_utf16(uint16_t *dest, const uint8_t *src, size_t size);
+
 #endif /* __CHARSET_H_ */
diff --git a/lib/charset.c b/lib/charset.c
index ff76e88c77..8cd17ea1cb 100644
--- a/lib/charset.c
+++ b/lib/charset.c
@@ -6,7 +6,6 @@
  *  SPDX-License-Identifier: GPL-2.0+
  */
 
-#include 
 #include 
 #include 
 
@@ -99,3 +98,59 @@ uint8_t *utf16_to_utf8(uint8_t *dest, const uint16_t *src, 
size_t size)
 
return dest;
 }
+
+uint16_t *utf8_to_utf16(uint16_t *dest, const uint8_t *src, size_t size)
+{
+   while (size--) {
+   int extension_bytes;
+   uint32_t code;
+
+   extension_bytes = 0;
+   if (*src <= 0x7f) {
+   code = *src++;
+   /* Exit on zero byte */
+   if (!code)
+   size = 0;
+   } else if (*src <= 0xbf) {
+   /* Illegal code */
+   code = '?';
+   } else if (*src <= 0xdf) {
+   code = *src++ & 0x1f;
+   extension_bytes = 1;
+   } else if (*src <= 0xef) {
+   code = *src++ & 0x0f;
+   extension_bytes = 2;
+   } else if (*src <= 0xf7) {
+   code = *src++ & 0x07;
+   extension_bytes = 3;
+   } else {
+   /* Illegal code */
+   code = '?';
+   }
+
+   for (; extension_bytes && size; --size, --extension_bytes) {
+   if ((*src & 0xc0) == 0x80) {
+   code <<= 6;
+   code |= *src++ & 0x3f;
+   } else {
+   /* Illegal code */
+   code = '?';
+   ++src;
+   --size;
+   break;
+   }
+   }
+
+   if (code < 0x1) {
+   *dest++ = code;
+   } else {
+   /*
+* Simplified expression for
+* (((code - 0x1) >> 10) & 0x3ff) | 0xd800
+*/
+   *dest++ = (code >> 10) + 0xd7c0;
+   *dest++ = (code & 0x3ff) | 0xdc00;
+   }
+   }
+   return dest;
+}
-- 
2.14.1

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


[U-Boot] [PATCH v2 7/9] efi_selftest: test reboot by watchdog

2017-10-13 Thread Heinrich Schuchardt
A test is added that verifies that the watchdog timer actually
causes a reboot upon timeout. The test in only executed on
request using

bootefi selftest 'watchdog reboot'

Signed-off-by: Heinrich Schuchardt 
---
v2
no change
---
 lib/efi_selftest/efi_selftest_watchdog.c | 65 +++-
 1 file changed, 55 insertions(+), 10 deletions(-)

diff --git a/lib/efi_selftest/efi_selftest_watchdog.c 
b/lib/efi_selftest/efi_selftest_watchdog.c
index f8c5404000..a2c11ab1b9 100644
--- a/lib/efi_selftest/efi_selftest_watchdog.c
+++ b/lib/efi_selftest/efi_selftest_watchdog.c
@@ -5,11 +5,15 @@
  *
  * SPDX-License-Identifier: GPL-2.0+
  *
- * This unit test checks that the watchdog timer will not cause
- * a system restart during the timeout period after a timer reset.
+ * The 'watchdog timer' unit test checks that the watchdog timer
+ * will not cause a system restart during the timeout period after
+ * a timer reset.
  *
- * Testing that the watchdog timer actually will reset the system
- * after a timeout is not possible within the used framework.
+ * The 'watchdog reboot' unit test checks that the watchdog timer
+ * actually reboots the system after a timeout. The test is only
+ * executed on explicit request. Use the following command:
+ *
+ * bootefi selftest 'watchdog reboot'
  */
 
 #include 
@@ -28,6 +32,7 @@ static struct efi_event *event_notify;
 static struct efi_event *event_wait;
 static struct efi_boot_services *boottime;
 static struct notify_context notification_context;
+static bool watchdog_reset;
 
 /*
  * Notification function, increments the notfication count if parameter
@@ -88,6 +93,34 @@ static int setup(const efi_handle_t handle,
return EFI_ST_SUCCESS;
 }
 
+/*
+ * Execute the test resetting the watchdog in a timely manner. No reboot 
occurs.
+ *
+ * @handle:handle of the loaded image
+ * @systable:  system table
+ * @return:EFI_ST_SUCCESS for success
+ */
+static int setup_timer(const efi_handle_t handle,
+  const struct efi_system_table *systable)
+{
+   watchdog_reset = true;
+   return setup(handle, systable);
+}
+
+/*
+ * Execute the test without resetting the watchdog. A system reboot occurs.
+ *
+ * @handle:handle of the loaded image
+ * @systable:  system table
+ * @return:EFI_ST_SUCCESS for success
+ */
+static int setup_reboot(const efi_handle_t handle,
+   const struct efi_system_table *systable)
+{
+   watchdog_reset = false;
+   return setup(handle, systable);
+}
+
 /*
  * Tear down unit test.
  *
@@ -146,11 +179,14 @@ static int execute(void)
efi_st_error("Setting watchdog timer failed\n");
return EFI_ST_FAILURE;
}
+   if (watchdog_reset) {
/* Set 600 ms timer */
-   ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC, 600);
-   if (ret != EFI_SUCCESS) {
-   efi_st_error("Could not set timer\n");
-   return EFI_ST_FAILURE;
+   ret = boottime->set_timer(event_notify, EFI_TIMER_PERIODIC,
+ 600);
+   if (ret != EFI_SUCCESS) {
+   efi_st_error("Could not set timer\n");
+   return EFI_ST_FAILURE;
+   }
}
/* Set 1350 ms timer */
ret = boottime->set_timer(event_wait, EFI_TIMER_RELATIVE, 1350);
@@ -176,10 +212,19 @@ static int execute(void)
return EFI_ST_SUCCESS;
 }
 
-EFI_UNIT_TEST(watchdog) = {
+EFI_UNIT_TEST(watchdog1) = {
.name = "watchdog timer",
.phase = EFI_EXECUTE_BEFORE_BOOTTIME_EXIT,
-   .setup = setup,
+   .setup = setup_timer,
+   .execute = execute,
+   .teardown = teardown,
+};
+
+EFI_UNIT_TEST(watchdog2) = {
+   .name = "watchdog reboot",
+   .phase = EFI_EXECUTE_BEFORE_BOOTTIME_EXIT,
+   .setup = setup_reboot,
.execute = execute,
.teardown = teardown,
+   .on_request = true,
 };
-- 
2.14.1

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


[U-Boot] [PATCH v2 9/9] test/py: fix typo in test_efi_loader.py

2017-10-13 Thread Heinrich Schuchardt
Make a comment line easier to read.

Signed-off-by: Heinrich Schuchardt 
---
v2
no change
---
 test/py/tests/test_efi_loader.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/py/tests/test_efi_loader.py b/test/py/tests/test_efi_loader.py
index 5d7f5dbfb2..4d391e13ef 100644
--- a/test/py/tests/test_efi_loader.py
+++ b/test/py/tests/test_efi_loader.py
@@ -12,7 +12,7 @@ import u_boot_utils
 
 """
 Note: This test relies on boardenv_* containing configuration values to define
-which the network environment available for testing. Without this, the parts
+which network environment is available for testing. Without this, the parts
 that rely on network will be automatically skipped.
 
 For example:
-- 
2.14.1

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


[U-Boot] [PATCH v2 0/9] efi_loader: implement SetWatchdogTimer

2017-10-13 Thread Heinrich Schuchardt
The patch series is centered on implementing the SetWatchdogTimer
boottime service. Two tests are supplied. One that checks that
resetting the watchdog timer saves from a reboot. The other
checks that the watchdog timer actually leads to a reset.
Both are covered by Python test cases.

Additional fixes include missing comments and fixing typos.

Heinrich Schuchardt (9):
  efi_loader: move efi_search_obj up in code
  efi_loader: implement SetWatchdogTimer
  efi_selftest: provide test for watchdog timer
  efi_loader: new function utf8_to_utf16
  efi_loader: guard against double inclusion of efi_loader.h
  efi_selftest: allow to select a single test for exexution
  efi_selftest: test reboot by watchdog
  test/py: test reboot by EFI watchdog
  test/py: fix typo in test_efi_loader.py

 cmd/bootefi.c|  47 ++-
 include/charset.h|  15 ++
 include/efi_loader.h |  11 +-
 include/efi_selftest.h   |  18 +++
 lib/charset.c|  57 +++-
 lib/efi_loader/Makefile  |   2 +-
 lib/efi_loader/efi_boottime.c|  58 
 lib/efi_loader/efi_watchdog.c|  86 
 lib/efi_selftest/Makefile|   5 +-
 lib/efi_selftest/efi_selftest.c  |  89 +++-
 lib/efi_selftest/efi_selftest_console.c  |  11 ++
 lib/efi_selftest/efi_selftest_util.c |  11 +-
 lib/efi_selftest/efi_selftest_watchdog.c | 230 +++
 test/py/tests/test_efi_loader.py |   2 +-
 test/py/tests/test_efi_selftest.py   |  14 +-
 15 files changed, 609 insertions(+), 47 deletions(-)
 create mode 100644 lib/efi_loader/efi_watchdog.c
 create mode 100644 lib/efi_selftest/efi_selftest_watchdog.c

-- 
2.14.1

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


[U-Boot] [PATCH v2 6/9] efi_selftest: allow to select a single test for exexution

2017-10-13 Thread Heinrich Schuchardt
Environment variable efi_selftest is passed as load options
to the selftest application. It is used to select a single
test to be executed.

Special value 'list' displays a list of all available tests.

Tests get an on_request property. If this property is set
the tests are only executed if explicitly requested.

The invocation of efi_selftest is changed to reflect that
bootefi selftest with efi_selftest = 'list' will call the
Exit bootservice.

Environment variable bootargs is used as load options
for all other bootefi payloads.

Signed-off-by: Heinrich Schuchardt 
---
v2
use an environment variable to choose a test
---
 cmd/bootefi.c   | 46 -
 include/efi_selftest.h  | 18 +++
 lib/efi_selftest/efi_selftest.c | 90 +++--
 lib/efi_selftest/efi_selftest_console.c | 10 
 lib/efi_selftest/efi_selftest_util.c| 11 +++-
 5 files changed, 168 insertions(+), 7 deletions(-)

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 18176a1266..2d70137482 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -6,10 +6,12 @@
  *  SPDX-License-Identifier: GPL-2.0+
  */
 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -50,6 +52,32 @@ static void efi_init_obj_list(void)
efi_get_time_init();
 }
 
+/*
+ * Set the load options of an image from an environment variable.
+ *
+ * @loaded_image_info: the image
+ * @env_var:   name of the environment variable
+ */
+static void set_load_options(struct efi_loaded_image *loaded_image_info,
+const char *env_var)
+{
+   size_t size;
+   const char *env = env_get(env_var);
+
+   loaded_image_info->load_options = NULL;
+   loaded_image_info->load_options_size = 0;
+   if (!env)
+   return;
+   size = strlen(env) + 1;
+   loaded_image_info->load_options = calloc(size, sizeof(u16));
+   if (!loaded_image_info->load_options) {
+   printf("ERROR: Out of memory\n");
+   return;
+   }
+   utf8_to_utf16(loaded_image_info->load_options, (u8 *)env, size);
+   loaded_image_info->load_options_size = size * 2;
+}
+
 static void *copy_fdt(void *fdt)
 {
u64 fdt_size = fdt_totalsize(fdt);
@@ -190,6 +218,8 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt,
efi_install_configuration_table(_guid, NULL);
}
 
+   /* Transfer environment variable bootargs as load options */
+   set_load_options(_image_info, "bootargs");
/* Load the EFI payload */
entry = efi_load_pe(efi, _image_info);
if (!entry) {
@@ -237,6 +267,7 @@ static unsigned long do_bootefi_exec(void *efi, void *fdt,
 
 exit:
/* image has returned, loaded-image obj goes *poof*: */
+   free(loaded_image_info.load_options);
list_del(_image_info_obj.link);
 
return ret;
@@ -301,17 +332,26 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int 
argc, char * const argv[])
 
efi_setup_loaded_image(_image_info,
   _image_info_obj,
-  bootefi_device_path, bootefi_image_path);
+  NULL, NULL);
/*
 * gd lives in a fixed register which may get clobbered while we
 * execute the payload. So save it here and restore it on every
 * callback entry
 */
efi_save_gd();
+   loaded_image_info.image_code_type = EFI_LOADER_CODE;
+   loaded_image_info.image_data_type = EFI_LOADER_DATA;
/* Initialize and populate EFI object list */
if (!efi_obj_list_initalized)
efi_init_obj_list();
-   return efi_selftest(_image_info, );
+   /* Transfer environment variable efi_selftest as load options */
+   set_load_options(_image_info, "efi_selftest");
+   /* Execute the test */
+   r = efi_selftest(_image_info, );
+   efi_restore_gd();
+   free(loaded_image_info.load_options);
+   list_del(_image_info_obj.link);
+   return r;
} else
 #endif
if (!strcmp(argv[1], "bootmgr")) {
@@ -357,6 +397,8 @@ static char bootefi_help_text[] =
 #ifdef CONFIG_CMD_BOOTEFI_SELFTEST
"bootefi selftest\n"
"  - boot an EFI selftest application stored within U-Boot\n"
+   "Use environment variable efi_selftest to select a single test.\n"
+   "Use 'setenv efi_selftest list' to enumerate all tests.\n"
 #endif
"bootmgr [fdt addr]\n"
"  - load and boot EFI payload based on BootOrder/Boot variables.\n"
diff --git a/include/efi_selftest.h b/include/efi_selftest.h
index 7ec42a0406..978ca2a7ea 100644
--- a/include/efi_selftest.h
+++ 

[U-Boot] [PATCH v2 8/9] test/py: test reboot by EFI watchdog

2017-10-13 Thread Heinrich Schuchardt
Clear environment variable efi_selftest before executing the
default tests.

Provide a test verifying that the EFI watchdog
reboots the system upon timeout.

The test depends on CONFIG_CMD_EFI_SELFTEST=y.

Signed-off-by: Heinrich Schuchardt 
---
v2
choose test via environment variable
---
 test/py/tests/test_efi_selftest.py | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/test/py/tests/test_efi_selftest.py 
b/test/py/tests/test_efi_selftest.py
index 76e282a6c7..66b799bed6 100644
--- a/test/py/tests/test_efi_selftest.py
+++ b/test/py/tests/test_efi_selftest.py
@@ -1,4 +1,3 @@
-# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
 # Copyright (c) 2017, Heinrich Schuchardt 
 #
 # SPDX-License-Identifier: GPL-2.0
@@ -14,6 +13,7 @@ def test_efi_selftest(u_boot_console):
Run bootefi selftest
"""
 
+   u_boot_console.run_command(cmd='setenv efi_selftest')
u_boot_console.run_command(cmd='bootefi selftest', 
wait_for_prompt=False)
m = u_boot_console.p.expect(['Summary: 0 failures', 'Press any key'])
if m != 0:
@@ -23,3 +23,15 @@ def test_efi_selftest(u_boot_console):
if m != 0:
raise Exception('Reset failed during the EFI selftest')
u_boot_console.restart_uboot();
+
+@pytest.mark.buildconfigspec('cmd_bootefi_selftest')
+def test_efi_selftest_watchdog_reboot(u_boot_console):
+   u_boot_console.run_command(cmd='setenv efi_selftest list')
+   output = u_boot_console.run_command('bootefi selftest')
+   assert '\'watchdog reboot\'' in output
+   u_boot_console.run_command(cmd='setenv efi_selftest watchdog reboot')
+   u_boot_console.run_command(cmd='bootefi selftest', 
wait_for_prompt=False)
+   m = u_boot_console.p.expect(['resetting', 'U-Boot'])
+   if m != 0:
+   raise Exception('Reset failed in \'watchdog reboot\' test')
+   u_boot_console.restart_uboot();
-- 
2.14.1

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


[U-Boot] [PATCH v2 3/9] efi_selftest: provide test for watchdog timer

2017-10-13 Thread Heinrich Schuchardt
The test verifies that resetting the watchdog timer ensures
that it is not called during the timeout period.

Testing that the watchdog timer actually executes a reset
would require a test outside the efi_selftest framework.

Signed-off-by: Heinrich Schuchardt 
---
v2
no change
---
 lib/efi_selftest/Makefile|   5 +-
 lib/efi_selftest/efi_selftest_watchdog.c | 185 +++
 2 files changed, 189 insertions(+), 1 deletion(-)
 create mode 100644 lib/efi_selftest/efi_selftest_watchdog.c

diff --git a/lib/efi_selftest/Makefile b/lib/efi_selftest/Makefile
index e446046e02..3e5c9a6d16 100644
--- a/lib/efi_selftest/Makefile
+++ b/lib/efi_selftest/Makefile
@@ -21,6 +21,8 @@ CFLAGS_efi_selftest_tpl.o := $(CFLAGS_EFI)
 CFLAGS_REMOVE_efi_selftest_tpl.o := $(CFLAGS_NON_EFI)
 CFLAGS_efi_selftest_util.o := $(CFLAGS_EFI)
 CFLAGS_REMOVE_efi_selftest_util.o := $(CFLAGS_NON_EFI)
+CFLAGS_efi_selftest_watchdog.o := $(CFLAGS_EFI)
+CFLAGS_REMOVE_efi_selftest_watchdog.o := $(CFLAGS_NON_EFI)
 
 obj-$(CONFIG_CMD_BOOTEFI_SELFTEST) += \
 efi_selftest.o \
@@ -29,4 +31,5 @@ efi_selftest_events.o \
 efi_selftest_exitbootservices.o \
 efi_selftest_snp.o \
 efi_selftest_tpl.o \
-efi_selftest_util.o
+efi_selftest_util.o \
+efi_selftest_watchdog.o
diff --git a/lib/efi_selftest/efi_selftest_watchdog.c 
b/lib/efi_selftest/efi_selftest_watchdog.c
new file mode 100644
index 00..f8c5404000
--- /dev/null
+++ b/lib/efi_selftest/efi_selftest_watchdog.c
@@ -0,0 +1,185 @@
+/*
+ * efi_selftest_watchdog
+ *
+ * Copyright (c) 2017 Heinrich Schuchardt 
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * This unit test checks that the watchdog timer will not cause
+ * a system restart during the timeout period after a timer reset.
+ *
+ * Testing that the watchdog timer actually will reset the system
+ * after a timeout is not possible within the used framework.
+ */
+
+#include 
+
+/*
+ * This is the communication structure for the notification function.
+ */
+struct notify_context {
+   /* Status code returned when resetting watchdog */
+   efi_status_t status;
+   /* Number of invocations of the notification function */
+   unsigned int timer_ticks;
+};
+
+static struct efi_event *event_notify;
+static struct efi_event *event_wait;
+static struct efi_boot_services *boottime;
+static struct notify_context notification_context;
+
+/*
+ * Notification function, increments the notfication count if parameter
+ * context is provided.
+ *
+ * @event  notified event
+ * @contextpointer to the timeout
+ */
+static void EFIAPI notify(struct efi_event *event, void *context)
+{
+   struct notify_context *notify_context = context;
+   efi_status_t ret = EFI_SUCCESS;
+
+   if (!notify_context)
+   return;
+
+   /* Reset watchdog timer to one second */
+   ret = boottime->set_watchdog_timer(1, 0, 0, NULL);
+   if (ret != EFI_SUCCESS)
+   notify_context->status = ret;
+   /* Count number of calls */
+   notify_context->timer_ticks++;
+}
+
+/*
+ * Setup unit test.
+ *
+ * Create two timer events.
+ * One with EVT_NOTIFY_SIGNAL, the other with EVT_NOTIFY_WAIT.
+ *
+ * @handle:handle of the loaded image
+ * @systable:  system table
+ * @return:EFI_ST_SUCCESS for success
+ */
+static int setup(const efi_handle_t handle,
+const struct efi_system_table *systable)
+{
+   efi_status_t ret;
+
+   boottime = systable->boottime;
+
+   notification_context.status = EFI_SUCCESS;
+   notification_context.timer_ticks = 0;
+   ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_SIGNAL,
+TPL_CALLBACK, notify,
+(void *)_context,
+_notify);
+   if (ret != EFI_SUCCESS) {
+   efi_st_error("could not create event\n");
+   return EFI_ST_FAILURE;
+   }
+   ret = boottime->create_event(EVT_TIMER | EVT_NOTIFY_WAIT,
+TPL_CALLBACK, notify, NULL, _wait);
+   if (ret != EFI_SUCCESS) {
+   efi_st_error("could not create event\n");
+   return EFI_ST_FAILURE;
+   }
+   return EFI_ST_SUCCESS;
+}
+
+/*
+ * Tear down unit test.
+ *
+ * Close the events created in setup.
+ *
+ * @return:EFI_ST_SUCCESS for success
+ */
+static int teardown(void)
+{
+   efi_status_t ret;
+
+   /* Set the watchdog timer to the five minute default value */
+   ret = boottime->set_watchdog_timer(300, 0, 0, NULL);
+   if (ret != EFI_SUCCESS) {
+   efi_st_error("Setting watchdog timer failed\n");
+   return EFI_ST_FAILURE;
+   }
+   if (event_notify) {
+   ret = boottime->close_event(event_notify);
+   event_notify = NULL;
+   if (ret != EFI_SUCCESS) {
+   efi_st_error("Could not close 

[U-Boot] [PATCH v2 5/9] efi_loader: guard against double inclusion of efi_loader.h

2017-10-13 Thread Heinrich Schuchardt
Use a define to detect double inclusion of efi_loader.h.

Signed-off-by: Heinrich Schuchardt 
---
v2
new patch
---
 include/efi_loader.h | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index af64b11cee..e506eeec61 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -6,6 +6,9 @@
  *  SPDX-License-Identifier: GPL-2.0+
  */
 
+#ifndef _EFI_LOADER_H
+#define _EFI_LOADER_H 1
+
 #include 
 #include 
 #include 
@@ -345,4 +348,6 @@ static inline void efi_set_bootdev(const char *dev, const 
char *devnr,
   const char *path) { }
 static inline void efi_net_set_dhcp_ack(void *pkt, int len) { }
 
-#endif
+#endif /* CONFIG_EFI_LOADER && !CONFIG_SPL_BUILD */
+
+#endif /* _EFI_LOADER_H */
-- 
2.14.1

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


[U-Boot] [PATCH v2 1/9] efi_loader: move efi_search_obj up in code

2017-10-13 Thread Heinrich Schuchardt
To avoid a forward declaration move efi_search_obj before
all protocol services functions.

Signed-off-by: Heinrich Schuchardt 
---
v2
no change
---
 lib/efi_loader/efi_boottime.c | 41 +
 1 file changed, 21 insertions(+), 20 deletions(-)

diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index f627340de4..30577f717e 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -690,6 +690,27 @@ static efi_status_t EFIAPI efi_check_event(struct 
efi_event *event)
return EFI_EXIT(EFI_INVALID_PARAMETER);
 }
 
+/*
+ * Find the internal EFI object for a handle.
+ *
+ * @handle handle to find
+ * @return EFI object
+ */
+static struct efi_object *efi_search_obj(void *handle)
+{
+   struct list_head *lhandle;
+
+   list_for_each(lhandle, _obj_list) {
+   struct efi_object *efiobj;
+
+   efiobj = list_entry(lhandle, struct efi_object, link);
+   if (efiobj->handle == handle)
+   return efiobj;
+   }
+
+   return NULL;
+}
+
 /*
  * Install protocol interface.
  *
@@ -1355,26 +1376,6 @@ static efi_status_t EFIAPI efi_exit(efi_handle_t 
image_handle,
panic("EFI application exited");
 }
 
-/*
- * Find the internal EFI object for a handle.
- *
- * @handle handle to find
- * @return EFI object
- */
-static struct efi_object *efi_search_obj(void *handle)
-{
-   struct list_head *lhandle;
-
-   list_for_each(lhandle, _obj_list) {
-   struct efi_object *efiobj;
-   efiobj = list_entry(lhandle, struct efi_object, link);
-   if (efiobj->handle == handle)
-   return efiobj;
-   }
-
-   return NULL;
-}
-
 /*
  * Unload an EFI image.
  *
-- 
2.14.1

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


[U-Boot] [PATCH v2 2/9] efi_loader: implement SetWatchdogTimer

2017-10-13 Thread Heinrich Schuchardt
The watchdog is initialized with a 5 minute timeout period.
It can be reset by SetWatchdogTimer.
It is stopped by ExitBoottimeServices.

Signed-off-by: Heinrich Schuchardt 
---
v2
code comments updated
---
 cmd/bootefi.c |  1 +
 include/efi_loader.h  |  4 ++
 lib/efi_loader/Makefile   |  2 +-
 lib/efi_loader/efi_boottime.c | 17 ++---
 lib/efi_loader/efi_watchdog.c | 86 +++
 5 files changed, 95 insertions(+), 15 deletions(-)
 create mode 100644 lib/efi_loader/efi_watchdog.c

diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index 478bc116e2..18176a1266 100644
--- a/cmd/bootefi.c
+++ b/cmd/bootefi.c
@@ -43,6 +43,7 @@ static void efi_init_obj_list(void)
 #ifdef CONFIG_GENERATE_SMBIOS_TABLE
efi_smbios_register();
 #endif
+   efi_watchdog_register();
 
/* Initialize EFI runtime services */
efi_reset_system_init();
diff --git a/include/efi_loader.h b/include/efi_loader.h
index 1b92edbd77..af64b11cee 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -163,6 +163,8 @@ int efi_disk_register(void);
 int efi_gop_register(void);
 /* Called by bootefi to make the network interface available */
 int efi_net_register(void);
+/* Called by bootefi to make the watchdog available */
+int efi_watchdog_register(void);
 /* Called by bootefi to make SMBIOS tables available */
 void efi_smbios_register(void);
 
@@ -171,6 +173,8 @@ efi_fs_from_path(struct efi_device_path *fp);
 
 /* Called by networking code to memorize the dhcp ack package */
 void efi_net_set_dhcp_ack(void *pkt, int len);
+/* Called by efi_set_watchdog_timer to reset the timer */
+efi_status_t efi_set_watchdog(unsigned long timeout);
 
 /* Called from places to check whether a timer expired */
 void efi_timer_check(void);
diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
index ddb978f650..83d879b686 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -17,7 +17,7 @@ endif
 obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o
 obj-y += efi_image_loader.o efi_boottime.o efi_runtime.o efi_console.o
 obj-y += efi_memory.o efi_device_path_to_text.o efi_device_path.o
-obj-y += efi_file.o efi_variable.o efi_bootmgr.o
+obj-y += efi_file.o efi_variable.o efi_bootmgr.o efi_watchdog.o
 obj-$(CONFIG_LCD) += efi_gop.o
 obj-$(CONFIG_DM_VIDEO) += efi_gop.o
 obj-$(CONFIG_PARTITIONS) += efi_disk.o
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 30577f717e..fd8d15655b 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -155,18 +155,6 @@ void efi_signal_event(struct efi_event *event)
event->is_queued = false;
 }
 
-/*
- * Write a debug message for an EPI API service that is not implemented yet.
- *
- * @funcname   function that is not yet implemented
- * @return EFI_UNSUPPORTED
- */
-static efi_status_t efi_unsupported(const char *funcname)
-{
-   debug("EFI: App called into unimplemented function %s\n", funcname);
-   return EFI_EXIT(EFI_UNSUPPORTED);
-}
-
 /*
  * Raise the task priority level.
  *
@@ -1454,6 +1442,7 @@ static efi_status_t EFIAPI efi_exit_boot_services(void 
*image_handle,
bootm_disable_interrupts();
 
/* Give the payload some time to boot */
+   efi_set_watchdog(0);
WATCHDOG_RESET();
 
return EFI_EXIT(EFI_SUCCESS);
@@ -1497,7 +1486,7 @@ static efi_status_t EFIAPI efi_stall(unsigned long 
microseconds)
 /*
  * Reset the watchdog timer.
  *
- * This function implements the WatchdogTimer service.
+ * This function implements the SetWatchdogTimer service.
  * See the Unified Extensible Firmware Interface (UEFI) specification
  * for details.
  *
@@ -1514,7 +1503,7 @@ static efi_status_t EFIAPI 
efi_set_watchdog_timer(unsigned long timeout,
 {
EFI_ENTRY("%ld, 0x%"PRIx64", %ld, %p", timeout, watchdog_code,
  data_size, watchdog_data);
-   return efi_unsupported(__func__);
+   return EFI_EXIT(efi_set_watchdog(timeout));
 }
 
 /*
diff --git a/lib/efi_loader/efi_watchdog.c b/lib/efi_loader/efi_watchdog.c
new file mode 100644
index 00..eb437faf4b
--- /dev/null
+++ b/lib/efi_loader/efi_watchdog.c
@@ -0,0 +1,86 @@
+/*
+ *  EFI watchdog
+ *
+ *  Copyright (c) 2017 Heinrich Schuchardt
+ *
+ *  SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include 
+#include 
+
+static struct efi_event *watchdog_timer_event;
+
+/*
+ * Reset the system when the watchdog event is notified.
+ *
+ * @event: the watchdog event
+ * @context:   not used
+ */
+static void EFIAPI efi_watchdog_timer_notify(struct efi_event *event,
+void *context)
+{
+   EFI_ENTRY("%p, %p", event, context);
+
+   printf("\nEFI: Watchdog timeout\n");
+   EFI_CALL_VOID(efi_runtime_services.reset_system(EFI_RESET_COLD,
+   EFI_SUCCESS, 0, NULL));
+
+   EFI_EXIT(EFI_UNSUPPORTED);
+}
+
+/*
+ * 

[U-Boot] [PATCH 1/1] scripts/get_maintainer.pl: update to current version

2017-10-13 Thread Heinrich Schuchardt
Update the script to version 0.26 (as of Linux v4.14-rc1)
Keep our "penguin_chief".
Keep our top_of_kernel_tree.

The negative forms of the command line parameters are described
when using --help.

New options are

 --git-blame-signatures => when used with --git-blame,
   also include all commit signers
 --r => include reviewer(s) if any
 --letters => print all matching 'letter' types
  from all matching sections

File .get_maintainer.ignore can be used to specify
email addressees that shall be ignored.

Signed-off-by: Heinrich Schuchardt 
---
 scripts/get_maintainer.pl | 202 +++---
 1 file changed, 156 insertions(+), 46 deletions(-)

diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 83a4e5bad2..8b6037b73f 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/env perl
 # (c) 2007, Joe Perches 
 #   created from checkpatch.pl
 #
@@ -10,18 +10,22 @@
 #
 # Licensed under the terms of the GNU GPL License version 2
 
+use warnings;
 use strict;
 
 my $P = $0;
 my $V = '0.26';
 
 use Getopt::Long qw(:config no_auto_abbrev);
+use Cwd;
 use File::Find;
 
+my $cur_path = fastgetcwd() . '/';
 my $lk_path = "./";
 my $email = 1;
 my $email_usename = 1;
 my $email_maintainer = 1;
+my $email_reviewer = 1;
 my $email_list = 1;
 my $email_subscriber_list = 0;
 my $email_git_penguin_chiefs = 0;
@@ -42,10 +46,12 @@ my $output_multiline = 1;
 my $output_separator = ", ";
 my $output_roles = 0;
 my $output_rolestats = 1;
+my $output_section_maxlen = 50;
 my $scm = 0;
 my $web = 0;
 my $subsystem = 0;
 my $status = 0;
+my $letters = "";
 my $keywords = 1;
 my $sections = 0;
 my $file_emails = 0;
@@ -53,6 +59,7 @@ my $from_filename = 0;
 my $pattern_depth = 0;
 my $version = 0;
 my $help = 0;
+my $find_maintainer_files = 0;
 
 my $vcs_used = 0;
 
@@ -128,6 +135,7 @@ my %VCS_cmds_git = (
 "author_pattern" => "^GitAuthor: (.*)",
 "subject_pattern" => "^GitSubject: (.*)",
 "stat_pattern" => "^(\\d+)\\t(\\d+)\\t\$file\$",
+"file_exists_cmd" => "git ls-files \$file",
 );
 
 my %VCS_cmds_hg = (
@@ -156,6 +164,7 @@ my %VCS_cmds_hg = (
 "author_pattern" => "^HgAuthor: (.*)",
 "subject_pattern" => "^HgSubject: (.*)",
 "stat_pattern" => "^(\\d+)\t(\\d+)\t\$file\$",
+"file_exists_cmd" => "hg files \$file",
 );
 
 my $conf = which_conf(".get_maintainer.conf");
@@ -184,6 +193,27 @@ if (-f $conf) {
 unshift(@ARGV, @conf_args) if @conf_args;
 }
 
+my @ignore_emails = ();
+my $ignore_file = which_conf(".get_maintainer.ignore");
+if (-f $ignore_file) {
+open(my $ignore, '<', "$ignore_file")
+   or warn "$P: Can't find a readable .get_maintainer.ignore file $!\n";
+while (<$ignore>) {
+   my $line = $_;
+
+   $line =~ s/\s*\n?$//;
+   $line =~ s/^\s*//;
+   $line =~ s/\s+$//;
+   $line =~ s/#.*$//;
+
+   next if ($line =~ m/^\s*$/);
+   if (rfc822_valid($line)) {
+   push(@ignore_emails, $line);
+   }
+}
+close($ignore);
+}
+
 if (!GetOptions(
'email!' => \$email,
'git!' => \$email_git,
@@ -201,6 +231,7 @@ if (!GetOptions(
'remove-duplicates!' => \$email_remove_duplicates,
'mailmap!' => \$email_use_mailmap,
'm!' => \$email_maintainer,
+   'r!' => \$email_reviewer,
'n!' => \$email_usename,
'l!' => \$email_list,
's!' => \$email_subscriber_list,
@@ -212,11 +243,13 @@ if (!GetOptions(
'status!' => \$status,
'scm!' => \$scm,
'web!' => \$web,
+   'letters=s' => \$letters,
'pattern-depth=i' => \$pattern_depth,
'k|keywords!' => \$keywords,
'sections!' => \$sections,
'fe|file-emails!' => \$file_emails,
'f|file' => \$from_filename,
+   'find-maintainer-files' => \$find_maintainer_files,
'v|version' => \$version,
'h|help|usage' => \$help,
)) {
@@ -242,7 +275,8 @@ $output_multiline = 0 if ($output_separator ne ", ");
 $output_rolestats = 1 if ($interactive);
 $output_roles = 1 if ($output_rolestats);
 
-if ($sections) {
+if ($sections || $letters ne "") {
+$sections = 1;
 $email = 0;
 $email_list = 0;
 $scm = 0;
@@ -259,42 +293,28 @@ if ($sections) {
 }
 
 if ($email &&
-($email_maintainer + $email_list + $email_subscriber_list +
+($email_maintainer + $email_reviewer +
+ $email_list + $email_subscriber_list +
  $email_git + $email_git_penguin_chiefs + $email_git_blame) == 0) {
 die "$P: Please select at least 1 email option\n";
 }
 
 if (!top_of_kernel_tree($lk_path)) {
 die "$P: The current directory does not appear to be "
-   . "a linux kernel source tree.\n";
+   . "a 

[U-Boot] [PATCH 3/4] mtd: nand: denali_dt: add clock support

2017-10-13 Thread Masahiro Yamada
Enable clock in the probe hook.  The clock rate will be necessary
when setup_data_interface hook is supported.

Signed-off-by: Masahiro Yamada 
---

 drivers/mtd/nand/denali.h|  1 +
 drivers/mtd/nand/denali_dt.c | 12 
 2 files changed, 13 insertions(+)

diff --git a/drivers/mtd/nand/denali.h b/drivers/mtd/nand/denali.h
index 08db488..f796f0d 100644
--- a/drivers/mtd/nand/denali.h
+++ b/drivers/mtd/nand/denali.h
@@ -435,6 +435,7 @@ struct nand_buf {
 
 struct denali_nand_info {
struct nand_chip nand;
+   unsigned long clk_x_rate;   /* bus interface clock rate */
int flash_bank; /* currently selected chip */
int status;
int platform;
diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
index 4afd679..805c066 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -6,6 +6,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -52,6 +53,7 @@ static int denali_dt_probe(struct udevice *dev)
 {
struct denali_nand_info *denali = dev_get_priv(dev);
const struct denali_dt_data *data;
+   struct clk clk;
struct resource res;
int ret;
 
@@ -73,6 +75,16 @@ static int denali_dt_probe(struct udevice *dev)
 
denali->flash_mem = devm_ioremap(dev, res.start, resource_size());
 
+   ret = clk_get_by_index(dev, 0, );
+   if (ret)
+   return ret;
+
+   ret = clk_enable();
+   if (ret)
+   return ret;
+
+   denali->clk_x_rate = clk_get_rate();
+
return denali_init(denali);
 }
 
-- 
2.7.4

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


[U-Boot] [PATCH 2/4] ARM: uniphier: adjust ifdefs for new UniPhier DWC3 CONFIG

2017-10-13 Thread Masahiro Yamada
Now USB 3.0 feature is enabled/disabled by CONFIG_USB_DWC3_UNIPHIER.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/clk/clk-pro4.c | 6 +++---
 arch/arm/mach-uniphier/clk/clk-pro5.c | 6 +++---
 arch/arm/mach-uniphier/clk/clk-pxs2.c | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mach-uniphier/clk/clk-pro4.c 
b/arch/arm/mach-uniphier/clk/clk-pro4.c
index 19be4f3..8a978d2 100644
--- a/arch/arm/mach-uniphier/clk/clk-pro4.c
+++ b/arch/arm/mach-uniphier/clk/clk-pro4.c
@@ -17,7 +17,7 @@ void uniphier_pro4_clk_init(void)
 
/* deassert reset */
tmp = readl(SC_RSTCTRL);
-#ifdef CONFIG_USB_XHCI_UNIPHIER
+#ifdef CONFIG_USB_DWC3_UNIPHIER
tmp |= SC_RSTCTRL_NRST_USB3B0 | SC_RSTCTRL_NRST_USB3C0 |
SC_RSTCTRL_NRST_GIO;
 #endif
@@ -30,7 +30,7 @@ void uniphier_pro4_clk_init(void)
writel(tmp, SC_RSTCTRL);
readl(SC_RSTCTRL); /* dummy read */
 
-#ifdef CONFIG_USB_XHCI_UNIPHIER
+#ifdef CONFIG_USB_DWC3_UNIPHIER
tmp = readl(SC_RSTCTRL2);
tmp |= SC_RSTCTRL2_NRST_USB3B1 | SC_RSTCTRL2_NRST_USB3C1;
writel(tmp, SC_RSTCTRL2);
@@ -39,7 +39,7 @@ void uniphier_pro4_clk_init(void)
 
/* provide clocks */
tmp = readl(SC_CLKCTRL);
-#ifdef CONFIG_USB_XHCI_UNIPHIER
+#ifdef CONFIG_USB_DWC3_UNIPHIER
tmp |= SC_CLKCTRL_CEN_USB31 | SC_CLKCTRL_CEN_USB30 |
SC_CLKCTRL_CEN_GIO;
 #endif
diff --git a/arch/arm/mach-uniphier/clk/clk-pro5.c 
b/arch/arm/mach-uniphier/clk/clk-pro5.c
index 823bb06..dd86cad 100644
--- a/arch/arm/mach-uniphier/clk/clk-pro5.c
+++ b/arch/arm/mach-uniphier/clk/clk-pro5.c
@@ -15,7 +15,7 @@ void uniphier_pro5_clk_init(void)
 
/* deassert reset */
tmp = readl(SC_RSTCTRL);
-#ifdef CONFIG_USB_XHCI_UNIPHIER
+#ifdef CONFIG_USB_DWC3_UNIPHIER
tmp |= SC_RSTCTRL_NRST_USB3B0 | SC_RSTCTRL_NRST_GIO;
 #endif
 #ifdef CONFIG_NAND_DENALI
@@ -24,7 +24,7 @@ void uniphier_pro5_clk_init(void)
writel(tmp, SC_RSTCTRL);
readl(SC_RSTCTRL); /* dummy read */
 
-#ifdef CONFIG_USB_XHCI_UNIPHIER
+#ifdef CONFIG_USB_DWC3_UNIPHIER
tmp = readl(SC_RSTCTRL2);
tmp |= SC_RSTCTRL2_NRST_USB3B1;
writel(tmp, SC_RSTCTRL2);
@@ -33,7 +33,7 @@ void uniphier_pro5_clk_init(void)
 
/* provide clocks */
tmp = readl(SC_CLKCTRL);
-#ifdef CONFIG_USB_XHCI_UNIPHIER
+#ifdef CONFIG_USB_DWC3_UNIPHIER
tmp |= SC_CLKCTRL_CEN_USB31 | SC_CLKCTRL_CEN_USB30 |
SC_CLKCTRL_CEN_GIO;
 #endif
diff --git a/arch/arm/mach-uniphier/clk/clk-pxs2.c 
b/arch/arm/mach-uniphier/clk/clk-pxs2.c
index 0d92405..9775127 100644
--- a/arch/arm/mach-uniphier/clk/clk-pxs2.c
+++ b/arch/arm/mach-uniphier/clk/clk-pxs2.c
@@ -16,7 +16,7 @@ void uniphier_pxs2_clk_init(void)
 
/* deassert reset */
tmp = readl(SC_RSTCTRL);
-#ifdef CONFIG_USB_XHCI_UNIPHIER
+#ifdef CONFIG_USB_DWC3_UNIPHIER
tmp |= SC_RSTCTRL_NRST_USB3B0 | SC_RSTCTRL_NRST_GIO;
 #endif
 #ifdef CONFIG_UNIPHIER_ETH
@@ -28,7 +28,7 @@ void uniphier_pxs2_clk_init(void)
writel(tmp, SC_RSTCTRL);
readl(SC_RSTCTRL); /* dummy read */
 
-#ifdef CONFIG_USB_XHCI_UNIPHIER
+#ifdef CONFIG_USB_DWC3_UNIPHIER
tmp = readl(SC_RSTCTRL2);
tmp |= SC_RSTCTRL2_NRST_USB3B1;
writel(tmp, SC_RSTCTRL2);
@@ -41,7 +41,7 @@ void uniphier_pxs2_clk_init(void)
 
/* provide clocks */
tmp = readl(SC_CLKCTRL);
-#ifdef CONFIG_USB_XHCI_UNIPHIER
+#ifdef CONFIG_USB_DWC3_UNIPHIER
tmp |= BIT(20) | BIT(19) | SC_CLKCTRL_CEN_USB31 | SC_CLKCTRL_CEN_USB30 |
SC_CLKCTRL_CEN_GIO;
 #endif
-- 
2.7.4

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


[U-Boot] [PATCH 4/4] clk: uniphier: add NAND controller clock

2017-10-13 Thread Masahiro Yamada
This allows the NAND driver to enable clock and get its clock rate.

Signed-off-by: Masahiro Yamada 
---

 drivers/clk/uniphier/clk-uniphier-sys.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/clk/uniphier/clk-uniphier-sys.c 
b/drivers/clk/uniphier/clk-uniphier-sys.c
index f8cf6da..c852c78 100644
--- a/drivers/clk/uniphier/clk-uniphier-sys.c
+++ b/drivers/clk/uniphier/clk-uniphier-sys.c
@@ -7,10 +7,20 @@
 
 #include "clk-uniphier.h"
 
+/* Denali driver requires clk_x rate (clk: 50MHz, clk_x & ecc_clk: 200MHz) */
+#define UNIPHIER_LD4_SYS_CLK_NAND(_id) \
+   UNIPHIER_CLK_RATE(128, 2),  \
+   UNIPHIER_CLK_GATE((_id), 128, 0x2104, 2)
+
+#define UNIPHIER_LD11_SYS_CLK_NAND(_id)
\
+   UNIPHIER_CLK_RATE(128, 2),  \
+   UNIPHIER_CLK_GATE((_id), 128, 0x210c, 0)
+
 const struct uniphier_clk_data uniphier_pxs2_sys_clk_data[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_LD4) || defined(CONFIG_ARCH_UNIPHIER_SLD8) ||\
 defined(CONFIG_ARCH_UNIPHIER_PRO4) || defined(CONFIG_ARCH_UNIPHIER_PRO5) 
||\
 defined(CONFIG_ARCH_UNIPHIER_PXS2) || defined(CONFIG_ARCH_UNIPHIER_LD6B)
+   UNIPHIER_LD4_SYS_CLK_NAND(2),
UNIPHIER_CLK_GATE_SIMPLE(8, 0x2104, 10),/* stdmac */
UNIPHIER_CLK_GATE_SIMPLE(12, 0x2104, 6),/* gio (Pro4, Pro5) */
UNIPHIER_CLK_GATE_SIMPLE(14, 0x2104, 16),   /* usb30 (Pro4, Pro5, 
PXs2) */
@@ -23,6 +33,7 @@ const struct uniphier_clk_data uniphier_pxs2_sys_clk_data[] = 
{
 
 const struct uniphier_clk_data uniphier_ld20_sys_clk_data[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_LD11) || defined(CONFIG_ARCH_UNIPHIER_LD20)
+   UNIPHIER_LD11_SYS_CLK_NAND(2),
UNIPHIER_CLK_GATE_SIMPLE(8, 0x210c, 8), /* stdmac */
UNIPHIER_CLK_GATE_SIMPLE(14, 0x210c, 14),   /* usb30 (LD20) */
UNIPHIER_CLK_GATE_SIMPLE(16, 0x210c, 12),   /* usb30-phy0 (LD20) */
@@ -33,6 +44,7 @@ const struct uniphier_clk_data uniphier_ld20_sys_clk_data[] = 
{
 
 const struct uniphier_clk_data uniphier_pxs3_sys_clk_data[] = {
 #if defined(CONFIG_ARCH_UNIPHIER_PXS3)
+   UNIPHIER_LD11_SYS_CLK_NAND(2),
UNIPHIER_CLK_GATE_SIMPLE(12, 0x210c, 4),/* usb30 (gio0) */
UNIPHIER_CLK_GATE_SIMPLE(13, 0x210c, 5),/* usb31-0 (gio1) */
UNIPHIER_CLK_GATE_SIMPLE(14, 0x210c, 6),/* usb31-1 (gio1-1) */
-- 
2.7.4

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


[U-Boot] [PATCH 1/4] ARM: uniphier: enable DWC3 xHCI driver

2017-10-13 Thread Masahiro Yamada
Enable CONFIGs for the DWC3 core and the UniPhier specific glue layer.

Signed-off-by: Masahiro Yamada 
---

 configs/uniphier_v7_defconfig | 2 ++
 configs/uniphier_v8_defconfig | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/configs/uniphier_v7_defconfig b/configs/uniphier_v7_defconfig
index 12b24bc..96e962d 100644
--- a/configs/uniphier_v7_defconfig
+++ b/configs/uniphier_v7_defconfig
@@ -48,4 +48,6 @@ CONFIG_USB=y
 CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_UNIPHIER=y
 CONFIG_USB_STORAGE=y
diff --git a/configs/uniphier_v8_defconfig b/configs/uniphier_v8_defconfig
index 796839b..31dd9b3 100644
--- a/configs/uniphier_v8_defconfig
+++ b/configs/uniphier_v8_defconfig
@@ -45,4 +45,6 @@ CONFIG_USB_XHCI_HCD=y
 CONFIG_USB_XHCI_DWC3=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_UNIPHIER=y
 CONFIG_USB_STORAGE=y
-- 
2.7.4

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


[U-Boot] [PATCH v2] DW SPI: Get clock value from Device Tree

2017-10-13 Thread Eugeniy Paltsev
Add option to set spi controller clock frequency via device tree
using standard clock bindings.
Old way of setting spi controller clock frequency (via implementation
of 'cm_get_spi_controller_clk_hz' function in platform specific code)
remains supported for backward compatibility.

Signed-off-by: Eugeniy Paltsev 
---
Changes v1->v2:
  * disable clock if we can't get the rate.
  * get rid of cm_get_spi_controller_clk_hz weak declaration.

 drivers/spi/designware_spi.c | 65 +++-
 1 file changed, 64 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c
index 5aa507b..9eb5b1c 100644
--- a/drivers/spi/designware_spi.c
+++ b/drivers/spi/designware_spi.c
@@ -11,6 +11,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -18,7 +19,10 @@
 #include 
 #include 
 #include 
+/* Only SOCFPGA_GEN5 and SOCFPGA_ARRIA10 uses their clock_manager functions */
+#if defined(CONFIG_TARGET_SOCFPGA_GEN5) || 
defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
 #include 
+#endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -94,6 +98,7 @@ struct dw_spi_priv {
void __iomem *regs;
unsigned int freq;  /* Default frequency */
unsigned int mode;
+   unsigned long bus_clk_rate;
 
int bits_per_word;
u8 cs;  /* chip select pin */
@@ -176,14 +181,72 @@ static void spi_hw_init(struct dw_spi_priv *priv)
debug("%s: fifo_len=%d\n", __func__, priv->fifo_len);
 }
 
+static int dw_spi_of_get_clk(struct udevice *bus)
+{
+#if CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(CLK)
+   struct dw_spi_priv *priv = dev_get_priv(bus);
+   struct clk clk;
+   int ret;
+
+   ret = clk_get_by_index(bus, 0, );
+   if (ret)
+   return -EINVAL;
+
+   ret = clk_enable();
+   if (ret && ret != -ENOSYS)
+   return ret;
+
+   priv->bus_clk_rate = clk_get_rate();
+   if (!priv->bus_clk_rate) {
+   clk_disable();
+   return -EINVAL;
+   }
+
+   clk_free();
+
+   return 0;
+#else
+   return -ENOSYS;
+#endif
+}
+
+static int dw_spi_get_clk(struct udevice *bus)
+{
+   struct dw_spi_priv *priv = dev_get_priv(bus);
+
+   /* Firstly try to get clock frequency from device tree */
+   if (!dw_spi_of_get_clk(bus))
+   return 0;
+
+   /*
+* SOCFPGA_GEN5 and SOCFPGA_ARRIA10 uses cm_get_spi_controller_clk_hz
+* function (defined in asm/arch/clock_manager.h) to get spi controller
+* clock frequency. So in case of get clock frequency from device
+* tree failure rollback to cm_get_spi_controller_clk_hz
+*/
+#if defined(CONFIG_TARGET_SOCFPGA_GEN5) || 
defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
+   priv->bus_clk_rate = cm_get_spi_controller_clk_hz();
+#endif
+
+   if (!priv->bus_clk_rate)
+   return -EINVAL;
+
+   return 0;
+}
+
 static int dw_spi_probe(struct udevice *bus)
 {
struct dw_spi_platdata *plat = dev_get_platdata(bus);
struct dw_spi_priv *priv = dev_get_priv(bus);
+   int ret;
 
priv->regs = plat->regs;
priv->freq = plat->frequency;
 
+   ret = dw_spi_get_clk(bus);
+   if (ret)
+   return ret;
+
/* Currently only bits_per_word == 8 supported */
priv->bits_per_word = 8;
 
@@ -369,7 +432,7 @@ static int dw_spi_set_speed(struct udevice *bus, uint speed)
spi_enable_chip(priv, 0);
 
/* clk_div doesn't support odd number */
-   clk_div = cm_get_spi_controller_clk_hz() / speed;
+   clk_div = priv->bus_clk_rate / speed;
clk_div = (clk_div + 1) & 0xfffe;
dw_writel(priv, DW_SPI_BAUDR, clk_div);
 
-- 
2.9.3

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


Re: [U-Boot] [PATCH] power: extend prefix match to regulator-name property

2017-10-13 Thread Felix Brack
Hello Simon,

On 12.10.2017 04:07, Simon Glass wrote:
> Hi Felix,
> 
> On 9 October 2017 at 03:04, Felix Brack  wrote:
>>
>> This patch extends pmic_bind_children prefix matching. In addition to
>> the node name the property regulator-name is used while trying to match
>> prefixes. This allows assigning different drivers to regulator nodes
>> named regulator@1 and regulator@10 for example.
>> Signed-off-by: Felix Brack 
>> ---
>>
>>  drivers/power/pmic/pmic-uclass.c | 15 +--
>>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> Can you please add a sandbox test and documentation for this?
> 
I just forgot to extend the documentation. I will do so of course as
soon as the node property for matching has been fixed.

I think the test itself does already exist (test/dm/regulator.c). I will
have to add a regulator to arch/sandbox/dts/sandbox_pmic.dtsi. This
regulator will have a node name prefix other then 'buck' or 'ldo' for my
code to do the matching. Some other files will also need modifications
for the test to work correctly.

> See:
> 
> test/dm/pmic.c
> doc/driver-model/pmic-framework.txt
> 
>>
>> diff --git a/drivers/power/pmic/pmic-uclass.c 
>> b/drivers/power/pmic/pmic-uclass.c
>> index 64964e4..5a034f0 100644
>> --- a/drivers/power/pmic/pmic-uclass.c
>> +++ b/drivers/power/pmic/pmic-uclass.c
>> @@ -26,6 +26,7 @@ int pmic_bind_children(struct udevice *pmic, ofnode parent,
>> struct driver *drv;
>> struct udevice *child;
>> const char *node_name;
>> +   const char *reg_name;
>> int bind_count = 0;
>> ofnode node;
>> int prefix_len;
>> @@ -44,8 +45,18 @@ int pmic_bind_children(struct udevice *pmic, ofnode 
>> parent,
>> debug("  - compatible prefix: '%s'\n", info->prefix);
>>
>> prefix_len = strlen(info->prefix);
>> -   if (strncmp(info->prefix, node_name, prefix_len))
>> -   continue;
>> +   if (strncmp(info->prefix, node_name, prefix_len)) {
>> +   reg_name = ofnode_read_string(node,
>> + 
>> "regulator-name");
>> +   if (reg_name) {
>> +   if (strncmp(info->prefix, reg_name,
>> +   prefix_len)) {
>> +   continue;
>> +   }
>> +   } else {
>> +   continue;
>> +   }
>> +   }
>>
>> drv = lists_driver_lookup_name(info->driver);
>> if (!drv) {
>> --
>> 2.7.4
>>
> 
> Regards,
> Simon
> 

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


Re: [U-Boot] [PATCH 07/11] efi_loader: fix events

2017-10-13 Thread Rob Clark
On Fri, Oct 13, 2017 at 1:24 AM, Heinrich Schuchardt  wrote:
>
>
> On 10/10/2017 02:23 PM, Rob Clark wrote:
>>
>> An event can be created with type==0, Shell.efi does this for an event
>> that is set when Ctrl-C is typed.  So our current approach of having a
>> fixed set of timer slots, and determining which slots are unused by
>> type==0 doesn't work so well.  But we don't have any particularly good
>> reason to have a fixed table of events, so just dynamically allocate
>> them and keep a list.
>>
>> Also fixes an incorrect implementation of CheckEvent() which was (a)
>> incorrectly returning an error if type==0, and (b) didn't handle the
>> case of an unsignaled event with a notify callback.
>>
>> With these fixes (plus implementation of SIMPLE_TEXT_INPUT_EX protocol),
>> Ctrl-C works in Shell.efi.
>>
>> Signed-off-by: Rob Clark 
>> ---
>>   include/efi_loader.h  |   1 +
>>   lib/efi_loader/efi_boottime.c | 217
>> +-
>>   2 files changed, 111 insertions(+), 107 deletions(-)
>>
>> diff --git a/include/efi_loader.h b/include/efi_loader.h
>> index e6e55d2cb4..2232caca44 100644
>> --- a/include/efi_loader.h
>> +++ b/include/efi_loader.h
>> @@ -154,6 +154,7 @@ struct efi_event {
>> enum efi_timer_delay trigger_type;
>> bool is_queued;
>> bool is_signaled;
>> +   struct list_head link;
>>   };
>> diff --git a/lib/efi_loader/efi_boottime.c
>> b/lib/efi_loader/efi_boottime.c
>> index 39dcc72648..19fafe546c 100644
>> --- a/lib/efi_loader/efi_boottime.c
>> +++ b/lib/efi_loader/efi_boottime.c
>> @@ -350,11 +350,26 @@ static efi_status_t efi_create_handle(void **handle)
>> return r;
>>   }
>>   +static LIST_HEAD(efi_events);
>> +
>>   /*
>> - * Our event capabilities are very limited. Only a small limited
>> - * number of events is allowed to coexist.
>> + * Check if a pointer is a valid event.
>> + *
>> + * It might be nice at some point to extend this to a more general
>> + * mechanism to check if pointers passed from the EFI world are
>> + * valid objects of a particular type.
>>*/
>> -static struct efi_event efi_events[16];
>> +static bool efi_is_event(const void *obj)
>> +{
>> +   struct efi_event *evt;
>> +
>> +   list_for_each_entry(evt, _events, link) {
>> +   if (evt == obj)
>> +   return true;
>> +   }
>> +
>> +   return false;
>> +}
>> /*
>>* Create an event.
>> @@ -377,7 +392,7 @@ efi_status_t efi_create_event(uint32_t type, UINTN
>> notify_tpl,
>> void *context),
>>   void *notify_context, struct efi_event
>> **event)
>>   {
>> -   int i;
>> +   struct efi_event *evt;
>> if (event == NULL)
>> return EFI_INVALID_PARAMETER;
>> @@ -389,21 +404,24 @@ efi_status_t efi_create_event(uint32_t type, UINTN
>> notify_tpl,
>> notify_function == NULL)
>> return EFI_INVALID_PARAMETER;
>>   - for (i = 0; i < ARRAY_SIZE(efi_events); ++i) {
>> -   if (efi_events[i].type)
>> -   continue;
>> -   efi_events[i].type = type;
>> -   efi_events[i].notify_tpl = notify_tpl;
>> -   efi_events[i].notify_function = notify_function;
>> -   efi_events[i].notify_context = notify_context;
>> -   /* Disable timers on bootup */
>> -   efi_events[i].trigger_next = -1ULL;
>> -   efi_events[i].is_queued = false;
>> -   efi_events[i].is_signaled = false;
>> -   *event = _events[i];
>> -   return EFI_SUCCESS;
>> -   }
>> -   return EFI_OUT_OF_RESOURCES;
>> +   evt = calloc(1, sizeof(*evt));
>> +   if (!evt)
>> +   return EFI_OUT_OF_RESOURCES;
>> +
>> +   evt->type = type;
>> +   evt->notify_tpl = notify_tpl;
>> +   evt->notify_function = notify_function;
>> +   evt->notify_context = notify_context;
>> +   /* Disable timers on bootup */
>> +   evt->trigger_next = -1ULL;
>> +   evt->is_queued = false;
>> +   evt->is_signaled = false;
>> +
>> +   list_add_tail(>link, _events);
>> +
>> +   *event = evt;
>> +
>> +   return EFI_SUCCESS;
>>   }
>> /*
>> @@ -443,30 +461,31 @@ static efi_status_t EFIAPI efi_create_event_ext(
>>*/
>>   void efi_timer_check(void)
>>   {
>> -   int i;
>> +   struct efi_event *evt;
>> u64 now = timer_get_us();
>>   - for (i = 0; i < ARRAY_SIZE(efi_events); ++i) {
>> -   if (!efi_events[i].type)
>> -   continue;
>> -   if (efi_events[i].is_queued)
>> -   efi_signal_event(_events[i]);
>> -   if (!(efi_events[i].type & EVT_TIMER) ||
>> -   now < efi_events[i].trigger_next)
>> +   /*
>> +* TODO perhaps optimize a bit and track the time of next
>> +* 

Re: [U-Boot] [PATCH] ARC: HSDK: introduce CREG GPIO driver

2017-10-13 Thread Tom Rini
On Fri, Oct 13, 2017 at 01:55:28PM +, Alexey Brodkin wrote:
> Hi Tom,
> 
> On Fri, 2017-10-13 at 09:46 -0400, Tom Rini wrote:
> > On Fri, Oct 13, 2017 at 01:33:22PM +, Alexey Brodkin wrote:
> > > 
> > > Hi Tom,
> > > 
> > > On Fri, 2017-10-13 at 16:21 +0300, Eugeniy Paltsev wrote:
> > > > 
> > > > The HSDK can manage some pins via CREG registers block.
> > > > 
> > > > Signed-off-by: Eugeniy Paltsev 
> > > > ---
> > > >  MAINTAINERS   |   6 +++
> > > >  drivers/gpio/Kconfig  |   7 +++
> > > >  drivers/gpio/Makefile |   1 +
> > > >  drivers/gpio/hsdk-creg-gpio.c | 109 
> > > > ++
> > > >  4 files changed, 123 insertions(+)
> > > >  create mode 100644 drivers/gpio/hsdk-creg-gpio.c
> > > 
> > > I'm wondering if this one should go through my tree as this
> > > is for one of our Synopsys ARC devboards or GPIO stuff usually
> > > goes through some other tree?
> > 
> > The ARC tree is fine, but it's a bit late posting for this release.
> 
> So should I keep this one in "next" branch of my tree before v2017.11
> gets cut?

Yes, thanks.

-- 
Tom


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


Re: [U-Boot] [PATCH] ARC: HSDK: introduce CREG GPIO driver

2017-10-13 Thread Alexey Brodkin
Hi Tom,

On Fri, 2017-10-13 at 09:46 -0400, Tom Rini wrote:
> On Fri, Oct 13, 2017 at 01:33:22PM +, Alexey Brodkin wrote:
> > 
> > Hi Tom,
> > 
> > On Fri, 2017-10-13 at 16:21 +0300, Eugeniy Paltsev wrote:
> > > 
> > > The HSDK can manage some pins via CREG registers block.
> > > 
> > > Signed-off-by: Eugeniy Paltsev 
> > > ---
> > >  MAINTAINERS   |   6 +++
> > >  drivers/gpio/Kconfig  |   7 +++
> > >  drivers/gpio/Makefile |   1 +
> > >  drivers/gpio/hsdk-creg-gpio.c | 109 
> > > ++
> > >  4 files changed, 123 insertions(+)
> > >  create mode 100644 drivers/gpio/hsdk-creg-gpio.c
> > 
> > I'm wondering if this one should go through my tree as this
> > is for one of our Synopsys ARC devboards or GPIO stuff usually
> > goes through some other tree?
> 
> The ARC tree is fine, but it's a bit late posting for this release.

So should I keep this one in "next" branch of my tree before v2017.11
gets cut?

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


Re: [U-Boot] [PATCH v2 0/3] kbuild: always use relative path for __FILE__

2017-10-13 Thread Tom Rini
On Fri, Oct 13, 2017 at 09:21:19PM +0900, Masahiro Yamada wrote:
> 2017-10-13 21:11 GMT+09:00 Tom Rini :
> > On Fri, Oct 13, 2017 at 06:51:42PM +0900, Masahiro Yamada wrote:
> >
> >> We discussed the __FILE__ problem when U-Boot is built out of tree.
> >> https://www.mail-archive.com/u-boot@lists.denx.de/msg242852.html
> >>
> >> The deeper your build directory is located, the larger
> >> your U-Boot image becomes.
> >> If your platform has memory footprint limit, this is a problem.
> >>
> >> Recently, I submitted the following patches to Kbuild ML.
> >> (no RFC, this time)
> >> https://patchwork.kernel.org/patch/10001419/
> >> https://patchwork.kernel.org/patch/10001409/
> >>
> >> I consider them for Linux 4.15 unless there is
> >> a strong objection or a problem report.
> >>
> >> This series is a port for U-Boot.
> >>
> >> If Tom wants to pick this up earlier, it is OK.
> >> If not in hurry, you can wait for the activity in Linux.
> >> Either will do.
> >
> > Yay.  I plan to pick these up after v2017.11 has been released, so no
> > need to re-spin this if it stops applying cleanly until we're closer to
> > release.  Thanks!
> >
> 
> Good.
> 
> According to this:
> http://phb-crystal-ball.org/
> 
> The MW for v4.15 will open 2017-11-12.
> 
> So, the next MW for U-Boot and Linux will be almost lined up.
> 
> You will be able to apply it more confidently
> if Linus pulls the Linux counterpart.
> 
> Until then, I will test it in linux-next.

FWIW, a world build is:
https://gist.github.com/trini/ad0f55b9f46997fd11801aac48bf0c10

I wonder why we see size increase in a few cases?  In both cases, the
obj directory is /tmp/something/01_of_.. (or 04_of_..)/current/..

-- 
Tom


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


Re: [U-Boot] [PATCH] ARC: HSDK: introduce CREG GPIO driver

2017-10-13 Thread Tom Rini
On Fri, Oct 13, 2017 at 01:33:22PM +, Alexey Brodkin wrote:
> Hi Tom,
> 
> On Fri, 2017-10-13 at 16:21 +0300, Eugeniy Paltsev wrote:
> > The HSDK can manage some pins via CREG registers block.
> > 
> > Signed-off-by: Eugeniy Paltsev 
> > ---
> >  MAINTAINERS   |   6 +++
> >  drivers/gpio/Kconfig  |   7 +++
> >  drivers/gpio/Makefile |   1 +
> >  drivers/gpio/hsdk-creg-gpio.c | 109 
> > ++
> >  4 files changed, 123 insertions(+)
> >  create mode 100644 drivers/gpio/hsdk-creg-gpio.c
> 
> I'm wondering if this one should go through my tree as this
> is for one of our Synopsys ARC devboards or GPIO stuff usually
> goes through some other tree?

The ARC tree is fine, but it's a bit late posting for this release.
Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] ARC: HSDK: introduce CREG GPIO driver

2017-10-13 Thread Alexey Brodkin
Hi Tom,

On Fri, 2017-10-13 at 16:21 +0300, Eugeniy Paltsev wrote:
> The HSDK can manage some pins via CREG registers block.
> 
> Signed-off-by: Eugeniy Paltsev 
> ---
>  MAINTAINERS   |   6 +++
>  drivers/gpio/Kconfig  |   7 +++
>  drivers/gpio/Makefile |   1 +
>  drivers/gpio/hsdk-creg-gpio.c | 109 
> ++
>  4 files changed, 123 insertions(+)
>  create mode 100644 drivers/gpio/hsdk-creg-gpio.c

I'm wondering if this one should go through my tree as this
is for one of our Synopsys ARC devboards or GPIO stuff usually
goes through some other tree?

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


Re: [U-Boot] fsl_esdhc driver is broken with DM

2017-10-13 Thread Fabio Estevam
Hi Lukasz,

On Fri, Oct 13, 2017 at 5:16 AM, Lukasz Majewski  wrote:

> There is some ongoing work to provide such facility. for imx6
> boards. I will keep you informed.

That's good news! Please keep me in the loop as well.

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


[U-Boot] [PATCH v2] mx6slevk: Fix MMC breakage for the SPL target

2017-10-13 Thread Fabio Estevam
From: Fabio Estevam 

Commit 001cdbbb32ef1f6 ("imx: mx6slevk: enable more DM drivers") breaks
MMC support in U-Boot proper on the mx6slevk_spl_defconfig target:

U-Boot SPL 2017.09-00396-g6ca43a5 (Oct 01 2017 - 16:20:18)
Trying to boot from MMC1

U-Boot 2017.09-00396-g6ca43a5 (Oct 01 2017 - 16:20:18 -0300)

CPU:   Freescale i.MX6SL rev1.0 792 MHz (running at 396 MHz)
CPU:   Commercial temperature grade (0C to 95C) at 33C
Reset cause: POR
Board: MX6SLEVK
I2C:   ready
DRAM:  1 GiB
MMC:   FSL_SDHC: 0
MMC Device 1 not found
*** Warning - No MMC card found, using default environment

As mx6slevk_spl_defconfig does not use CONFIG_DM_MMC and its
board file does not register the mmc controller for U-Boot proper,
let's fix this by adding CONFIG_DM_MMC=y and device tree support.

While at it, add more DM drivers, so that it becomes closer to 
mx6slevk_defconfig.

Signed-off-by: Fabio Estevam 
---
Changes since v1:
- Fix the breakage by adding CONFIG_DM_MMC=y

 configs/mx6slevk_spl_defconfig | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/configs/mx6slevk_spl_defconfig b/configs/mx6slevk_spl_defconfig
index 689fe79..05a5c9e 100644
--- a/configs/mx6slevk_spl_defconfig
+++ b/configs/mx6slevk_spl_defconfig
@@ -9,7 +9,8 @@ CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
 # CONFIG_CMD_BMODE is not set
-CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg,MX6SL,SYS_I2C"
+CONFIG_DEFAULT_DEVICE_TREE="imx6sl-evk"
+CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=arch/arm/mach-imx/spl_sd.cfg,MX6SL"
 CONFIG_BOOTDELAY=3
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
@@ -32,13 +33,26 @@ CONFIG_CMD_EXT4=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_DM=y
+CONFIG_DM_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_DM_MMC=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_PHYLIB=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_IMX6=y
+CONFIG_DM_PMIC=y
+CONFIG_DM_PMIC_PFUZE100=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_PFUZE100=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_DM_THERMAL=y
 CONFIG_USB=y
+CONFIG_DM_USB=y
 CONFIG_USB_STORAGE=y
 CONFIG_USB_HOST_ETHER=y
 CONFIG_USB_ETHER_ASIX=y
-- 
2.7.4

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


[U-Boot] [PATCH] ARC: HSDK: introduce CREG GPIO driver

2017-10-13 Thread Eugeniy Paltsev
The HSDK can manage some pins via CREG registers block.

Signed-off-by: Eugeniy Paltsev 
---
 MAINTAINERS   |   6 +++
 drivers/gpio/Kconfig  |   7 +++
 drivers/gpio/Makefile |   1 +
 drivers/gpio/hsdk-creg-gpio.c | 109 ++
 4 files changed, 123 insertions(+)
 create mode 100644 drivers/gpio/hsdk-creg-gpio.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 04acf2b..df662aa 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -59,6 +59,12 @@ S:   Maintained
 T: git git://git.denx.de/u-boot-arc.git
 F: arch/arc/
 
+ARC HSDK CREG GPIO
+M: Eugeniy Paltsev 
+S: Maintained
+L: uboot-snps-...@synopsys.com
+F: drivers/gpio/hsdk-creg-gpio.c
+
 ARM
 M: Albert Aribaud 
 S: Maintained
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index ffeda94..9928911 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -80,6 +80,13 @@ config IMX_RGPIO2P
help
  This driver supports i.MX7ULP Rapid GPIO2P controller.
 
+config HSDK_CREG_GPIO
+   bool "HSDK CREG GPIO griver"
+   depends on DM
+   default n
+   help
+ This driver supports CREG GPIOs on Synopsys HSDK SOC.
+
 config LPC32XX_GPIO
bool "LPC32XX GPIO driver"
depends on DM
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 1396467..c7efc4c 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -53,6 +53,7 @@ obj-$(CONFIG_GPIO_UNIPHIER)   += gpio-uniphier.o
 obj-$(CONFIG_ZYNQ_GPIO)+= zynq_gpio.o
 obj-$(CONFIG_VYBRID_GPIO)  += vybrid_gpio.o
 obj-$(CONFIG_HIKEY_GPIO)   += hi6220_gpio.o
+obj-$(CONFIG_HSDK_CREG_GPIO)   += hsdk-creg-gpio.o
 obj-$(CONFIG_IMX_RGPIO2P)  += imx_rgpio2p.o
 obj-$(CONFIG_PIC32_GPIO)   += pic32_gpio.o
 obj-$(CONFIG_MVEBU_GPIO)   += mvebu_gpio.o
diff --git a/drivers/gpio/hsdk-creg-gpio.c b/drivers/gpio/hsdk-creg-gpio.c
new file mode 100644
index 000..bfbfe5b
--- /dev/null
+++ b/drivers/gpio/hsdk-creg-gpio.c
@@ -0,0 +1,109 @@
+/*
+ * Synopsys HSDK SDP Generic PLL clock driver
+ *
+ * Copyright (C) 2017 Synopsys
+ * Author: Eugeniy Paltsev 
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without any
+ * warranty of any kind, whether express or implied.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define HSDK_CREG_MAX_GPIO 8
+
+#define GPIO_ACTIVATE  0x2
+#define GPIO_DEACTIVATE0x3
+#define GPIO_PIN_MASK  0x3
+#define BIT_PER_GPIO   2
+
+struct hsdk_creg_gpio {
+   uint32_t *regs;
+};
+
+static int hsdk_creg_gpio_set_value(struct udevice *dev, unsigned oft, int val)
+{
+   struct hsdk_creg_gpio *hcg = dev_get_priv(dev);
+   uint32_t reg = readl(hcg->regs);
+   uint32_t cmd = val ? GPIO_DEACTIVATE : GPIO_ACTIVATE;
+
+   reg &= ~(GPIO_PIN_MASK << (oft * BIT_PER_GPIO));
+   reg |=  (cmd << (oft * BIT_PER_GPIO));
+
+   writel(reg, hcg->regs);
+
+   return 0;
+}
+
+static int hsdk_creg_gpio_direction_output(struct udevice *dev, unsigned oft,
+  int val)
+{
+   hsdk_creg_gpio_set_value(dev, oft, val);
+
+   return 0;
+}
+
+static int hsdk_creg_gpio_direction_input(struct udevice *dev, unsigned oft)
+{
+   error("hsdk-creg-gpio can't be used as input!\n");
+
+   return -ENOTSUPP;
+}
+
+static int hsdk_creg_gpio_get_value(struct udevice *dev, unsigned int oft)
+{
+   struct hsdk_creg_gpio *hcg = dev_get_priv(dev);
+   uint32_t val = readl(hcg->regs);
+
+   val = (val >> (oft * BIT_PER_GPIO)) & GPIO_PIN_MASK;
+   return (val == GPIO_DEACTIVATE) ? 1 : 0;
+}
+
+static const struct dm_gpio_ops hsdk_creg_gpio_ops = {
+   .direction_output   = hsdk_creg_gpio_direction_output,
+   .direction_input= hsdk_creg_gpio_direction_input,
+   .set_value  = hsdk_creg_gpio_set_value,
+   .get_value  = hsdk_creg_gpio_get_value,
+};
+
+static int hsdk_creg_gpio_probe(struct udevice *dev)
+{
+   struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
+   struct hsdk_creg_gpio *hcg = dev_get_priv(dev);
+
+   hcg->regs = (uint32_t *)devfdt_get_addr_ptr(dev);
+
+   uc_priv->gpio_count = dev_read_u32_default(dev, "gpio-count", 1);
+   if (uc_priv->gpio_count > HSDK_CREG_MAX_GPIO)
+   uc_priv->gpio_count = HSDK_CREG_MAX_GPIO;
+
+   uc_priv->bank_name = dev_read_string(dev, "gpio-bank-name");
+   if (!uc_priv->bank_name)
+   uc_priv->bank_name = dev_read_name(dev);
+
+   debug("%s GPIO [0x%p] controller with %d gpios probed\n",
+ uc_priv->bank_name, hcg->regs, uc_priv->gpio_count);
+
+   return 0;
+}
+
+static const struct udevice_id hsdk_creg_gpio_ids[] 

[U-Boot] U-Boot download link broken

2017-10-13 Thread Guillaume Gardet

Hi,

On this page: http://www.denx.de/wiki/U-Boot/SourceCode

there is a link to Amazon Cloud Drive to download U-Boot, but this link is not 
working anymore.

Another problem: on the FTP, there is no tarball for v2017.11-rc1.


Guillaume


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


Re: [U-Boot] [PATCH v2 0/3] kbuild: always use relative path for __FILE__

2017-10-13 Thread Masahiro Yamada
2017-10-13 21:11 GMT+09:00 Tom Rini :
> On Fri, Oct 13, 2017 at 06:51:42PM +0900, Masahiro Yamada wrote:
>
>> We discussed the __FILE__ problem when U-Boot is built out of tree.
>> https://www.mail-archive.com/u-boot@lists.denx.de/msg242852.html
>>
>> The deeper your build directory is located, the larger
>> your U-Boot image becomes.
>> If your platform has memory footprint limit, this is a problem.
>>
>> Recently, I submitted the following patches to Kbuild ML.
>> (no RFC, this time)
>> https://patchwork.kernel.org/patch/10001419/
>> https://patchwork.kernel.org/patch/10001409/
>>
>> I consider them for Linux 4.15 unless there is
>> a strong objection or a problem report.
>>
>> This series is a port for U-Boot.
>>
>> If Tom wants to pick this up earlier, it is OK.
>> If not in hurry, you can wait for the activity in Linux.
>> Either will do.
>
> Yay.  I plan to pick these up after v2017.11 has been released, so no
> need to re-spin this if it stops applying cleanly until we're closer to
> release.  Thanks!
>

Good.

According to this:
http://phb-crystal-ball.org/

The MW for v4.15 will open 2017-11-12.

So, the next MW for U-Boot and Linux will be almost lined up.

You will be able to apply it more confidently
if Linus pulls the Linux counterpart.

Until then, I will test it in linux-next.



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


Re: [U-Boot] [PATCH v2 0/3] kbuild: always use relative path for __FILE__

2017-10-13 Thread Tom Rini
On Fri, Oct 13, 2017 at 06:51:42PM +0900, Masahiro Yamada wrote:

> We discussed the __FILE__ problem when U-Boot is built out of tree.
> https://www.mail-archive.com/u-boot@lists.denx.de/msg242852.html
> 
> The deeper your build directory is located, the larger
> your U-Boot image becomes.
> If your platform has memory footprint limit, this is a problem.
> 
> Recently, I submitted the following patches to Kbuild ML.
> (no RFC, this time)
> https://patchwork.kernel.org/patch/10001419/
> https://patchwork.kernel.org/patch/10001409/
> 
> I consider them for Linux 4.15 unless there is
> a strong objection or a problem report.
> 
> This series is a port for U-Boot.
> 
> If Tom wants to pick this up earlier, it is OK.
> If not in hurry, you can wait for the activity in Linux.
> Either will do.

Yay.  I plan to pick these up after v2017.11 has been released, so no
need to re-spin this if it stops applying cleanly until we're closer to
release.  Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 2/6] mmc: uniphier-sd: Use mmc_of_parse()

2017-10-13 Thread Marek Vasut
On 10/13/2017 01:36 PM, Masahiro Yamada wrote:
> Hi Marek,
> 
> 2017-10-06 21:07 GMT+09:00 Marek Vasut :
>> Drop the ad-hoc DT caps parsing in favor of common framework function.
>>
>> Signed-off-by: Marek Vasut 
>> Cc: Jaehoon Chung 
>> Cc: Masahiro Yamada 
> 
> 
> "git grep" could not find mmc_of_parse.
> 
> 
> Are you waiting for this one?
> 
> http://patchwork.ozlabs.org/patch/816911/

Yeah, I think Jaehoon is testing the patchset again . Hopefully this
time there will be some result from the testing ...

>>  drivers/mmc/uniphier-sd.c | 23 +++
>>  1 file changed, 7 insertions(+), 16 deletions(-)
>>
>> diff --git a/drivers/mmc/uniphier-sd.c b/drivers/mmc/uniphier-sd.c
>> index 784bb883ce..cf85ec23c7 100644
>> --- a/drivers/mmc/uniphier-sd.c
>> +++ b/drivers/mmc/uniphier-sd.c
>> @@ -799,24 +799,15 @@ static int uniphier_sd_probe(struct udevice *dev)
>> return ret;
>> }
>>
>> -   plat->cfg.name = dev->name;
>> -   plat->cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS;
>> -
>> -   switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-width",
>> -  1)) {
>> -   case 8:
>> -   plat->cfg.host_caps |= MMC_MODE_8BIT;
>> -   break;
>> -   case 4:
>> -   plat->cfg.host_caps |= MMC_MODE_4BIT;
>> -   break;
>> -   case 1:
>> -   break;
>> -   default:
>> -   dev_err(dev, "Invalid \"bus-width\" value\n");
>> -   return -EINVAL;
>> +   ret = mmc_of_parse(gd->fdt_blob, dev_of_offset(dev), >cfg);
>> +   if (ret < 0) {
>> +   dev_err(dev, "failed to parse host caps\n");
>> +   return ret;
>> }
>>
>> +   plat->cfg.name = dev->name;
>> +   plat->cfg.host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
>> +
>> if (quirks)
>> priv->caps = quirks;
>>
>> --
>> 2.11.0
>>
>> ___
>> U-Boot mailing list
>> U-Boot@lists.denx.de
>> https://lists.denx.de/listinfo/u-boot
> 
> 
> 


-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 2/6] mmc: uniphier-sd: Use mmc_of_parse()

2017-10-13 Thread Masahiro Yamada
Hi Marek,

2017-10-06 21:07 GMT+09:00 Marek Vasut :
> Drop the ad-hoc DT caps parsing in favor of common framework function.
>
> Signed-off-by: Marek Vasut 
> Cc: Jaehoon Chung 
> Cc: Masahiro Yamada 


"git grep" could not find mmc_of_parse.


Are you waiting for this one?

http://patchwork.ozlabs.org/patch/816911/


>  drivers/mmc/uniphier-sd.c | 23 +++
>  1 file changed, 7 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/mmc/uniphier-sd.c b/drivers/mmc/uniphier-sd.c
> index 784bb883ce..cf85ec23c7 100644
> --- a/drivers/mmc/uniphier-sd.c
> +++ b/drivers/mmc/uniphier-sd.c
> @@ -799,24 +799,15 @@ static int uniphier_sd_probe(struct udevice *dev)
> return ret;
> }
>
> -   plat->cfg.name = dev->name;
> -   plat->cfg.host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS;
> -
> -   switch (fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), "bus-width",
> -  1)) {
> -   case 8:
> -   plat->cfg.host_caps |= MMC_MODE_8BIT;
> -   break;
> -   case 4:
> -   plat->cfg.host_caps |= MMC_MODE_4BIT;
> -   break;
> -   case 1:
> -   break;
> -   default:
> -   dev_err(dev, "Invalid \"bus-width\" value\n");
> -   return -EINVAL;
> +   ret = mmc_of_parse(gd->fdt_blob, dev_of_offset(dev), >cfg);
> +   if (ret < 0) {
> +   dev_err(dev, "failed to parse host caps\n");
> +   return ret;
> }
>
> +   plat->cfg.name = dev->name;
> +   plat->cfg.host_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
> +
> if (quirks)
> priv->caps = quirks;
>
> --
> 2.11.0
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot



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


[U-Boot] [PATCH] [RFC] imx: dek_blob: Fix lock-up on dek_blob command

2017-10-13 Thread Henri Roosen
The function blob_encap_dek accesses a CAAM register
 CONFIG_SYS_FSL_JR0_ADDR + 0x102c, before the CAAM clock has been enabled,
which causes the system to lock-up at the dek_blob command.

This patch enables and disables the CAAM clock, because this is also done in
arch/arm/imx-common/hab.c:authenticate_image(). However in my opinion
controlling the clock should be done in one of the underlaying layers, so
this needs further cleanup.

Please comment on a clean implementation of controlling of the CAAM clock.

Signed-off-by: Henri Roosen 
---
 arch/arm/imx-common/cmd_dek.c | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/arch/arm/imx-common/cmd_dek.c b/arch/arm/imx-common/cmd_dek.c
index ada8adf..72a7d49 100644
--- a/arch/arm/imx-common/cmd_dek.c
+++ b/arch/arm/imx-common/cmd_dek.c
@@ -30,20 +30,22 @@ static int blob_encap_dek(const u8 *src, u8 *dst, u32 len)
 {
int ret = 0;
u32 jr_size = 4;
-
-   u32 out_jr_size = sec_in32(CONFIG_SYS_FSL_JR0_ADDR + 0x102c);
-   if (out_jr_size != jr_size) {
-   hab_caam_clock_enable(1);
-   sec_init();
-   }
+   u32 out_jr_size;
 
if (!((len == 128) | (len == 192) | (len == 256))) {
debug("Invalid DEK size. Valid sizes are 128, 192 and 256b\n");
return -1;
}
 
+   hab_caam_clock_enable(1);
+   out_jr_size = sec_in32(CONFIG_SYS_FSL_JR0_ADDR + 0x102c);
+   if (out_jr_size != jr_size) {
+   sec_init();
+   }
+
len /= 8;
ret = blob_dek(src, dst, len);
+   hab_caam_clock_enable(0);
 
return ret;
 }
-- 
2.1.4

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


[U-Boot] [PATCH] drivers: core: Add translation in live tree case

2017-10-13 Thread Mario Six
The function dev_read_addr calls ofnode_get_addr_index in the live tree
case, which does not apply bus translations to the address read from the
device tree. This results in illegal addresses on boards that rely on
bus translations being applied.

Fix this situation by applying bus translations in the live tree case as
well.

Signed-off-by: Mario Six 
---
 drivers/core/ofnode.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 9123e88425..d7d8f039b9 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -215,13 +215,15 @@ fdt_addr_t ofnode_get_addr_index(ofnode node, int index)
uint flags;
u64 size;
int na;
+   __be32 addr;
 
prop_val = of_get_address(ofnode_to_np(node), index, ,
  );
if (!prop_val)
return FDT_ADDR_T_NONE;
na = of_n_addr_cells(ofnode_to_np(node));
-   return of_read_number(prop_val, na);
+   addr = of_read_number(prop_val, na);
+   return of_translate_address(ofnode_to_np(node), );
} else {
return fdt_get_base_address(gd->fdt_blob,
ofnode_to_offset(node));
-- 
2.11.0

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


Re: [U-Boot] [PATCH 3/3] x86: baytrail: fsp: Move Azalia update codes to board

2017-10-13 Thread Stefan Roese

On 13.10.2017 10:30, Bin Meng wrote:

Azalia configuration may be different across boards, hence it's not
appropriate to do that in the SoC level. Instead, let's make the
SoC update_fsp_azalia_configs() routine as a weak version, and do
the actual work in the board codes.

So far it seems only som-db5800-som-6867 board enables the Azalia.
Move the original codes into som-db5800-som-6867.c.

Signed-off-by: Bin Meng 
---

  arch/x86/cpu/baytrail/fsp_configs.c| 111 +
  .../som-db5800-som-6867/som-db5800-som-6867.c  | 111 +
  2 files changed, 113 insertions(+), 109 deletions(-)

diff --git a/arch/x86/cpu/baytrail/fsp_configs.c 
b/arch/x86/cpu/baytrail/fsp_configs.c
index 3052fb6..6b762e5 100644
--- a/arch/x86/cpu/baytrail/fsp_configs.c
+++ b/arch/x86/cpu/baytrail/fsp_configs.c
@@ -12,122 +12,15 @@
  
  DECLARE_GLOBAL_DATA_PTR;
  
-/* ALC262 Verb Table - 10EC0262 */

-static const u32 verb_table_data13[] = {
-   /* Pin Complex (NID 0x11) */
-   0x01171cf0,
-   0x01171d11,
-   0x01171e11,
-   0x01171f41,
-   /* Pin Complex (NID 0x12) */
-   0x01271cf0,
-   0x01271d11,
-   0x01271e11,
-   0x01271f41,
-   /* Pin Complex (NID 0x14) */
-   0x01471c10,
-   0x01471d40,
-   0x01471e01,
-   0x01471f01,
-   /* Pin Complex (NID 0x15) */
-   0x01571cf0,
-   0x01571d11,
-   0x01571e11,
-   0x01571f41,
-   /* Pin Complex (NID 0x16) */
-   0x01671cf0,
-   0x01671d11,
-   0x01671e11,
-   0x01671f41,
-   /* Pin Complex (NID 0x18) */
-   0x01871c20,
-   0x01871d98,
-   0x01871ea1,
-   0x01871f01,
-   /* Pin Complex (NID 0x19) */
-   0x01971c21,
-   0x01971d98,
-   0x01971ea1,
-   0x01971f02,
-   /* Pin Complex (NID 0x1A) */
-   0x01a71c2f,
-   0x01a71d30,
-   0x01a71e81,
-   0x01a71f01,
-   /* Pin Complex */
-   0x01b71c1f,
-   0x01b71d40,
-   0x01b71e21,
-   0x01b71f02,
-   /* Pin Complex */
-   0x01c71cf0,
-   0x01c71d11,
-   0x01c71e11,
-   0x01c71f41,
-   /* Pin Complex */
-   0x01d71c01,
-   0x01d71dc6,
-   0x01d71e14,
-   0x01d71f40,
-   /* Pin Complex */
-   0x01e71cf0,
-   0x01e71d11,
-   0x01e71e11,
-   0x01e71f41,
-   /* Pin Complex */
-   0x01f71cf0,
-   0x01f71d11,
-   0x01f71e11,
-   0x01f71f41,
-};
-
-/*
- * This needs to be in ROM since if we put it in CAR, FSP init loses it when
- * it drops CAR.
- *
- * TODO(s...@chromium.org): Move to device tree when FSP allows it
- *
- * VerbTable: (RealTek ALC262)
- * Revision ID = 0xFF, support all steps
- * Codec Verb Table For AZALIA
- * Codec Address: CAd value (0/1/2)
- * Codec Vendor: 0x10EC0262
- */
-static const struct azalia_verb_table azalia_verb_table[] = {
-   {
-   {
-   0x10ec0262,
-   0x,
-   0xff,
-   0x01,
-   0x000b,
-   0x0002,
-   },
-   verb_table_data13
-   }
-};
-
-const struct azalia_config azalia_config = {
-   .pme_enable = 1,
-   .docking_supported = 1,
-   .docking_attached = 0,
-   .hdmi_codec_enable = 1,
-   .azalia_v_ci_enable = 1,
-   .rsvdbits = 0,
-   .verb_table_num = 1,
-   .verb_table = azalia_verb_table,
-   .reset_wait_timer_ms = 300
-};
-
  /**
   * Override the FSP's Azalia configuration data
   *
   * @azalia:   pointer to be updated to point to a ROM address where Azalia
   *configuration data is stored
   */
-static void update_fsp_azalia_configs(struct azalia_config **azalia)
+__weak void update_fsp_azalia_configs(struct azalia_config **azalia)
  {
-   *azalia = (struct azalia_config *)_config;
+   *azalia = NULL;
  }
  
  /**

diff --git a/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c 
b/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c
index 6158795..202e9875 100644
--- a/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c
+++ b/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c
@@ -6,6 +6,117 @@
   */
  
  #include 

+#include 
+
+/* ALC262 Verb Table - 10EC0262 */
+static const u32 verb_table_data13[] = {
+   /* Pin Complex (NID 0x11) */
+   0x01171cf0,
+   0x01171d11,
+   0x01171e11,
+   0x01171f41,
+   /* Pin Complex (NID 0x12) */
+   0x01271cf0,
+   0x01271d11,
+   0x01271e11,
+   0x01271f41,
+   /* Pin Complex (NID 0x14) */
+   0x01471c10,
+   0x01471d40,
+   0x01471e01,
+   0x01471f01,
+   /* Pin Complex (NID 0x15) */
+   0x01571cf0,
+   0x01571d11,
+   0x01571e11,
+   0x01571f41,
+   /* Pin Complex (NID 0x16) */
+   0x01671cf0,
+   0x01671d11,
+   0x01671e11,
+   0x01671f41,
+   /* Pin Complex (NID 0x18) */
+   0x01871c20,
+

Re: [U-Boot] [PATCH 1/3] x86: fsp: Consolidate Azalia header file

2017-10-13 Thread Stefan Roese

On 13.10.2017 10:30, Bin Meng wrote:

So far there are two copies of Azalia struct defines with one in
baytrail and the other one in braswell. This consolidates these
two into one, put it in the common place, and remove the prefix
pch_ to these structs to make their names more generic.

This also corrects reset_wait_timer from us to ms.

Signed-off-by: Bin Meng 
---

  arch/x86/cpu/baytrail/fsp_configs.c  | 13 
  arch/x86/include/asm/arch-baytrail/fsp/azalia.h  | 39 
  arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h | 26 
  arch/x86/include/asm/fsp/fsp_azalia.h| 39 
  arch/x86/include/asm/fsp/fsp_support.h   |  1 +
  5 files changed, 46 insertions(+), 72 deletions(-)
  delete mode 100644 arch/x86/include/asm/arch-baytrail/fsp/azalia.h
  create mode 100644 arch/x86/include/asm/fsp/fsp_azalia.h

diff --git a/arch/x86/cpu/baytrail/fsp_configs.c 
b/arch/x86/cpu/baytrail/fsp_configs.c
index 45f9bf9..926f26b 100644
--- a/arch/x86/cpu/baytrail/fsp_configs.c
+++ b/arch/x86/cpu/baytrail/fsp_configs.c
@@ -8,13 +8,12 @@
  
  #include 

  #include 
-#include 
  #include 
  
  DECLARE_GLOBAL_DATA_PTR;
  
  /* ALC262 Verb Table - 10EC0262 */

-static const uint32_t verb_table_data13[] = {
+static const u32 verb_table_data13[] = {
/* Pin Complex (NID 0x11) */
0x01171cf0,
0x01171d11,
@@ -94,7 +93,7 @@ static const uint32_t verb_table_data13[] = {
   * Codec Address: CAd value (0/1/2)
   * Codec Vendor: 0x10EC0262
   */
-static const struct pch_azalia_verb_table azalia_verb_table[] = {
+static const struct azalia_verb_table azalia_verb_table[] = {
{
{
0x10ec0262,
@@ -108,16 +107,16 @@ static const struct pch_azalia_verb_table 
azalia_verb_table[] = {
}
  };
  
-const struct pch_azalia_config azalia_config = {

+const struct azalia_config azalia_config = {
.pme_enable = 1,
.docking_supported = 1,
.docking_attached = 0,
.hdmi_codec_enable = 1,
.azalia_v_ci_enable = 1,
.rsvdbits = 0,
-   .azalia_verb_table_num = 1,
-   .azalia_verb_table = azalia_verb_table,
-   .reset_wait_timer_us = 300
+   .verb_table_num = 1,
+   .verb_table = azalia_verb_table,
+   .reset_wait_timer_ms = 300
  };
  
  /**

diff --git a/arch/x86/include/asm/arch-baytrail/fsp/azalia.h 
b/arch/x86/include/asm/arch-baytrail/fsp/azalia.h
deleted file mode 100644
index d96a20f..000
--- a/arch/x86/include/asm/arch-baytrail/fsp/azalia.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2013, Intel Corporation
- * Copyright (C) 2015 Google, Inc
- *
- * SPDX-License-Identifier:Intel
- */
-
-#ifndef _FSP_AZALIA_H_
-#define _FSP_AZALIA_H_
-
-struct __packed pch_azalia_verb_table_header {
-   uint32_t vendor_device_id;
-   uint16_t sub_system_id;
-   uint8_t revision_id;/* 0xff applies to all steppings */
-   uint8_t front_panel_support;
-   uint16_t number_of_rear_jacks;
-   uint16_t number_of_front_jacks;
-};
-
-struct __packed pch_azalia_verb_table {
-   struct pch_azalia_verb_table_header verb_table_header;
-   const uint32_t *verb_table_data;
-};
-
-struct __packed pch_azalia_config {
-   uint8_t pme_enable:1;
-   uint8_t docking_supported:1;
-   uint8_t docking_attached:1;
-   uint8_t hdmi_codec_enable:1;
-   uint8_t azalia_v_ci_enable:1;
-   uint8_t rsvdbits:3;
-   /* number of verb tables provided by platform */
-   uint8_t azalia_verb_table_num;
-   const struct pch_azalia_verb_table *azalia_verb_table;
-   /* delay timer after azalia reset */
-   uint16_t reset_wait_timer_us;
-};
-
-#endif
diff --git a/arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h 
b/arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h
index ecb01fa..99c4c0a 100644
--- a/arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h
+++ b/arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h
@@ -29,32 +29,6 @@ struct __packed memory_upd {
u8 reserved[189];   /* Offset 0x0043 */
  };
  
-struct __packed azalia_verb_table_header {

-   u32 vendor_device_id;
-   u16 sub_system_id;
-   u8 revision_id;
-   u8 front_panel_support;
-   u16 number_of_rear_jacks;
-   u16 number_of_front_jacks;
-};
-
-struct __packed azalia_verb_table {
-   struct azalia_verb_table_header header;
-   u32 *data;
-};
-
-struct __packed azalia_config {
-   u8 pme_enable:1;
-   u8 docking_supported:1;
-   u8 docking_attached:1;
-   u8 hdmi_codec_enable:1;
-   u8 azalia_v_ci_enable:1;
-   u8 reserved:3;
-   u8 verb_table_num;
-   struct azalia_verb_table *verb_table;
-   u16 reset_wait_timer_ms;
-};
-
  struct gpio_family {
u32 confg;
u32 confg_changes;
diff --git a/arch/x86/include/asm/fsp/fsp_azalia.h 
b/arch/x86/include/asm/fsp/fsp_azalia.h
new file mode 

Re: [U-Boot] [PATCH 2/3] x86: baytrail: fsp: Use a function to update the Azalia config pointer

2017-10-13 Thread Stefan Roese

On 13.10.2017 10:30, Bin Meng wrote:

At present we directly pass the Azalia config pointer to the FSP UPD.
This updates to use a function to do the stuff, like Braswell does.

Signed-off-by: Bin Meng 
---

  arch/x86/cpu/baytrail/fsp_configs.c  | 15 +--
  arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h |  2 +-
  2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/arch/x86/cpu/baytrail/fsp_configs.c 
b/arch/x86/cpu/baytrail/fsp_configs.c
index 926f26b..3052fb6 100644
--- a/arch/x86/cpu/baytrail/fsp_configs.c
+++ b/arch/x86/cpu/baytrail/fsp_configs.c
@@ -120,6 +120,17 @@ const struct azalia_config azalia_config = {
  };
  
  /**

+ * Override the FSP's Azalia configuration data
+ *
+ * @azalia:pointer to be updated to point to a ROM address where Azalia
+ * configuration data is stored
+ */
+static void update_fsp_azalia_configs(struct azalia_config **azalia)
+{
+   *azalia = (struct azalia_config *)_config;
+}
+
+/**
   * Override the FSP's configuration data.
   * If the device tree does not specify an integer setting, use the default
   * provided in Intel's Baytrail_FSP_Gold4.tgz release FSP/BayleyBayFsp.bsf 
file.
@@ -137,8 +148,6 @@ void update_fsp_configs(struct fsp_config_data *config,
rt_buf->common.boot_mode = config->common.boot_mode;
rt_buf->common.upd_data = >fsp_upd;
  
-	fsp_upd->azalia_config_ptr = (uint32_t)_config;

-
node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_BAYTRAIL_FSP);
if (node < 0) {
debug("%s: Cannot find FSP node\n", __func__);
@@ -173,6 +182,8 @@ void update_fsp_configs(struct fsp_config_data *config,
SATA_MODE_AHCI);
fsp_upd->enable_azalia = fdtdec_get_bool(blob, node,
 "fsp,enable-azalia");
+   if (fsp_upd->enable_azalia)
+   update_fsp_azalia_configs(_upd->azalia_cfg_ptr);
fsp_upd->enable_xhci = fdtdec_get_bool(blob, node, "fsp,enable-xhci");
fsp_upd->lpe_mode = fdtdec_get_int(blob, node, "fsp,lpe-mode",
   LPE_MODE_PCI);
diff --git a/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h 
b/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h
index 8c07b37..e2f0e39 100644
--- a/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h
+++ b/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h
@@ -45,7 +45,7 @@ struct __packed upd_region {
uint8_t enable_sata;/* Offset 0x002d */
uint8_t sata_mode;  /* Offset 0x002e */
uint8_t enable_azalia;  /* Offset 0x002f */
-   uint32_t azalia_config_ptr; /* Offset 0x0030 */
+   struct azalia_config *azalia_cfg_ptr;   /* Offset 0x0030 */
uint8_t enable_xhci;/* Offset 0x0034 */
uint8_t lpe_mode;   /* Offset 0x0035 */
uint8_t lpss_sio_mode;  /* Offset 0x0036 */



Reviewed-by: Stefan Roese 

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


Re: [U-Boot] [PATCH 07/20] usb: dwc3-uniphier: replace with

2017-10-13 Thread Marek Vasut
On 10/13/2017 01:01 PM, Masahiro Yamada wrote:
> Hi Marek,
> 
> 
> 2017-10-13 19:40 GMT+09:00 Marek Vasut :
>> On 10/13/2017 12:21 PM, Masahiro Yamada wrote:
>>> Including  pulls in a lot of bloat.  What this driver needs
>>> is BIT(), so replace it with 
>>>
>>> Signed-off-by: Masahiro Yamada 
>>
>> Doesn't common.h also pull in the config macros ? Maybe they are not
>> needed here though ...
> 
> 
> If you need legacy CONFIG from include/configs/.h,
> yes, you need to include 
> (or  at least)
> 
> 
> Recent CONFIG options from Kconfig are automatically provided
> via  -include $(srctree)/include/linux/kconfig.h

OK, so not needed , perfect, thanks.

Acked-by: Marek Vasut 

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] x86: baytrail: Fix unstable ACPI S3 resume

2017-10-13 Thread Stefan Roese

On 12.10.2017 14:07, Bin Meng wrote:

It was observed that when booting a Ubuntu 16.04 kernel, doing ACPI
S3 suspend/resume sometimes causes the Ubuntu kernel hang forever.
The issue is however not reproduced with a kernel built from i386/
x86_64 defconfig configuration.

The unstability is actually caused by unexpected interrupts being
generated during the S3 resume. For some unknown reason, FSP (gold4)
for BayTrail configures the GPIO DFX5 PAD to enable level interrupt
(bit 24 and 25). As this pin keeps generating interrupts during an
S3 resume, and there is no IRQ requester in the kernel to handle it,
the kernel seems to hang and does not continue resuming.

Clear the mysterious interrupt bits for this pin.


Thanks for working on this. This must have been very tough to debug
and fix.


Reported-by: Stefan Roese 
Signed-off-by: Bin Meng 


Tested-by: Stefan Roese 
Reviewed-by: Stefan Roese 

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


Re: [U-Boot] [PATCH 2/2] x86: Turn off running VGA ROM during S3 resume

2017-10-13 Thread Stefan Roese

On 12.10.2017 14:07, Bin Meng wrote:

This is only needed when graphics console is used. For kernel with
native graphics driver, this can be turned off to speed up.

Change this option's default to n in the Kconfig.

Signed-off-by: Bin Meng 
---

  arch/x86/Kconfig | 1 -
  1 file changed, 1 deletion(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 38a6187..c869ae2 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -677,7 +677,6 @@ config HAVE_ACPI_RESUME
  config S3_VGA_ROM_RUN
bool "Re-run VGA option ROMs on S3 resume"
depends on HAVE_ACPI_RESUME
-   default y if HAVE_ACPI_RESUME
help
  Execute VGA option ROMs in U-Boot when resuming from S3. Normally
  this is needed when graphics console is being used in the kernel.



Reviewed-by: Stefan Roese 

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


Re: [U-Boot] [PATCH 07/20] usb: dwc3-uniphier: replace with

2017-10-13 Thread Masahiro Yamada
Hi Marek,


2017-10-13 19:40 GMT+09:00 Marek Vasut :
> On 10/13/2017 12:21 PM, Masahiro Yamada wrote:
>> Including  pulls in a lot of bloat.  What this driver needs
>> is BIT(), so replace it with 
>>
>> Signed-off-by: Masahiro Yamada 
>
> Doesn't common.h also pull in the config macros ? Maybe they are not
> needed here though ...


If you need legacy CONFIG from include/configs/.h,
yes, you need to include 
(or  at least)


Recent CONFIG options from Kconfig are automatically provided
via  -include $(srctree)/include/linux/kconfig.h




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


Re: [U-Boot] [PATCH v2 0/2] Support for TI bandgap temperature sensor

2017-10-13 Thread Faiz Abbas
Hi,

On Monday 09 October 2017 05:47 PM, Faiz Abbas wrote:
> Adding support for TI bandgap temperature sensor.
> Also add dt support for bandgap sensor in spl.
> 
> Faiz Abbas (2):
>   thermal: ti-bandgap: Add support for temperature sensor
>   ARM: dts: OMAP5+: Add support for bandgap sensor in SPL
> 
>  arch/arm/dts/omap5-u-boot.dtsi |   4 +
>  common/spl/Kconfig |   8 +
>  configs/dra7xx_evm_defconfig   |   3 +
>  .../thermal/ti_soc_thermal.txt |  35 
>  drivers/Makefile   |   2 +-
>  drivers/thermal/Kconfig|   6 +
>  drivers/thermal/Makefile   |   1 +
>  drivers/thermal/ti-bandgap.c   | 197 
> +
>  8 files changed, 255 insertions(+), 1 deletion(-)
>  create mode 100644 doc/device-tree-bindings/thermal/ti_soc_thermal.txt
>  create mode 100644 drivers/thermal/ti-bandgap.c
> 

Gentle ping.

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


Re: [U-Boot] [PATCH 07/20] usb: dwc3-uniphier: replace with

2017-10-13 Thread Marek Vasut
On 10/13/2017 12:21 PM, Masahiro Yamada wrote:
> Including  pulls in a lot of bloat.  What this driver needs
> is BIT(), so replace it with 
> 
> Signed-off-by: Masahiro Yamada 

Doesn't common.h also pull in the config macros ? Maybe they are not
needed here though ...

> ---
> 
>  drivers/usb/dwc3/dwc3-uniphier.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc3/dwc3-uniphier.c 
> b/drivers/usb/dwc3/dwc3-uniphier.c
> index 0d13770..25b17a8 100644
> --- a/drivers/usb/dwc3/dwc3-uniphier.c
> +++ b/drivers/usb/dwc3/dwc3-uniphier.c
> @@ -7,8 +7,8 @@
>   * SPDX-License-Identifier:  GPL-2.0+
>   */
>  
> -#include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 
> 


-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH] i2c: remove DECLARE_GLOBAL_DATA_PTR from i2c-uclass

2017-10-13 Thread Masahiro Yamada
No global pointer is used in this file.

Signed-off-by: Masahiro Yamada 
---

 drivers/i2c/i2c-uclass.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c
index 1397f34..920811a 100644
--- a/drivers/i2c/i2c-uclass.c
+++ b/drivers/i2c/i2c-uclass.c
@@ -12,8 +12,6 @@
 #include 
 #include 
 
-DECLARE_GLOBAL_DATA_PTR;
-
 #define I2C_MAX_OFFSET_LEN 4
 
 /* Useful debugging function */
-- 
2.7.4

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


[U-Boot] [PATCH 09/20] i2c: uniphier-f: replace debug() with dev_dbg()

2017-10-13 Thread Masahiro Yamada
Use dev_dbg() functions.  It will be helpful to prefix log messages
with the corresponding device name when the core framework is ready.

While I am here, I renamed "dev", which was actually private data,
into "priv" because dev->dev looks confusing.

Signed-off-by: Masahiro Yamada 
---

 drivers/i2c/i2c-uniphier-f.c | 114 ---
 1 file changed, 52 insertions(+), 62 deletions(-)

diff --git a/drivers/i2c/i2c-uniphier-f.c b/drivers/i2c/i2c-uniphier-f.c
index e51537b..eb6c9f3 100644
--- a/drivers/i2c/i2c-uniphier-f.c
+++ b/drivers/i2c/i2c-uniphier-f.c
@@ -6,13 +6,12 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-#include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 
@@ -64,35 +63,27 @@ struct uniphier_fi2c_regs {
 
 #define FIOCLK 5000
 
-struct uniphier_fi2c_dev {
+struct uniphier_fi2c_priv {
+   struct udevice *dev;
struct uniphier_fi2c_regs __iomem *regs;/* register base */
unsigned long fioclk;   /* internal operation clock */
unsigned long timeout;  /* time out (us) */
 };
 
-static int reset_bus(struct uniphier_fi2c_regs __iomem *regs)
+static void uniphier_fi2c_reset(struct uniphier_fi2c_priv *priv)
 {
-   u32 val;
-   int ret;
-
-   /* bus forcible reset */
-   writel(I2C_RST_RST, >rst);
-   ret = readl_poll_timeout(>rst, val, !(val & I2C_RST_RST), 1);
-   if (ret < 0)
-   debug("error: fail to reset I2C controller\n");
-
-   return ret;
+   writel(I2C_RST_RST, >regs->rst);
 }
 
-static int check_device_busy(struct uniphier_fi2c_regs __iomem *regs)
+static int uniphier_fi2c_check_bus_busy(struct uniphier_fi2c_priv *priv)
 {
u32 val;
int ret;
 
-   ret = readl_poll_timeout(>sr, val, !(val & I2C_SR_DB), 100);
+   ret = readl_poll_timeout(>regs->sr, val, !(val & I2C_SR_DB), 100);
if (ret < 0) {
-   debug("error: device busy too long. reset...\n");
-   ret = reset_bus(regs);
+   dev_dbg(priv->dev, "error: device busy too long. reset...\n");
+   uniphier_fi2c_reset(priv);
}
 
return ret;
@@ -101,8 +92,7 @@ static int check_device_busy(struct uniphier_fi2c_regs 
__iomem *regs)
 static int uniphier_fi2c_probe(struct udevice *dev)
 {
fdt_addr_t addr;
-   struct uniphier_fi2c_dev *priv = dev_get_priv(dev);
-   int ret;
+   struct uniphier_fi2c_priv *priv = dev_get_priv(dev);
 
addr = devfdt_get_addr(dev);
if (addr == FDT_ADDR_T_NONE)
@@ -114,85 +104,85 @@ static int uniphier_fi2c_probe(struct udevice *dev)
 
priv->fioclk = FIOCLK;
 
+   priv->dev = dev;
+
/* bus forcible reset */
-   ret = reset_bus(priv->regs);
-   if (ret < 0)
-   return ret;
+   uniphier_fi2c_reset(priv);
 
writel(I2C_BRST_FOEN | I2C_BRST_RSCLO, >regs->brst);
 
return 0;
 }
 
-static int wait_for_irq(struct uniphier_fi2c_dev *dev, u32 flags,
+static int wait_for_irq(struct uniphier_fi2c_priv *priv, u32 flags,
bool *stop)
 {
u32 irq;
int ret;
 
-   ret = readl_poll_timeout(>regs->intr, irq, irq & flags,
-dev->timeout);
+   ret = readl_poll_timeout(>regs->intr, irq, irq & flags,
+priv->timeout);
if (ret < 0) {
-   debug("error: time out\n");
+   dev_dbg(priv->dev, "error: time out\n");
return ret;
}
 
if (irq & I2C_INT_AL) {
-   debug("error: arbitration lost\n");
+   dev_dbg(priv->dev, "error: arbitration lost\n");
*stop = false;
return ret;
}
 
if (irq & I2C_INT_NA) {
-   debug("error: no answer\n");
+   dev_dbg(priv->dev, "error: no answer\n");
return ret;
}
 
return 0;
 }
 
-static int issue_stop(struct uniphier_fi2c_dev *dev, int old_ret)
+static int issue_stop(struct uniphier_fi2c_priv *priv, int old_ret)
 {
int ret;
 
-   debug("stop condition\n");
-   writel(I2C_CR_MST | I2C_CR_STO, >regs->cr);
+   dev_dbg(priv->dev, "stop condition\n");
+   writel(I2C_CR_MST | I2C_CR_STO, >regs->cr);
 
-   ret = check_device_busy(dev->regs);
+   ret = uniphier_fi2c_check_bus_busy(priv);
if (ret < 0)
-   debug("error: device busy after operation\n");
+   dev_dbg(priv->dev, "error: device busy after operation\n");
 
return old_ret ? old_ret : ret;
 }
 
-static int uniphier_fi2c_transmit(struct uniphier_fi2c_dev *dev, uint addr,
+static int uniphier_fi2c_transmit(struct uniphier_fi2c_priv *priv, uint addr,
  uint len, const u8 *buf, bool *stop)
 {
int ret;
const u32 irq_flags = 

[U-Boot] [PATCH 17/20] ARM: dts: uniphier: prepare to use clock for serial

2017-10-13 Thread Masahiro Yamada
The serial driver is probed by SPL and/or board_init_f.  To get the
clock from the serial driver, the clock node must be marked as
u-boot,dm-pre-reloc.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/dts/uniphier-v7-u-boot.dtsi |  8 
 arch/arm/dts/uniphier-v8-u-boot.dtsi | 13 +
 2 files changed, 21 insertions(+)
 create mode 100644 arch/arm/dts/uniphier-v8-u-boot.dtsi

diff --git a/arch/arm/dts/uniphier-v7-u-boot.dtsi 
b/arch/arm/dts/uniphier-v7-u-boot.dtsi
index 4a0c9c0..e3854fa 100644
--- a/arch/arm/dts/uniphier-v7-u-boot.dtsi
+++ b/arch/arm/dts/uniphier-v7-u-boot.dtsi
@@ -30,6 +30,14 @@
};
};
 
+   perictrl@5982 {
+   u-boot,dm-pre-reloc;
+
+   clock {
+   u-boot,dm-pre-reloc;
+   };
+   };
+
soc-glue@5f80 {
u-boot,dm-pre-reloc;
 
diff --git a/arch/arm/dts/uniphier-v8-u-boot.dtsi 
b/arch/arm/dts/uniphier-v8-u-boot.dtsi
new file mode 100644
index 000..3d83e62
--- /dev/null
+++ b/arch/arm/dts/uniphier-v8-u-boot.dtsi
@@ -0,0 +1,13 @@
+/ {
+   soc@0 {
+   u-boot,dm-pre-reloc;
+
+   perictrl@5982 {
+   u-boot,dm-pre-reloc;
+
+   clock {
+   u-boot,dm-pre-reloc;
+   };
+   };
+   };
+};
-- 
2.7.4

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


[U-Boot] [PATCH 05/20] pinctrl: uniphier: simplify input enable and delete pin arrays

2017-10-13 Thread Masahiro Yamada
The pin data are implemented for old SoCs to specify the bit shift of
the IECTRL register.  They are not wortwhile given the required memory
footprint.  Delete all the pin data and enable all bits of the IECTRL
register.

Signed-off-by: Masahiro Yamada 
---

 drivers/pinctrl/uniphier/pinctrl-uniphier-core.c | 17 +++---
 drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c  | 16 -
 drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c |  5 
 drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c | 15 
 drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c |  9 ---
 drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c | 30 
 6 files changed, 3 insertions(+), 89 deletions(-)

diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c 
b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c
index d314482..215b19e 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-core.c
@@ -9,6 +9,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -81,9 +82,6 @@ static int uniphier_pinconf_input_enable_legacy(struct 
udevice *dev,
unsigned int pin, int enable)
 {
struct uniphier_pinctrl_priv *priv = dev_get_priv(dev);
-   int pins_count = priv->socdata->pins_count;
-   const struct uniphier_pinctrl_pin *pins = priv->socdata->pins;
-   int i;
 
/*
 * Multiple pins share one input enable, per-pin disabling is
@@ -92,17 +90,8 @@ static int uniphier_pinconf_input_enable_legacy(struct 
udevice *dev,
if (!enable)
return -EINVAL;
 
-   for (i = 0; i < pins_count; i++) {
-   if (pins[i].number == pin) {
-   unsigned int iectrl;
-   u32 tmp;
-
-   iectrl = uniphier_pin_get_iectrl(pins[i].data);
-   tmp = readl(priv->base + UNIPHIER_PINCTRL_IECTRL);
-   tmp |= 1 << iectrl;
-   writel(tmp, priv->base + UNIPHIER_PINCTRL_IECTRL);
-   }
-   }
+   /* Set all bits instead of having a bunch of pin data */
+   writel(U32_MAX, priv->base + UNIPHIER_PINCTRL_IECTRL);
 
return 0;
 }
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c 
b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
index 709b005..7eb693d 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c
@@ -11,20 +11,6 @@
 
 #include "pinctrl-uniphier.h"
 
-static const struct uniphier_pinctrl_pin uniphier_ld4_pins[] = {
-   UNIPHIER_PINCTRL_PIN(53, 0),
-   UNIPHIER_PINCTRL_PIN(54, 0),
-   UNIPHIER_PINCTRL_PIN(55, 0),
-   UNIPHIER_PINCTRL_PIN(56, 0),
-   UNIPHIER_PINCTRL_PIN(67, 0),
-   UNIPHIER_PINCTRL_PIN(68, 0),
-   UNIPHIER_PINCTRL_PIN(69, 0),
-   UNIPHIER_PINCTRL_PIN(70, 0),
-   UNIPHIER_PINCTRL_PIN(85, 0),
-   UNIPHIER_PINCTRL_PIN(88, 0),
-   UNIPHIER_PINCTRL_PIN(156, 0),
-};
-
 static const unsigned emmc_pins[] = {21, 22, 23, 24, 25, 26, 27};
 static const int emmc_muxvals[] = {0, 1, 1, 1, 1, 1, 1};
 static const unsigned emmc_dat8_pins[] = {28, 29, 30, 31};
@@ -132,8 +118,6 @@ static const char * const uniphier_ld4_functions[] = {
 };
 
 static struct uniphier_pinctrl_socdata uniphier_ld4_pinctrl_socdata = {
-   .pins = uniphier_ld4_pins,
-   .pins_count = ARRAY_SIZE(uniphier_ld4_pins),
.groups = uniphier_ld4_groups,
.groups_count = ARRAY_SIZE(uniphier_ld4_groups),
.functions = uniphier_ld4_functions,
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c 
b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
index df5f2d8..0695e07 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c
@@ -11,9 +11,6 @@
 
 #include "pinctrl-uniphier.h"
 
-static const struct uniphier_pinctrl_pin uniphier_pro4_pins[] = {
-};
-
 static const unsigned emmc_pins[] = {40, 41, 42, 43, 51, 52, 53};
 static const int emmc_muxvals[] = {1, 1, 1, 1, 1, 1, 1};
 static const unsigned emmc_dat8_pins[] = {44, 45, 46, 47};
@@ -151,8 +148,6 @@ static const char * const uniphier_pro4_functions[] = {
 };
 
 static struct uniphier_pinctrl_socdata uniphier_pro4_pinctrl_socdata = {
-   .pins = uniphier_pro4_pins,
-   .pins_count = ARRAY_SIZE(uniphier_pro4_pins),
.groups = uniphier_pro4_groups,
.groups_count = ARRAY_SIZE(uniphier_pro4_groups),
.functions = uniphier_pro4_functions,
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c 
b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
index 7b14662..39cdd95 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c
@@ -11,19 +11,6 @@
 
 #include "pinctrl-uniphier.h"
 
-static const struct uniphier_pinctrl_pin uniphier_pro5_pins[] = {
-   

[U-Boot] [PATCH 18/20] serial: uniphier: use clk for enable and get_rate

2017-10-13 Thread Masahiro Yamada
Get clock rate from the clock driver to drop U-Boot specific
property "clock-frequency".

Signed-off-by: Masahiro Yamada 
---

 drivers/serial/serial_uniphier.c | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/drivers/serial/serial_uniphier.c b/drivers/serial/serial_uniphier.c
index 68895bd..a9d8b5c 100644
--- a/drivers/serial/serial_uniphier.c
+++ b/drivers/serial/serial_uniphier.c
@@ -6,7 +6,7 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -90,11 +90,12 @@ static int uniphier_serial_pending(struct udevice *dev, 
bool input)
 
 static int uniphier_serial_probe(struct udevice *dev)
 {
-   DECLARE_GLOBAL_DATA_PTR;
struct uniphier_serial_private_data *priv = dev_get_priv(dev);
struct uniphier_serial __iomem *port;
+   struct clk clk;
fdt_addr_t base;
u32 tmp;
+   int ret;
 
base = devfdt_get_addr(dev);
if (base == FDT_ADDR_T_NONE)
@@ -106,8 +107,15 @@ static int uniphier_serial_probe(struct udevice *dev)
 
priv->membase = port;
 
-   priv->uartclk = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
-  "clock-frequency", 0);
+   ret = clk_get_by_index(dev, 0, );
+   if (ret)
+   return ret;
+
+   ret = clk_enable();
+   if (ret)
+   return ret;
+
+   priv->uartclk = clk_get_rate();
 
tmp = readl(>lcr_mcr);
tmp &= ~LCR_MASK;
-- 
2.7.4

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


[U-Boot] [PATCH] simple-bus: remove DECLARE_GLOBAL_DATA_PTR and

2017-10-13 Thread Masahiro Yamada
Both are unneeded in this file.

Signed-off-by: Masahiro Yamada 
---

 drivers/core/simple-bus.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/core/simple-bus.c b/drivers/core/simple-bus.c
index 14803e3..cc48c8b 100644
--- a/drivers/core/simple-bus.c
+++ b/drivers/core/simple-bus.c
@@ -4,11 +4,8 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-#include 
 #include 
 
-DECLARE_GLOBAL_DATA_PTR;
-
 struct simple_bus_plat {
u32 base;
u32 size;
-- 
2.7.4

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


[U-Boot] [PATCH 12/20] clk: uniphier: add peripheral clock data

2017-10-13 Thread Masahiro Yamada
Add peripheral clock data for all SoCs.

Signed-off-by: Masahiro Yamada 
---

 drivers/clk/uniphier/Makefile|   2 +
 drivers/clk/uniphier/clk-uniphier-core.c |  33 +
 drivers/clk/uniphier/clk-uniphier-peri.c | 113 +++
 drivers/clk/uniphier/clk-uniphier.h  |   5 ++
 4 files changed, 153 insertions(+)
 create mode 100644 drivers/clk/uniphier/clk-uniphier-peri.c

diff --git a/drivers/clk/uniphier/Makefile b/drivers/clk/uniphier/Makefile
index 54c7e09..d132cf7 100644
--- a/drivers/clk/uniphier/Makefile
+++ b/drivers/clk/uniphier/Makefile
@@ -1,3 +1,5 @@
 obj-y  += clk-uniphier-core.o
+
 obj-y  += clk-uniphier-sys.o
 obj-y  += clk-uniphier-mio.o
+obj-y  += clk-uniphier-peri.o
diff --git a/drivers/clk/uniphier/clk-uniphier-core.c 
b/drivers/clk/uniphier/clk-uniphier-core.c
index 9a7d03a..ed5acbd 100644
--- a/drivers/clk/uniphier/clk-uniphier-core.c
+++ b/drivers/clk/uniphier/clk-uniphier-core.c
@@ -333,6 +333,39 @@ static const struct udevice_id uniphier_clk_match[] = {
.compatible = "socionext,uniphier-pxs3-sd-clock",
.data = (ulong)uniphier_mio_clk_data,
},
+   /* Peripheral clock */
+   {
+   .compatible = "socionext,uniphier-ld4-peri-clock",
+   .data = (ulong)uniphier_ld4_peri_clk_data,
+   },
+   {
+   .compatible = "socionext,uniphier-pro4-peri-clock",
+   .data = (ulong)uniphier_pro4_peri_clk_data,
+   },
+   {
+   .compatible = "socionext,uniphier-sld8-peri-clock",
+   .data = (ulong)uniphier_sld8_peri_clk_data,
+   },
+   {
+   .compatible = "socionext,uniphier-pro5-peri-clock",
+   .data = (ulong)uniphier_pro4_peri_clk_data,
+   },
+   {
+   .compatible = "socionext,uniphier-pxs2-peri-clock",
+   .data = (ulong)uniphier_pxs2_peri_clk_data,
+   },
+   {
+   .compatible = "socionext,uniphier-ld11-peri-clock",
+   .data = (ulong)uniphier_ld11_peri_clk_data,
+   },
+   {
+   .compatible = "socionext,uniphier-ld20-peri-clock",
+   .data = (ulong)uniphier_ld11_peri_clk_data,
+   },
+   {
+   .compatible = "socionext,uniphier-pxs3-peri-clock",
+   .data = (ulong)uniphier_ld11_peri_clk_data,
+   },
{ /* sentinel */ }
 };
 
diff --git a/drivers/clk/uniphier/clk-uniphier-peri.c 
b/drivers/clk/uniphier/clk-uniphier-peri.c
new file mode 100644
index 000..51edcab
--- /dev/null
+++ b/drivers/clk/uniphier/clk-uniphier-peri.c
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2016-2017 Socionext Inc.
+ *   Author: Masahiro Yamada 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include "clk-uniphier.h"
+
+#define UNIPHIER_PERI_CLK_UART(id, ch) \
+   UNIPHIER_CLK_GATE(id, 128, 0x24, 19 + (ch))
+
+#define UNIPHIER_PERI_CLK_I2C(id, ch)  \
+   UNIPHIER_CLK_GATE(id, 129, 0x24, 5 + (ch))
+
+#define UNIPHIER_PERI_CLK_FI2C(id, ch) \
+   UNIPHIER_CLK_GATE(id, 129, 0x24, 24 + (ch))
+
+const struct uniphier_clk_data uniphier_ld4_peri_clk_data[] = {
+#ifdef CONFIG_ARCH_UNIPHIER_LD4
+   UNIPHIER_CLK_RATE(128, 36864000),
+   UNIPHIER_CLK_RATE(129, 9984),
+   UNIPHIER_PERI_CLK_UART(0, 0),
+   UNIPHIER_PERI_CLK_UART(1, 1),
+   UNIPHIER_PERI_CLK_UART(2, 2),
+   UNIPHIER_PERI_CLK_UART(3, 3),
+   UNIPHIER_PERI_CLK_I2C(4, 0),
+   UNIPHIER_PERI_CLK_I2C(5, 1),
+   UNIPHIER_PERI_CLK_I2C(6, 2),
+   UNIPHIER_PERI_CLK_I2C(7, 3),
+   UNIPHIER_PERI_CLK_I2C(8, 4),
+   UNIPHIER_PERI_CLK_I2C(9, 5),
+   UNIPHIER_PERI_CLK_I2C(10, 6),
+   { /* sentinel */ }
+#endif
+};
+
+const struct uniphier_clk_data uniphier_sld8_peri_clk_data[] = {
+#ifdef CONFIG_ARCH_UNIPHIER_SLD8
+   UNIPHIER_CLK_RATE(128, 8000),
+   UNIPHIER_CLK_RATE(129, 1),
+   UNIPHIER_PERI_CLK_UART(0, 0),
+   UNIPHIER_PERI_CLK_UART(1, 1),
+   UNIPHIER_PERI_CLK_UART(2, 2),
+   UNIPHIER_PERI_CLK_UART(3, 3),
+   UNIPHIER_PERI_CLK_I2C(4, 0),
+   UNIPHIER_PERI_CLK_I2C(5, 1),
+   UNIPHIER_PERI_CLK_I2C(6, 2),
+   UNIPHIER_PERI_CLK_I2C(7, 3),
+   UNIPHIER_PERI_CLK_I2C(8, 4),
+   UNIPHIER_PERI_CLK_I2C(9, 5),
+   UNIPHIER_PERI_CLK_I2C(10, 6),
+   { /* sentinel */ }
+#endif
+};
+
+const struct uniphier_clk_data uniphier_pro4_peri_clk_data[] = {
+#if defined(CONFIG_ARCH_UNIPHIER_PRO4) || defined(CONFIG_ARCH_UNIPHIER_PRO5)
+   UNIPHIER_CLK_RATE(128, 73728000),
+   UNIPHIER_CLK_RATE(129, 5000),
+   UNIPHIER_PERI_CLK_UART(0, 0),
+   UNIPHIER_PERI_CLK_UART(1, 1),
+   UNIPHIER_PERI_CLK_UART(2, 2),
+   UNIPHIER_PERI_CLK_UART(3, 3),
+   UNIPHIER_PERI_CLK_FI2C(4, 0),
+   UNIPHIER_PERI_CLK_FI2C(5, 1),
+   

[U-Boot] [PATCH 16/20] ARM: uniphier: split u-boot, dm-pre-reloc out to uniphier-v7-u-boot.dtsi

2017-10-13 Thread Masahiro Yamada
UniPhier 32-bit SoCs use CONFIG_SPL_OF_CONTROL.  So, many nodes must
be marked as dm-pre-reloc to prevent fdtgrep from stripping them off.

Sprinkling U-Boot specific properties all over the place is painful
because DT files are synced with Linux from time to time.

Split u-boot,dm-pre-reloc out to uniphier-v7-u-boot.dtsi, which is
appended to UniPhier V7 DTS before the build.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/dts/uniphier-ld4-ref.dts |  9 --
 arch/arm/dts/uniphier-ld4.dtsi|  3 --
 arch/arm/dts/uniphier-ld6b-ref.dts|  9 --
 arch/arm/dts/uniphier-pro4-ace.dts|  9 --
 arch/arm/dts/uniphier-pro4-ref.dts|  9 --
 arch/arm/dts/uniphier-pro4-sanji.dts  | 21 
 arch/arm/dts/uniphier-pro4.dtsi   |  4 ---
 arch/arm/dts/uniphier-pro5-4kbox.dts  |  9 --
 arch/arm/dts/uniphier-pro5.dtsi   |  4 ---
 arch/arm/dts/uniphier-pxs2-gentil.dts | 21 
 arch/arm/dts/uniphier-pxs2-vodka.dts  | 21 
 arch/arm/dts/uniphier-pxs2.dtsi   |  4 ---
 arch/arm/dts/uniphier-sld8-ref.dts|  9 --
 arch/arm/dts/uniphier-sld8.dtsi   |  3 --
 arch/arm/dts/uniphier-v7-u-boot.dtsi  | 61 +++
 arch/arm/mach-uniphier/Kconfig|  3 ++
 16 files changed, 64 insertions(+), 135 deletions(-)
 create mode 100644 arch/arm/dts/uniphier-v7-u-boot.dtsi

diff --git a/arch/arm/dts/uniphier-ld4-ref.dts 
b/arch/arm/dts/uniphier-ld4-ref.dts
index 0f50acb..0fd66e7 100644
--- a/arch/arm/dts/uniphier-ld4-ref.dts
+++ b/arch/arm/dts/uniphier-ld4-ref.dts
@@ -68,12 +68,3 @@
  {
status = "okay";
 };
-
-/* for U-Boot only */
- {
-   u-boot,dm-pre-reloc;
-};
-
-_uart0 {
-   u-boot,dm-pre-reloc;
-};
diff --git a/arch/arm/dts/uniphier-ld4.dtsi b/arch/arm/dts/uniphier-ld4.dtsi
index b816038..158beae 100644
--- a/arch/arm/dts/uniphier-ld4.dtsi
+++ b/arch/arm/dts/uniphier-ld4.dtsi
@@ -50,7 +50,6 @@
#size-cells = <1>;
ranges;
interrupt-parent = <>;
-   u-boot,dm-pre-reloc;
 
l2: l2-cache@500c {
compatible = "socionext,uniphier-system-cache";
@@ -295,11 +294,9 @@
compatible = "socionext,uniphier-ld4-soc-glue",
 "simple-mfd", "syscon";
reg = <0x5f80 0x2000>;
-   u-boot,dm-pre-reloc;
 
pinctrl: pinctrl {
compatible = "socionext,uniphier-ld4-pinctrl";
-   u-boot,dm-pre-reloc;
};
};
 
diff --git a/arch/arm/dts/uniphier-ld6b-ref.dts 
b/arch/arm/dts/uniphier-ld6b-ref.dts
index bdb7f50..926d37e 100644
--- a/arch/arm/dts/uniphier-ld6b-ref.dts
+++ b/arch/arm/dts/uniphier-ld6b-ref.dts
@@ -70,12 +70,3 @@
  {
status = "okay";
 };
-
-/* for U-Boot only */
- {
-   u-boot,dm-pre-reloc;
-};
-
-_uart0 {
-   u-boot,dm-pre-reloc;
-};
diff --git a/arch/arm/dts/uniphier-pro4-ace.dts 
b/arch/arm/dts/uniphier-pro4-ace.dts
index 8161ba8..60a8c33 100644
--- a/arch/arm/dts/uniphier-pro4-ace.dts
+++ b/arch/arm/dts/uniphier-pro4-ace.dts
@@ -90,12 +90,3 @@
  {
status = "okay";
 };
-
-/* for U-Boot only */
- {
-   u-boot,dm-pre-reloc;
-};
-
-_uart0 {
-   u-boot,dm-pre-reloc;
-};
diff --git a/arch/arm/dts/uniphier-pro4-ref.dts 
b/arch/arm/dts/uniphier-pro4-ref.dts
index 360b31d..1b22f80 100644
--- a/arch/arm/dts/uniphier-pro4-ref.dts
+++ b/arch/arm/dts/uniphier-pro4-ref.dts
@@ -83,12 +83,3 @@
  {
status = "okay";
 };
-
-/* for U-Boot only */
- {
-   u-boot,dm-pre-reloc;
-};
-
-_uart0 {
-   u-boot,dm-pre-reloc;
-};
diff --git a/arch/arm/dts/uniphier-pro4-sanji.dts 
b/arch/arm/dts/uniphier-pro4-sanji.dts
index 778e2bb..950f47a 100644
--- a/arch/arm/dts/uniphier-pro4-sanji.dts
+++ b/arch/arm/dts/uniphier-pro4-sanji.dts
@@ -85,24 +85,3 @@
  {
status = "okay";
 };
-
-/* for U-Boot only */
- {
-   u-boot,dm-pre-reloc;
-};
-
-_clk {
-   u-boot,dm-pre-reloc;
-};
-
- {
-   u-boot,dm-pre-reloc;
-};
-
-_uart0 {
-   u-boot,dm-pre-reloc;
-};
-
-_emmc {
-   u-boot,dm-pre-reloc;
-};
diff --git a/arch/arm/dts/uniphier-pro4.dtsi b/arch/arm/dts/uniphier-pro4.dtsi
index 5f39972..ea97e26 100644
--- a/arch/arm/dts/uniphier-pro4.dtsi
+++ b/arch/arm/dts/uniphier-pro4.dtsi
@@ -58,7 +58,6 @@
#size-cells = <1>;
ranges;
interrupt-parent = <>;
-   u-boot,dm-pre-reloc;
 
l2: l2-cache@500c {
compatible = "socionext,uniphier-system-cache";
@@ -224,7 +223,6 @@
compatible = "socionext,uniphier-pro4-mioctrl",
 "simple-mfd", "syscon";
reg = <0x5981 0x800>;
-   u-boot,dm-pre-reloc;
 
mio_clk: clock {
   

[U-Boot] [PATCH 02/20] gpio: uniphier: rework single device node model

2017-10-13 Thread Masahiro Yamada
First, I implemented this driver as per-bank model, but it was
a design mistake.

  - There are 31 banks in the maximum case.  It is painful to add
so many nodes to DT.

  - The IRQ control registers are shared between banks.  Per-bank
design is a problem for Linux.  The counterpart for Linux turned
around to the single node model.

Rework based on the driver for Linux.

Signed-off-by: Masahiro Yamada 
---

 drivers/gpio/gpio-uniphier.c | 140 +++
 1 file changed, 89 insertions(+), 51 deletions(-)

diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c
index c11e953..107c3fc 100644
--- a/drivers/gpio/gpio-uniphier.c
+++ b/drivers/gpio/gpio-uniphier.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Socionext Inc.
+ * Copyright (C) 2016-2017 Socionext Inc.
  *   Author: Masahiro Yamada 
  *
  * SPDX-License-Identifier:GPL-2.0+
@@ -11,73 +11,123 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
-#define UNIPHIER_GPIO_PORTS_PER_BANK   8
+#define UNIPHIER_GPIO_LINES_PER_BANK   8
 
-#define UNIPHIER_GPIO_REG_DATA 0   /* data */
-#define UNIPHIER_GPIO_REG_DIR  4   /* direction (1:in, 0:out) */
+#define UNIPHIER_GPIO_PORT_DATA0x0 /* data */
+#define UNIPHIER_GPIO_PORT_DIR 0x4 /* direction (1:in, 0:out) */
+#define UNIPHIER_GPIO_IRQ_EN   0x90/* irq enable */
 
 struct uniphier_gpio_priv {
-   void __iomem *base;
-   char bank_name[16];
+   void __iomem *regs;
 };
 
-static void uniphier_gpio_offset_write(struct udevice *dev, unsigned offset,
-  unsigned reg, int value)
+static unsigned int uniphier_gpio_bank_to_reg(unsigned int bank)
+{
+   unsigned int reg;
+
+   reg = (bank + 1) * 8;
+
+   /*
+* Unfortunately, the GPIO port registers are not contiguous because
+* offset 0x90-0x9f is used for IRQ.  Add 0x10 when crossing the region.
+*/
+   if (reg >= UNIPHIER_GPIO_IRQ_EN)
+   reg += 0x10;
+
+   return reg;
+}
+
+static void uniphier_gpio_get_bank_and_mask(unsigned int offset,
+   unsigned int *bank, u32 *mask)
+{
+   *bank = offset / UNIPHIER_GPIO_LINES_PER_BANK;
+   *mask = BIT(offset % UNIPHIER_GPIO_LINES_PER_BANK);
+}
+
+static void uniphier_gpio_reg_update(struct uniphier_gpio_priv *priv,
+unsigned int reg, u32 mask, u32 val)
 {
-   struct uniphier_gpio_priv *priv = dev_get_priv(dev);
u32 tmp;
 
-   tmp = readl(priv->base + reg);
-   if (value)
-   tmp |= BIT(offset);
-   else
-   tmp &= ~BIT(offset);
-   writel(tmp, priv->base + reg);
+   tmp = readl(priv->regs + reg);
+   tmp &= ~mask;
+   tmp |= mask & val;
+   writel(tmp, priv->regs + reg);
 }
 
-static int uniphier_gpio_offset_read(struct udevice *dev, unsigned offset,
-unsigned reg)
+static void uniphier_gpio_bank_write(struct udevice *dev, unsigned int bank,
+unsigned int reg, u32 mask, u32 val)
 {
struct uniphier_gpio_priv *priv = dev_get_priv(dev);
 
-   return !!(readl(priv->base + reg) & BIT(offset));
+   if (!mask)
+   return;
+
+   uniphier_gpio_reg_update(priv, uniphier_gpio_bank_to_reg(bank) + reg,
+mask, val);
 }
 
-static int uniphier_gpio_direction_input(struct udevice *dev, unsigned offset)
+static void uniphier_gpio_offset_write(struct udevice *dev, unsigned int 
offset,
+  unsigned int reg, int val)
 {
-   uniphier_gpio_offset_write(dev, offset, UNIPHIER_GPIO_REG_DIR, 1);
+   unsigned int bank;
+   u32 mask;
 
-   return 0;
+   uniphier_gpio_get_bank_and_mask(offset, , );
+
+   uniphier_gpio_bank_write(dev, bank, reg, mask, val ? mask : 0);
 }
 
-static int uniphier_gpio_direction_output(struct udevice *dev, unsigned offset,
- int value)
+static int uniphier_gpio_offset_read(struct udevice *dev,
+unsigned int offset, unsigned int reg)
 {
-   uniphier_gpio_offset_write(dev, offset, UNIPHIER_GPIO_REG_DATA, value);
-   uniphier_gpio_offset_write(dev, offset, UNIPHIER_GPIO_REG_DIR, 0);
+   struct uniphier_gpio_priv *priv = dev_get_priv(dev);
+   unsigned int bank, reg_offset;
+   u32 mask;
 
-   return 0;
+   uniphier_gpio_get_bank_and_mask(offset, , );
+   reg_offset = uniphier_gpio_bank_to_reg(bank) + reg;
+
+   return !!(readl(priv->regs + reg_offset) & mask);
 }
 
-static int uniphier_gpio_get_value(struct udevice *dev, unsigned offset)
+static int uniphier_gpio_get_function(struct udevice *dev, unsigned int offset)
 {
-   return uniphier_gpio_offset_read(dev, offset, 

[U-Boot] [PATCH 07/20] usb: dwc3-uniphier: replace with

2017-10-13 Thread Masahiro Yamada
Including  pulls in a lot of bloat.  What this driver needs
is BIT(), so replace it with 

Signed-off-by: Masahiro Yamada 
---

 drivers/usb/dwc3/dwc3-uniphier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/dwc3-uniphier.c b/drivers/usb/dwc3/dwc3-uniphier.c
index 0d13770..25b17a8 100644
--- a/drivers/usb/dwc3/dwc3-uniphier.c
+++ b/drivers/usb/dwc3/dwc3-uniphier.c
@@ -7,8 +7,8 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.7.4

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


[U-Boot] [PATCH 10/20] clk: uniphier: rework for better clock tree structure

2017-10-13 Thread Masahiro Yamada
U-Boot does not support fancy clock tree structures like the Linux
common clock framework.  Implement a simple clock tree model at the
driver level.  With this, the clock data will be simplified.

Signed-off-by: Masahiro Yamada 
---

 drivers/clk/uniphier/clk-uniphier-core.c | 267 ++-
 drivers/clk/uniphier/clk-uniphier-mio.c  | 118 +++---
 drivers/clk/uniphier/clk-uniphier-sys.c  |  42 +++--
 drivers/clk/uniphier/clk-uniphier.h  |  79 +
 4 files changed, 323 insertions(+), 183 deletions(-)

diff --git a/drivers/clk/uniphier/clk-uniphier-core.c 
b/drivers/clk/uniphier/clk-uniphier-core.c
index 722cd6b..3d1d411 100644
--- a/drivers/clk/uniphier/clk-uniphier-core.c
+++ b/drivers/clk/uniphier/clk-uniphier-core.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Socionext Inc.
+ * Copyright (C) 2016-2017 Socionext Inc.
  *   Author: Masahiro Yamada 
  *
  * SPDX-License-Identifier:GPL-2.0+
@@ -21,104 +21,224 @@
  * @data: SoC specific data
  */
 struct uniphier_clk_priv {
+   struct udevice *dev;
void __iomem *base;
const struct uniphier_clk_data *data;
 };
 
-static int uniphier_clk_enable(struct clk *clk)
+static void uniphier_clk_gate_enable(struct uniphier_clk_priv *priv,
+const struct uniphier_clk_gate_data *gate)
 {
-   struct uniphier_clk_priv *priv = dev_get_priv(clk->dev);
-   unsigned long id = clk->id;
-   const struct uniphier_clk_gate_data *p;
+   u32 val;
 
-   for (p = priv->data->gate; p->id != UNIPHIER_CLK_ID_END; p++) {
-   u32 val;
+   val = readl(priv->base + gate->reg);
+   val |= BIT(gate->bit);
+   writel(val, priv->base + gate->reg);
+}
 
-   if (p->id != id)
-   continue;
+static void uniphier_clk_mux_set_parent(struct uniphier_clk_priv *priv,
+   const struct uniphier_clk_mux_data *mux,
+   u8 id)
+{
+   u32 val;
+   int i;
 
-   val = readl(priv->base + p->reg);
-   val |= BIT(p->bit);
-   writel(val, priv->base + p->reg);
+   for (i = 0; i < mux->num_parents; i++) {
+   if (mux->parent_ids[i] != id)
+   continue;
 
-   return 0;
+   val = readl(priv->base + mux->reg);
+   val &= ~mux->masks[i];
+   val |= mux->vals[i];
+   writel(val, priv->base + mux->reg);
+   return;
}
 
-   dev_err(priv->dev, "clk_id=%lu was not handled\n", id);
-   return -EINVAL;
+   WARN_ON(1);
 }
 
-static const struct uniphier_clk_mux_data *
-uniphier_clk_get_mux_data(struct uniphier_clk_priv *priv, unsigned long id)
+static u8 uniphier_clk_mux_get_parent(struct uniphier_clk_priv *priv,
+ const struct uniphier_clk_mux_data *mux)
 {
-   const struct uniphier_clk_mux_data *p;
+   u32 val;
+   int i;
 
-   for (p = priv->data->mux; p->id != UNIPHIER_CLK_ID_END; p++) {
-   if (p->id == id)
-   return p;
-   }
+   val = readl(priv->base + mux->reg);
+
+   for (i = 0; i < mux->num_parents; i++)
+   if ((mux->masks[i] & val) == mux->vals[i])
+   return mux->parent_ids[i];
+
+   dev_err(priv->dev, "invalid mux setting\n");
+
+   return UNIPHIER_CLK_ID_INVALID;
+}
+
+static const struct uniphier_clk_data *uniphier_clk_get_data(
+   struct uniphier_clk_priv *priv, u8 id)
+{
+   const struct uniphier_clk_data *data;
+
+   for (data = priv->data; data->type != UNIPHIER_CLK_TYPE_END; data++)
+   if (data->id == id)
+   return data;
+
+   dev_err(priv->dev, "id=%u not found\n", id);
 
return NULL;
 }
 
-static ulong uniphier_clk_get_rate(struct clk *clk)
+static const struct uniphier_clk_data *uniphier_clk_get_parent_data(
+   struct uniphier_clk_priv *priv,
+   const struct uniphier_clk_data *data)
 {
-   struct uniphier_clk_priv *priv = dev_get_priv(clk->dev);
-   const struct uniphier_clk_mux_data *mux;
-   u32 val;
-   int i;
+   const struct uniphier_clk_data *parent_data;
+   u8 parent_id = UNIPHIER_CLK_ID_INVALID;
+
+   switch (data->type) {
+   case UNIPHIER_CLK_TYPE_GATE:
+   parent_id = data->data.gate.parent_id;
+   break;
+   case UNIPHIER_CLK_TYPE_MUX:
+   parent_id = uniphier_clk_mux_get_parent(priv, >data.mux);
+   break;
+   default:
+   break;
+   }
 
-   mux = uniphier_clk_get_mux_data(priv, clk->id);
-   if (!mux)
-   return 0;
+   if (parent_id == UNIPHIER_CLK_ID_INVALID)
+   return NULL;
 
-   

[U-Boot] [PATCH 03/20] ARM: dts: uniphier: update GPIO nodes

2017-10-13 Thread Masahiro Yamada
Switch to the single node design.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/dts/uniphier-ld11.dtsi |  23 +
 arch/arm/dts/uniphier-ld4.dtsi  | 115 ++
 arch/arm/dts/uniphier-pro4.dtsi | 206 ++--
 arch/arm/dts/uniphier-pro5.dtsi | 206 ++--
 arch/arm/dts/uniphier-pxs2.dtsi | 201 ++-
 arch/arm/dts/uniphier-pxs3.dtsi |   3 +-
 arch/arm/dts/uniphier-sld8.dtsi | 119 +++
 7 files changed, 71 insertions(+), 802 deletions(-)

diff --git a/arch/arm/dts/uniphier-ld11.dtsi b/arch/arm/dts/uniphier-ld11.dtsi
index 0f172c3..0cc6fd7 100644
--- a/arch/arm/dts/uniphier-ld11.dtsi
+++ b/arch/arm/dts/uniphier-ld11.dtsi
@@ -154,6 +154,29 @@
clock-frequency = <5882>;
};
 
+   gpio: gpio@5500 {
+   compatible = "socionext,uniphier-gpio";
+   reg = <0x5500 0x200>;
+   interrupt-parent = <>;
+   interrupt-controller;
+   #interrupt-cells = <2>;
+   gpio-controller;
+   #gpio-cells = <2>;
+   gpio-ranges = < 0 0 0>,
+ < 43 0 0>,
+ < 51 0 0>,
+ < 96 0 0>,
+ < 160 0 0>,
+ < 184 0 0>;
+   gpio-ranges-group-names = "gpio_range0",
+ "gpio_range1",
+ "gpio_range2",
+ "gpio_range3",
+ "gpio_range4",
+ "gpio_range5";
+   ngpios = <200>;
+   };
+
i2c0: i2c@5878 {
compatible = "socionext,uniphier-fi2c";
status = "disabled";
diff --git a/arch/arm/dts/uniphier-ld4.dtsi b/arch/arm/dts/uniphier-ld4.dtsi
index a3bcf22..b816038 100644
--- a/arch/arm/dts/uniphier-ld4.dtsi
+++ b/arch/arm/dts/uniphier-ld4.dtsi
@@ -108,116 +108,17 @@
clock-frequency = <36864000>;
};
 
-   port0x: gpio@5508 {
+   gpio: gpio@5500 {
compatible = "socionext,uniphier-gpio";
-   reg = <0x5508 0x8>;
-   gpio-controller;
-   #gpio-cells = <2>;
-   };
-
-   port1x: gpio@5510 {
-   compatible = "socionext,uniphier-gpio";
-   reg = <0x5510 0x8>;
-   gpio-controller;
-   #gpio-cells = <2>;
-   };
-
-   port2x: gpio@5518 {
-   compatible = "socionext,uniphier-gpio";
-   reg = <0x5518 0x8>;
-   gpio-controller;
-   #gpio-cells = <2>;
-   };
-
-   port3x: gpio@5520 {
-   compatible = "socionext,uniphier-gpio";
-   reg = <0x5520 0x8>;
-   gpio-controller;
-   #gpio-cells = <2>;
-   };
-
-   port4: gpio@5528 {
-   compatible = "socionext,uniphier-gpio";
-   reg = <0x5528 0x8>;
-   gpio-controller;
-   #gpio-cells = <2>;
-   };
-
-   port5x: gpio@5530 {
-   compatible = "socionext,uniphier-gpio";
-   reg = <0x5530 0x8>;
-   gpio-controller;
-   #gpio-cells = <2>;
-   };
-
-   port6x: gpio@5538 {
-   compatible = "socionext,uniphier-gpio";
-   reg = <0x5538 0x8>;
-   gpio-controller;
-   #gpio-cells = <2>;
-   };
-
-   port7x: gpio@5540 {
-   compatible = "socionext,uniphier-gpio";
-   reg = <0x5540 0x8>;
-   gpio-controller;
-   #gpio-cells = <2>;
-   };
-
-   port8x: gpio@5548 {
-   compatible = "socionext,uniphier-gpio";
-   reg = <0x5548 0x8>;
-   gpio-controller;
-   #gpio-cells = <2>;
-   };
-
-   port9x: gpio@5550 {
-   compatible = "socionext,uniphier-gpio";
-   reg = <0x5550 0x8>;
-   gpio-controller;
-  

[U-Boot] [PATCH 00/20] ARM: uniphier: various refactoring for v2017.11-rc2

2017-10-13 Thread Masahiro Yamada
 - Reactor of GPIO, clk, reset drivers.
 - Clean up SOC code
 - Sync DT
 - Use more clock drivers
 - Split U-Boot specific DT property


Masahiro Yamada (20):
  ARM: uniphier: switch to CONFIG_ENV_IS_NOWHERE
  gpio: uniphier: rework single device node model
  ARM: dts: uniphier: update GPIO nodes
  pinctrl: uniphier: set PUPD_SIMPLE cap flag for PXs3
  pinctrl: uniphier: simplify input enable and delete pin arrays
  ARM: uniphier: use pr_() instead of printf() where appropriate
  usb: dwc3-uniphier: replace  with 
  i2c: uniphier: replace debug() with dev_dbg()
  i2c: uniphier-f: replace debug() with dev_dbg()
  clk: uniphier: rework for better clock tree structure
  clk: uniphier: add PXs3 clock data
  clk: uniphier: add peripheral clock data
  reset: uniphier: fix the first argument passed to dev_err()
  i2c: uniphier: use clk for enable and get_rate
  i2c: uniphier-f: use clk for enable and get_rate
  ARM: uniphier: split u-boot,dm-pre-reloc out to
uniphier-v7-u-boot.dtsi
  ARM: dts: uniphier: prepare to use clock for serial
  serial: uniphier: use clk for enable and get_rate
  ARM: dts: uniphier: sync DT with Linux 4.14-rc4
  ARM: uniphier: change the default of SoC select to UNIPHIER_V7_MULTI

 arch/arm/dts/uniphier-ld11.dtsi  |  38 ++-
 arch/arm/dts/uniphier-ld20.dtsi  |  97 ++-
 arch/arm/dts/uniphier-ld4-ref.dts|   9 +-
 arch/arm/dts/uniphier-ld4.dtsi   | 122 +
 arch/arm/dts/uniphier-ld6b-ref.dts   |   9 +-
 arch/arm/dts/uniphier-pinctrl.dtsi   |  15 ++
 arch/arm/dts/uniphier-pro4-ace.dts   |   9 -
 arch/arm/dts/uniphier-pro4-ref.dts   |   9 -
 arch/arm/dts/uniphier-pro4-sanji.dts |  21 --
 arch/arm/dts/uniphier-pro4.dtsi  | 214 +---
 arch/arm/dts/uniphier-pro5-4kbox.dts |   9 -
 arch/arm/dts/uniphier-pro5.dtsi  | 214 +---
 arch/arm/dts/uniphier-pxs2-gentil.dts|  21 --
 arch/arm/dts/uniphier-pxs2-vodka.dts |  21 --
 arch/arm/dts/uniphier-pxs2.dtsi  | 256 ---
 arch/arm/dts/uniphier-pxs3.dtsi  |   7 +-
 arch/arm/dts/uniphier-sld8-ref.dts   |   9 +-
 arch/arm/dts/uniphier-sld8.dtsi  | 126 +-
 arch/arm/dts/uniphier-v7-u-boot.dtsi |  69 +
 arch/arm/dts/uniphier-v8-u-boot.dtsi |  13 +
 arch/arm/mach-uniphier/Kconfig   |   5 +-
 arch/arm/mach-uniphier/arm32/psci.c  |   4 +-
 arch/arm/mach-uniphier/board_late_init.c |   4 +-
 arch/arm/mach-uniphier/boot-device/boot-device.c |   1 +
 arch/arm/mach-uniphier/cpu-info.c|   7 +-
 arch/arm/mach-uniphier/dram/cmd_ddrmphy.c|   4 +-
 arch/arm/mach-uniphier/dram/cmd_ddrphy.c |   4 +-
 arch/arm/mach-uniphier/dram/ddrphy-ld4.c |   5 +-
 arch/arm/mach-uniphier/dram/umc-pxs2.c   |  18 +-
 arch/arm/mach-uniphier/dram_init.c   |   7 +-
 drivers/clk/uniphier/Makefile|   2 +
 drivers/clk/uniphier/clk-uniphier-core.c | 308 +--
 drivers/clk/uniphier/clk-uniphier-mio.c  | 118 -
 drivers/clk/uniphier/clk-uniphier-peri.c | 113 +
 drivers/clk/uniphier/clk-uniphier-sys.c  |  52 ++--
 drivers/clk/uniphier/clk-uniphier.h  |  85 ---
 drivers/gpio/gpio-uniphier.c | 140 +++
 drivers/i2c/i2c-uniphier-f.c | 131 +-
 drivers/i2c/i2c-uniphier.c   |  82 +++---
 drivers/pinctrl/uniphier/pinctrl-uniphier-core.c |  17 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-ld4.c  |  16 --
 drivers/pinctrl/uniphier/pinctrl-uniphier-pro4.c |   5 -
 drivers/pinctrl/uniphier/pinctrl-uniphier-pro5.c |  15 --
 drivers/pinctrl/uniphier/pinctrl-uniphier-pxs2.c |   9 -
 drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c |   3 +-
 drivers/pinctrl/uniphier/pinctrl-uniphier-sld8.c |  30 ---
 drivers/reset/reset-uniphier.c   |   3 +-
 drivers/serial/serial_uniphier.c |  16 +-
 drivers/usb/dwc3/dwc3-uniphier.c |   2 +-
 env/Kconfig  |   1 -
 50 files changed, 1082 insertions(+), 1413 deletions(-)
 create mode 100644 arch/arm/dts/uniphier-v7-u-boot.dtsi
 create mode 100644 arch/arm/dts/uniphier-v8-u-boot.dtsi
 create mode 100644 drivers/clk/uniphier/clk-uniphier-peri.c

-- 
2.7.4

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


[U-Boot] [PATCH 06/20] ARM: uniphier: use pr_() instead of printf() where appropriate

2017-10-13 Thread Masahiro Yamada
Replace printf() with pr_() to specify proper loglevel.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/arm32/psci.c  |  4 +++-
 arch/arm/mach-uniphier/board_late_init.c |  4 +++-
 arch/arm/mach-uniphier/boot-device/boot-device.c |  1 +
 arch/arm/mach-uniphier/cpu-info.c|  7 ---
 arch/arm/mach-uniphier/dram/cmd_ddrmphy.c|  4 +++-
 arch/arm/mach-uniphier/dram/cmd_ddrphy.c |  4 +++-
 arch/arm/mach-uniphier/dram/ddrphy-ld4.c |  5 +++--
 arch/arm/mach-uniphier/dram/umc-pxs2.c   | 18 ++
 arch/arm/mach-uniphier/dram_init.c   |  7 +--
 9 files changed, 35 insertions(+), 19 deletions(-)

diff --git a/arch/arm/mach-uniphier/arm32/psci.c 
b/arch/arm/mach-uniphier/arm32/psci.c
index 3ab101a..efe7419 100644
--- a/arch/arm/mach-uniphier/arm32/psci.c
+++ b/arch/arm/mach-uniphier/arm32/psci.c
@@ -7,8 +7,10 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -91,7 +93,7 @@ static void uniphier_smp_kick_all_cpus(void)
}
 
if (!timeout)
-   printf("warning: some of secondary CPUs may not boot\n");
+   pr_warn("warning: some of secondary CPUs may not boot\n");
 
uniphier_cache_disable();
 }
diff --git a/arch/arm/mach-uniphier/board_late_init.c 
b/arch/arm/mach-uniphier/board_late_init.c
index b9a2cbe..6849b3d 100644
--- a/arch/arm/mach-uniphier/board_late_init.c
+++ b/arch/arm/mach-uniphier/board_late_init.c
@@ -10,7 +10,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include <../drivers/mtd/nand/denali.h>
 
 #include "init.h"
@@ -92,7 +94,7 @@ int board_late_init(void)
printf("\n");
 
if (uniphier_set_fdt_file())
-   printf("fdt_file environment was not set correctly\n");
+   pr_warn("fdt_file environment was not set correctly\n");
 
return 0;
 }
diff --git a/arch/arm/mach-uniphier/boot-device/boot-device.c 
b/arch/arm/mach-uniphier/boot-device/boot-device.c
index 0f93926..2818b50 100644
--- a/arch/arm/mach-uniphier/boot-device/boot-device.c
+++ b/arch/arm/mach-uniphier/boot-device/boot-device.c
@@ -7,6 +7,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include "../init.h"
diff --git a/arch/arm/mach-uniphier/cpu-info.c 
b/arch/arm/mach-uniphier/cpu-info.c
index 90ef411..bf41d05 100644
--- a/arch/arm/mach-uniphier/cpu-info.c
+++ b/arch/arm/mach-uniphier/cpu-info.c
@@ -6,9 +6,10 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-#include 
+#include 
 #include 
 #include 
+#include 
 
 #include "soc-info.h"
 
@@ -59,11 +60,11 @@ int print_cpuinfo(void)
printf(" (model %d, revision %d)\n", model, rev);
 
if (model < required_model) {
-   printf("Only model %d or newer is supported.\n",
+   pr_err("Only model %d or newer is supported.\n",
   required_model);
return -ENOTSUPP;
} else if (rev < required_rev) {
-   printf("Only revision %d or newer is supported.\n",
+   pr_err("Only revision %d or newer is supported.\n",
   required_rev);
return -ENOTSUPP;
}
diff --git a/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c 
b/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
index 873dad2..50f0dde 100644
--- a/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
+++ b/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
@@ -6,7 +6,9 @@
  */
 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 #include "../soc-info.h"
@@ -297,7 +299,7 @@ static int do_ddrm(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 
param = uniphier_get_ddrmphy_param();
if (!param) {
-   printf("unsupported SoC\n");
+   pr_err("unsupported SoC\n");
return CMD_RET_FAILURE;
}
 
diff --git a/arch/arm/mach-uniphier/dram/cmd_ddrphy.c 
b/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
index a71f704..0283eda 100644
--- a/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
+++ b/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
@@ -7,7 +7,9 @@
  */
 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 #include "../soc-info.h"
@@ -267,7 +269,7 @@ static int do_ddr(cmd_tbl_t *cmdtp, int flag, int argc, 
char * const argv[])
 
param = uniphier_get_ddrphy_param();
if (!param) {
-   printf("unsupported SoC\n");
+   pr_err("unsupported SoC\n");
return CMD_RET_FAILURE;
}
 
diff --git a/arch/arm/mach-uniphier/dram/ddrphy-ld4.c 
b/arch/arm/mach-uniphier/dram/ddrphy-ld4.c
index c20730d..ba3d314 100644
--- a/arch/arm/mach-uniphier/dram/ddrphy-ld4.c
+++ b/arch/arm/mach-uniphier/dram/ddrphy-ld4.c
@@ -5,9 +5,10 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-#include 
+#include 
 #include 
 #include 
+#include 
 
 #include "ddrphy-init.h"
 #include "ddrphy-regs.h"
@@ -41,7 +42,7 @@ int uniphier_ld4_ddrphy_init(void 

[U-Boot] [PATCH 08/20] i2c: uniphier: replace debug() with dev_dbg()

2017-10-13 Thread Masahiro Yamada
Use dev_dbg() functions.  It will be helpful to prefix log messages
with the corresponding device name when the core framework is ready.

While I am here, I renamed "dev", which was actually private data,
into "priv" because dev->dev looks confusing.

Signed-off-by: Masahiro Yamada 
---

 drivers/i2c/i2c-uniphier.c | 63 --
 1 file changed, 33 insertions(+), 30 deletions(-)

diff --git a/drivers/i2c/i2c-uniphier.c b/drivers/i2c/i2c-uniphier.c
index 3412e2a..0f2734e 100644
--- a/drivers/i2c/i2c-uniphier.c
+++ b/drivers/i2c/i2c-uniphier.c
@@ -6,14 +6,14 @@
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-#include 
-#include 
-#include 
+#include 
+#include 
 #include 
 #include 
-#include 
-#include 
+#include 
+#include 
 #include 
+#include 
 
 struct uniphier_i2c_regs {
u32 dtrm;   /* data transmission */
@@ -38,7 +38,8 @@ struct uniphier_i2c_regs {
 
 #define IOBUS_FREQ 1
 
-struct uniphier_i2c_dev {
+struct uniphier_i2c_priv {
+   struct udevice *dev;
struct uniphier_i2c_regs __iomem *regs; /* register base */
unsigned long input_clk;/* master clock (Hz) */
unsigned long wait_us;  /* wait for every byte transfer (us) */
@@ -47,7 +48,7 @@ struct uniphier_i2c_dev {
 static int uniphier_i2c_probe(struct udevice *dev)
 {
fdt_addr_t addr;
-   struct uniphier_i2c_dev *priv = dev_get_priv(dev);
+   struct uniphier_i2c_priv *priv = dev_get_priv(dev);
 
addr = devfdt_get_addr(dev);
if (addr == FDT_ADDR_T_NONE)
@@ -59,15 +60,17 @@ static int uniphier_i2c_probe(struct udevice *dev)
 
priv->input_clk = IOBUS_FREQ;
 
+   priv->dev = dev;
+
/* deassert reset */
writel(0x3, >regs->brst);
 
return 0;
 }
 
-static int send_and_recv_byte(struct uniphier_i2c_dev *dev, u32 dtrm)
+static int send_and_recv_byte(struct uniphier_i2c_priv *priv, u32 dtrm)
 {
-   writel(dtrm, >regs->dtrm);
+   writel(dtrm, >regs->dtrm);
 
/*
 * This controller only provides interruption to inform the completion
@@ -75,72 +78,72 @@ static int send_and_recv_byte(struct uniphier_i2c_dev *dev, 
u32 dtrm)
 * Unfortunately, U-Boot does not have a good support of interrupt.
 * Wait for a while.
 */
-   udelay(dev->wait_us);
+   udelay(priv->wait_us);
 
-   return readl(>regs->drec);
+   return readl(>regs->drec);
 }
 
-static int send_byte(struct uniphier_i2c_dev *dev, u32 dtrm, bool *stop)
+static int send_byte(struct uniphier_i2c_priv *priv, u32 dtrm, bool *stop)
 {
int ret = 0;
u32 drec;
 
-   drec = send_and_recv_byte(dev, dtrm);
+   drec = send_and_recv_byte(priv, dtrm);
 
if (drec & I2C_DREC_LAB) {
-   debug("uniphier_i2c: bus arbitration failed\n");
+   dev_dbg(priv->dev, "uniphier_i2c: bus arbitration failed\n");
*stop = false;
ret = -EREMOTEIO;
}
if (drec & I2C_DREC_LRB) {
-   debug("uniphier_i2c: slave did not return ACK\n");
+   dev_dbg(priv->dev, "uniphier_i2c: slave did not return ACK\n");
ret = -EREMOTEIO;
}
return ret;
 }
 
-static int uniphier_i2c_transmit(struct uniphier_i2c_dev *dev, uint addr,
+static int uniphier_i2c_transmit(struct uniphier_i2c_priv *priv, uint addr,
 uint len, const u8 *buf, bool *stop)
 {
int ret;
 
-   debug("%s: addr = %x, len = %d\n", __func__, addr, len);
+   dev_dbg(priv->dev, "%s: addr = %x, len = %d\n", __func__, addr, len);
 
-   ret = send_byte(dev, I2C_DTRM_STA | I2C_DTRM_NACK | addr << 1, stop);
+   ret = send_byte(priv, I2C_DTRM_STA | I2C_DTRM_NACK | addr << 1, stop);
if (ret < 0)
goto fail;
 
while (len--) {
-   ret = send_byte(dev, I2C_DTRM_NACK | *buf++, stop);
+   ret = send_byte(priv, I2C_DTRM_NACK | *buf++, stop);
if (ret < 0)
goto fail;
}
 
 fail:
if (*stop)
-   writel(I2C_DTRM_STO | I2C_DTRM_NACK, >regs->dtrm);
+   writel(I2C_DTRM_STO | I2C_DTRM_NACK, >regs->dtrm);
 
return ret;
 }
 
-static int uniphier_i2c_receive(struct uniphier_i2c_dev *dev, uint addr,
+static int uniphier_i2c_receive(struct uniphier_i2c_priv *priv, uint addr,
uint len, u8 *buf, bool *stop)
 {
int ret;
 
-   debug("%s: addr = %x, len = %d\n", __func__, addr, len);
+   dev_dbg(priv->dev, "%s: addr = %x, len = %d\n", __func__, addr, len);
 
-   ret = send_byte(dev, I2C_DTRM_STA | I2C_DTRM_NACK |
+   ret = send_byte(priv, I2C_DTRM_STA | I2C_DTRM_NACK |
I2C_DTRM_RD | addr << 1, stop);
if (ret < 0)
goto fail;
 
while (len--)
-   *buf++ = send_and_recv_byte(dev, len ? 

[U-Boot] [PATCH 13/20] reset: uniphier: fix the first argument passed to dev_err()

2017-10-13 Thread Masahiro Yamada
priv->dev does not exist.  Pass the correct pointer to udevice.

Signed-off-by: Masahiro Yamada 
---

 drivers/reset/reset-uniphier.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/reset/reset-uniphier.c b/drivers/reset/reset-uniphier.c
index c74d16f..a40cea5 100644
--- a/drivers/reset/reset-uniphier.c
+++ b/drivers/reset/reset-uniphier.c
@@ -210,7 +210,8 @@ static int uniphier_reset_update(struct reset_ctl 
*reset_ctl, int assert)
return 0;
}
 
-   dev_err(priv->dev, "reset_id=%lu was not handled\n", id);
+   dev_err(reset_ctl->dev, "reset_id=%lu was not handled\n", id);
+
return -EINVAL;
 }
 
-- 
2.7.4

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


[U-Boot] [PATCH 01/20] ARM: uniphier: switch to CONFIG_ENV_IS_NOWHERE

2017-10-13 Thread Masahiro Yamada
The non-volatile storage varies board by board.  The default should
be NOWHERE.  Please choose a proper device via Kconfig.

Signed-off-by: Masahiro Yamada 
---

 env/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/env/Kconfig b/env/Kconfig
index 024d4d7..20516a5 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -3,7 +3,6 @@ menu "Environment"
 choice
prompt "Select the location of the environment"
default ENV_IS_IN_MMC if ARCH_SUNXI
-   default ENV_IS_IN_MMC if ARCH_UNIPHIER
default ENV_IS_IN_MMC if ARCH_EXYNOS4
default ENV_IS_IN_MMC if MX6SX || MX7D
default ENV_IS_IN_MMC if TEGRA30 || TEGRA124
-- 
2.7.4

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


[U-Boot] [PATCH 19/20] ARM: dts: uniphier: sync DT with Linux 4.14-rc4

2017-10-13 Thread Masahiro Yamada
Sync with Linux 4.14-rc4.  (Include some DT updates queued up
for Linux 4.15.)

Signed-off-by: Masahiro Yamada 
---

 arch/arm/dts/uniphier-ld11.dtsi| 15 --
 arch/arm/dts/uniphier-ld20.dtsi| 97 --
 arch/arm/dts/uniphier-ld4-ref.dts  |  4 ++
 arch/arm/dts/uniphier-ld4.dtsi |  4 --
 arch/arm/dts/uniphier-ld6b-ref.dts |  4 ++
 arch/arm/dts/uniphier-pinctrl.dtsi | 15 ++
 arch/arm/dts/uniphier-pro4.dtsi|  4 --
 arch/arm/dts/uniphier-pro5.dtsi|  4 --
 arch/arm/dts/uniphier-pxs2.dtsi| 51 
 arch/arm/dts/uniphier-pxs3.dtsi|  4 --
 arch/arm/dts/uniphier-sld8-ref.dts |  4 ++
 arch/arm/dts/uniphier-sld8.dtsi|  4 --
 12 files changed, 174 insertions(+), 36 deletions(-)

diff --git a/arch/arm/dts/uniphier-ld11.dtsi b/arch/arm/dts/uniphier-ld11.dtsi
index 0cc6fd7..2ac1bfc 100644
--- a/arch/arm/dts/uniphier-ld11.dtsi
+++ b/arch/arm/dts/uniphier-ld11.dtsi
@@ -118,7 +118,6 @@
pinctrl-names = "default";
pinctrl-0 = <_uart0>;
clocks = <_clk 0>;
-   clock-frequency = <5882>;
};
 
serial1: serial@54006900 {
@@ -129,7 +128,6 @@
pinctrl-names = "default";
pinctrl-0 = <_uart1>;
clocks = <_clk 1>;
-   clock-frequency = <5882>;
};
 
serial2: serial@54006a00 {
@@ -140,7 +138,6 @@
pinctrl-names = "default";
pinctrl-0 = <_uart2>;
clocks = <_clk 2>;
-   clock-frequency = <5882>;
};
 
serial3: serial@54006b00 {
@@ -151,7 +148,17 @@
pinctrl-names = "default";
pinctrl-0 = <_uart3>;
clocks = <_clk 3>;
-   clock-frequency = <5882>;
+   };
+
+   adamv@5792 {
+   compatible = "socionext,uniphier-ld11-adamv",
+"simple-mfd", "syscon";
+   reg = <0x5792 0x1000>;
+
+   adamv_rst: reset {
+   compatible = 
"socionext,uniphier-ld11-adamv-reset";
+   #reset-cells = <1>;
+   };
};
 
gpio: gpio@5500 {
diff --git a/arch/arm/dts/uniphier-ld20.dtsi b/arch/arm/dts/uniphier-ld20.dtsi
index a7fdaa7..b74efb9 100644
--- a/arch/arm/dts/uniphier-ld20.dtsi
+++ b/arch/arm/dts/uniphier-ld20.dtsi
@@ -7,6 +7,8 @@
  * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  */
 
+#include 
+
 /memreserve/ 0x8000 0x0200;
 
 / {
@@ -46,6 +48,7 @@
clocks = <_clk 32>;
enable-method = "psci";
operating-points-v2 = <_opp>;
+   #cooling-cells = <2>;
};
 
cpu1: cpu@1 {
@@ -64,6 +67,7 @@
clocks = <_clk 33>;
enable-method = "psci";
operating-points-v2 = <_opp>;
+   #cooling-cells = <2>;
};
 
cpu3: cpu@101 {
@@ -173,6 +177,40 @@
 <1 10 4>;
};
 
+   thermal-zones {
+   cpu_thermal {
+   polling-delay-passive = <250>;  /* 250ms */
+   polling-delay = <1000>; /* 1000ms */
+   thermal-sensors = <>;
+
+   trips {
+   cpu_crit: cpu_crit {
+   temperature = <11>; /* 110C */
+   hysteresis = <2000>;
+   type = "critical";
+   };
+   cpu_alert: cpu_alert {
+   temperature = <10>; /* 100C */
+   hysteresis = <2000>;
+   type = "passive";
+   };
+   };
+
+   cooling-maps {
+   map0 {
+   trip = <_alert>;
+   cooling-device = <
+   THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+   };
+   map1 {
+   trip = <_alert>;
+   cooling-device = <
+   THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+   };
+   };
+   };
+   };
+
soc@0 {
compatible = 

[U-Boot] [PATCH 11/20] clk: uniphier: add PXs3 clock data

2017-10-13 Thread Masahiro Yamada
Add basic clock data for Socionext's new SoC PXs3.

Signed-off-by: Masahiro Yamada 
---

 drivers/clk/uniphier/clk-uniphier-core.c |  8 
 drivers/clk/uniphier/clk-uniphier-sys.c  | 14 ++
 drivers/clk/uniphier/clk-uniphier.h  |  1 +
 3 files changed, 23 insertions(+)

diff --git a/drivers/clk/uniphier/clk-uniphier-core.c 
b/drivers/clk/uniphier/clk-uniphier-core.c
index 3d1d411..9a7d03a 100644
--- a/drivers/clk/uniphier/clk-uniphier-core.c
+++ b/drivers/clk/uniphier/clk-uniphier-core.c
@@ -296,6 +296,10 @@ static const struct udevice_id uniphier_clk_match[] = {
.compatible = "socionext,uniphier-ld20-clock",
.data = (ulong)uniphier_ld20_sys_clk_data,
},
+   {
+   .compatible = "socionext,uniphier-pxs3-clock",
+   .data = (ulong)uniphier_pxs3_sys_clk_data,
+   },
/* Media I/O clock */
{
.compatible = "socionext,uniphier-ld4-mio-clock",
@@ -325,6 +329,10 @@ static const struct udevice_id uniphier_clk_match[] = {
.compatible = "socionext,uniphier-ld20-sd-clock",
.data = (ulong)uniphier_mio_clk_data,
},
+   {
+   .compatible = "socionext,uniphier-pxs3-sd-clock",
+   .data = (ulong)uniphier_mio_clk_data,
+   },
{ /* sentinel */ }
 };
 
diff --git a/drivers/clk/uniphier/clk-uniphier-sys.c 
b/drivers/clk/uniphier/clk-uniphier-sys.c
index e9df885..f8cf6da 100644
--- a/drivers/clk/uniphier/clk-uniphier-sys.c
+++ b/drivers/clk/uniphier/clk-uniphier-sys.c
@@ -30,3 +30,17 @@ const struct uniphier_clk_data uniphier_ld20_sys_clk_data[] 
= {
{ /* sentinel */ }
 #endif
 };
+
+const struct uniphier_clk_data uniphier_pxs3_sys_clk_data[] = {
+#if defined(CONFIG_ARCH_UNIPHIER_PXS3)
+   UNIPHIER_CLK_GATE_SIMPLE(12, 0x210c, 4),/* usb30 (gio0) */
+   UNIPHIER_CLK_GATE_SIMPLE(13, 0x210c, 5),/* usb31-0 (gio1) */
+   UNIPHIER_CLK_GATE_SIMPLE(14, 0x210c, 6),/* usb31-1 (gio1-1) */
+   UNIPHIER_CLK_GATE_SIMPLE(16, 0x210c, 16),   /* usb30-phy0 */
+   UNIPHIER_CLK_GATE_SIMPLE(17, 0x210c, 18),   /* usb30-phy1 */
+   UNIPHIER_CLK_GATE_SIMPLE(18, 0x210c, 20),   /* usb30-phy2 */
+   UNIPHIER_CLK_GATE_SIMPLE(20, 0x210c, 17),   /* usb31-phy0 */
+   UNIPHIER_CLK_GATE_SIMPLE(21, 0x210c, 19),   /* usb31-phy1 */
+   { /* sentinel */ }
+#endif
+};
diff --git a/drivers/clk/uniphier/clk-uniphier.h 
b/drivers/clk/uniphier/clk-uniphier.h
index 9b6c94f..77ebae1 100644
--- a/drivers/clk/uniphier/clk-uniphier.h
+++ b/drivers/clk/uniphier/clk-uniphier.h
@@ -73,6 +73,7 @@ struct uniphier_clk_data {
 
 extern const struct uniphier_clk_data uniphier_pxs2_sys_clk_data[];
 extern const struct uniphier_clk_data uniphier_ld20_sys_clk_data[];
+extern const struct uniphier_clk_data uniphier_pxs3_sys_clk_data[];
 extern const struct uniphier_clk_data uniphier_mio_clk_data[];
 
 #endif /* __CLK_UNIPHIER_H__ */
-- 
2.7.4

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


[U-Boot] [PATCH 20/20] ARM: uniphier: change the default of SoC select to UNIPHIER_V7_MULTI

2017-10-13 Thread Masahiro Yamada
ARCH_UNIPHIER_V8_MULTI depends on !SPL, so the default may be hidden.
Use a clearer default.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-uniphier/Kconfig b/arch/arm/mach-uniphier/Kconfig
index 6512d42..0d48e04 100644
--- a/arch/arm/mach-uniphier/Kconfig
+++ b/arch/arm/mach-uniphier/Kconfig
@@ -12,7 +12,7 @@ config ARCH_UNIPHIER_32BIT
 
 choice
 prompt "UniPhier SoC select"
-default ARCH_UNIPHIER_V8_MULTI
+default ARCH_UNIPHIER_V7_MULTI
 
 config ARCH_UNIPHIER_LD4_SLD8
bool "UniPhier LD4/sLD8 SoCs"
-- 
2.7.4

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


[U-Boot] [PATCH 04/20] pinctrl: uniphier: set PUPD_SIMPLE cap flag for PXs3

2017-10-13 Thread Masahiro Yamada
Like other recenct UniPhier SoCs, the pupdctrl number of PXs3
matches to the pin number.

Signed-off-by: Masahiro Yamada 
---

 drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c 
b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c
index 423e48b..7c54d37 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-pxs3.c
@@ -118,7 +118,8 @@ static struct uniphier_pinctrl_socdata 
uniphier_pxs3_pinctrl_socdata = {
.groups_count = ARRAY_SIZE(uniphier_pxs3_groups),
.functions = uniphier_pxs3_functions,
.functions_count = ARRAY_SIZE(uniphier_pxs3_functions),
-   .caps = UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL,
+   .caps = UNIPHIER_PINCTRL_CAPS_PUPD_SIMPLE |
+   UNIPHIER_PINCTRL_CAPS_PERPIN_IECTRL,
 };
 
 static int uniphier_pxs3_pinctrl_probe(struct udevice *dev)
-- 
2.7.4

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


[U-Boot] [PATCH 15/20] i2c: uniphier-f: use clk for enable and get_rate

2017-10-13 Thread Masahiro Yamada
Get clock rate from the clock driver instead of hard-coding it.

Signed-off-by: Masahiro Yamada 
---

 drivers/i2c/i2c-uniphier-f.c | 19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/i2c-uniphier-f.c b/drivers/i2c/i2c-uniphier-f.c
index eb6c9f3..6f45cc5 100644
--- a/drivers/i2c/i2c-uniphier-f.c
+++ b/drivers/i2c/i2c-uniphier-f.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -61,8 +62,6 @@ struct uniphier_fi2c_regs {
 #define I2C_BRST_RSCLO (1 << 0)/* release SCL low fixing */
 };
 
-#define FIOCLK 5000
-
 struct uniphier_fi2c_priv {
struct udevice *dev;
struct uniphier_fi2c_regs __iomem *regs;/* register base */
@@ -93,6 +92,8 @@ static int uniphier_fi2c_probe(struct udevice *dev)
 {
fdt_addr_t addr;
struct uniphier_fi2c_priv *priv = dev_get_priv(dev);
+   struct clk clk;
+   int ret;
 
addr = devfdt_get_addr(dev);
if (addr == FDT_ADDR_T_NONE)
@@ -102,7 +103,19 @@ static int uniphier_fi2c_probe(struct udevice *dev)
if (!priv->regs)
return -ENOMEM;
 
-   priv->fioclk = FIOCLK;
+   ret = clk_get_by_index(dev, 0, );
+   if (ret < 0) {
+   dev_err(dev, "failed to get clock\n");
+   return ret;
+   }
+
+   ret = clk_enable();
+   if (ret) {
+   dev_err(dev, "failed to enable clock\n");
+   return ret;
+   }
+
+   priv->fioclk = clk_get_rate();
 
priv->dev = dev;
 
-- 
2.7.4

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


[U-Boot] [PATCH 14/20] i2c: uniphier: use clk for enable and get_rate

2017-10-13 Thread Masahiro Yamada
Get clock rate from the clock driver instead of hard-coding it.

Signed-off-by: Masahiro Yamada 
---

 drivers/i2c/i2c-uniphier.c | 19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/i2c-uniphier.c b/drivers/i2c/i2c-uniphier.c
index 0f2734e..9100129 100644
--- a/drivers/i2c/i2c-uniphier.c
+++ b/drivers/i2c/i2c-uniphier.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -36,8 +37,6 @@ struct uniphier_i2c_regs {
u32 setup;  /* setup time control */
 };
 
-#define IOBUS_FREQ 1
-
 struct uniphier_i2c_priv {
struct udevice *dev;
struct uniphier_i2c_regs __iomem *regs; /* register base */
@@ -49,6 +48,8 @@ static int uniphier_i2c_probe(struct udevice *dev)
 {
fdt_addr_t addr;
struct uniphier_i2c_priv *priv = dev_get_priv(dev);
+   struct clk clk;
+   int ret;
 
addr = devfdt_get_addr(dev);
if (addr == FDT_ADDR_T_NONE)
@@ -58,7 +59,19 @@ static int uniphier_i2c_probe(struct udevice *dev)
if (!priv->regs)
return -ENOMEM;
 
-   priv->input_clk = IOBUS_FREQ;
+   ret = clk_get_by_index(dev, 0, );
+   if (ret < 0) {
+   dev_err(dev, "failed to get clock\n");
+   return ret;
+   }
+
+   ret = clk_enable();
+   if (ret) {
+   dev_err(dev, "failed to enable clock\n");
+   return ret;
+   }
+
+   priv->input_clk = clk_get_rate();
 
priv->dev = dev;
 
-- 
2.7.4

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


[U-Boot] [PATCH v2 2/3] kbuild: add stringify helper to quote a string passed to C files

2017-10-13 Thread Masahiro Yamada
I want to reuse $(squote)$(quote)...$(quote)$(squote) in the next
commit.  Move it to a helper.

Signed-off-by: Masahiro Yamada 
---

Changes in v2: None

 scripts/Kbuild.include | 4 
 scripts/Makefile.lib   | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 2c7918a..48a641c 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -30,6 +30,10 @@ baseprereq = $(basename $(notdir $<))
 escsq = $(subst $(squote),'\$(squote)',$1)
 
 ###
+# Quote a string to pass it to C files. foo => '"foo"'
+stringify = $(squote)$(quote)$1$(quote)$(squote)
+
+###
 # Easy method for doing a status message
kecho := :
  quiet_kecho := echo
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 8934b2f..bd0977e 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -99,7 +99,7 @@ obj-dirs  := $(addprefix $(obj)/,$(obj-dirs))
 # Note: Files that end up in two or more modules are compiled without the
 #   KBUILD_MODNAME definition. The reason is that any made-up name would
 #   differ in different configs.
-name-fix = $(squote)$(quote)$(subst $(comma),_,$(subst 
-,_,$1))$(quote)$(squote)
+name-fix = $(call stringify,$(subst $(comma),_,$(subst -,_,$1)))
 basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget))
 modname_flags  = $(if $(filter 1,$(words $(modname))),\
  -DKBUILD_MODNAME=$(call name-fix,$(modname)))
-- 
2.7.4

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


[U-Boot] [PATCH v2 0/3] kbuild: always use relative path for __FILE__

2017-10-13 Thread Masahiro Yamada

We discussed the __FILE__ problem when U-Boot is built out of tree.
https://www.mail-archive.com/u-boot@lists.denx.de/msg242852.html

The deeper your build directory is located, the larger
your U-Boot image becomes.
If your platform has memory footprint limit, this is a problem.

Recently, I submitted the following patches to Kbuild ML.
(no RFC, this time)
https://patchwork.kernel.org/patch/10001419/
https://patchwork.kernel.org/patch/10001409/

I consider them for Linux 4.15 unless there is
a strong objection or a problem report.

This series is a port for U-Boot.

If Tom wants to pick this up earlier, it is OK.
If not in hurry, you can wait for the activity in Linux.
Either will do.


Changes in v2:
  - Rephrase comments for clarification
  - Fix a typo

Masahiro Yamada (2):
  kbuild: add stringify helper to quote a string passed to C files
  kbuild: redefine __FILE__ as relative path from $(srctree) if possible

Michal Marek (1):
  kbuild: Get rid of KBUILD_STR

 Makefile   | 9 +
 scripts/Kbuild.include | 4 
 scripts/Makefile.lib   | 8 
 3 files changed, 17 insertions(+), 4 deletions(-)

-- 
2.7.4

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


[U-Boot] [PATCH v2 1/3] kbuild: Get rid of KBUILD_STR

2017-10-13 Thread Masahiro Yamada
From: Michal Marek 

The compiler can accept -DKBUILD_MODNAME="foo", it's just a matter of
quoting. That way, we reduce the gcc command line a bit.

Signed-off-by: Michal Marek 
Signed-off-by: Masahiro Yamada 

[ Linux commit: b42841b7bb6286da56b4fa79835c27166b7e228b ]
---

Changes in v2: None

 scripts/Makefile.lib | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 0d5c529..8934b2f 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -99,10 +99,10 @@ obj-dirs:= $(addprefix $(obj)/,$(obj-dirs))
 # Note: Files that end up in two or more modules are compiled without the
 #   KBUILD_MODNAME definition. The reason is that any made-up name would
 #   differ in different configs.
-name-fix = $(subst $(comma),_,$(subst -,_,$1))
-basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
+name-fix = $(squote)$(quote)$(subst $(comma),_,$(subst 
-,_,$1))$(quote)$(squote)
+basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget))
 modname_flags  = $(if $(filter 1,$(words $(modname))),\
- -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
+ -DKBUILD_MODNAME=$(call name-fix,$(modname)))
 
 orig_c_flags   = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) \
  $(ccflags-y) $(CFLAGS_$(basetarget).o)
@@ -154,7 +154,7 @@ endif
 # Modified for U-Boot: LINUXINCLUDE -> UBOOTINCLUDE
 c_flags= -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \
 $(__c_flags) $(modkern_cflags)   \
--D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
+$(basename_flags) $(modname_flags)
 
 a_flags= -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \
 $(__a_flags) $(modkern_aflags)
-- 
2.7.4

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


[U-Boot] [PATCH v2 3/3] kbuild: redefine __FILE__ as relative path from $(srctree) if possible

2017-10-13 Thread Masahiro Yamada
Since Kbuild runs in the objtree, __FILE__ can be a very long path
depending of $(srctree).

If objtree is a child of srctree, the situation is a bit better.
($(srctree) is "..")

For other cases of out-of-tree build, filenames in WARN_ON() etc. are
still an absolute path.  It also means the U-Boot image depends on
where it was built.

Here, the idea is to redefine __FILE__ as the relative path from
$(srctree), but doing so causes a compiler warning:
  warning: "__FILE__" redefined [-Wbuiltin-macro-redefined]

The option -Wno-builtin-macro-redefined can suppress it, but it is
only recognized by GCC 4.4 or newer.  Redefine __FILE__ only when
possible.

Signed-off-by: Masahiro Yamada 
---

Changes in v2:
  - Rephrase comments for clarification
  - Fix a typo

 Makefile | 9 +
 1 file changed, 9 insertions(+)

diff --git a/Makefile b/Makefile
index 888486b..1ff312a 100644
--- a/Makefile
+++ b/Makefile
@@ -1334,6 +1334,15 @@ prepare0: archprepare FORCE
 # All the preparing..
 prepare: prepare0
 
+# If possible, redefine __FILE__ as relative path from $(srctree).
+# $$ is needed to evaluate the variables in sub-directories.
+ifeq ($(call cc-option-yn,-Wno-builtin-macro-redefined),y)
+KBUILD_CFLAGS   += -Wno-builtin-macro-redefined \
+  -D__FILE__=$$(call stringify,$$(src)/$$(notdir $$<))
+endif
+# CAUTION: Do not add any reference to KBUILD_CFLAGS below this line.
+# $(call cc-option,...) etc. may return wrong result.
+
 # Generate some files
 # ---
 
-- 
2.7.4

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


[U-Boot] [PATCH 0/3] kbuild: always use relative path for __FILE__

2017-10-13 Thread Masahiro Yamada

We discussed the __FILE__ problem when U-Boot is built out of tree.
https://www.mail-archive.com/u-boot@lists.denx.de/msg242852.html

The deeper your build directory is located, the larger
your U-Boot image becomes.
If your platform has memory footprint limit, this is a problem.

Recently, I submitted the following patches to Kbuild ML.
(no RFC, this time)
https://patchwork.kernel.org/patch/10001419/
https://patchwork.kernel.org/patch/10001409/

I consider them for Linux 4.15 unless there is
a strong objection or a problem report.

This series is a port for U-Boot.

If Tom wants to pick this up earlier, it is OK.
If not in hurry, you can wait for the activity in Linux.
Either will do.



Masahiro Yamada (2):
  kbuild: add stringify helper to quote a string passed to C files
  kbuild: redefine __FILE__ as relative path from $(srctree) if possible

Michal Marek (1):
  kbuild: Get rid of KBUILD_STR

 Makefile   | 9 +
 scripts/Kbuild.include | 4 
 scripts/Makefile.lib   | 8 
 3 files changed, 17 insertions(+), 4 deletions(-)

-- 
2.7.4

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


[U-Boot] [PATCH 3/3] kbuild: redefine __FILE__ as relative path from $(srctree) if possible

2017-10-13 Thread Masahiro Yamada
Since Kbuild runs in the objtree, __FILE__ can be a very long path
depending of $(srctree).

If objtree is a child of srctree, the situation is a bit better.
($(srctree) is "..")

For other cases of out-of-tree build, filenames in WARN_ON() etc. are
still an absolute path.  It also means the U-Boot image depends on
where it was built.

Here, the idea is to redefine __FILE__ as the relative path from
$(srctree), but doing so causes a compiler warning:
  warning: "__FILE__" redefined [-Wbuiltin-macro-redefined]

The option -Wno-builtin-macro-redefined can suppress it, but it is
only recognized by GCC 4.4 or newer.  Redefine __FILE__ only when
possible.

Signed-off-by: Masahiro Yamada 
---

 Makefile | 9 +
 1 file changed, 9 insertions(+)

diff --git a/Makefile b/Makefile
index 888486b..ab7775d 100644
--- a/Makefile
+++ b/Makefile
@@ -1334,6 +1334,15 @@ prepare0: archprepare FORCE
 # All the preparing..
 prepare: prepare0
 
+# If possible, redefne __FILE__ as relative path from $(srctree).
+# $$ is needed to expand the following in submake
+ifeq ($(call cc-option-yn,-Wno-builtin-macro-redefined),y)
+KBUILD_CFLAGS   += -Wno-builtin-macro-redefined \
+  -D__FILE__=$$(call stringify,$$(src)/$$(notdir $$<))
+endif
+# CAUTION: Do not add any reference to KBUILD_CFLAGS below this line.
+# Any call of cc-option, etc. will fail.
+
 # Generate some files
 # ---
 
-- 
2.7.4

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


[U-Boot] [PATCH 2/3] kbuild: add stringify helper to quote a string passed to C files

2017-10-13 Thread Masahiro Yamada
I want to reuse $(squote)$(quote)...$(quote)$(squote) in the next
commit.  Move it to a helper.

Signed-off-by: Masahiro Yamada 
---

 scripts/Kbuild.include | 4 
 scripts/Makefile.lib   | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 2c7918a..48a641c 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -30,6 +30,10 @@ baseprereq = $(basename $(notdir $<))
 escsq = $(subst $(squote),'\$(squote)',$1)
 
 ###
+# Quote a string to pass it to C files. foo => '"foo"'
+stringify = $(squote)$(quote)$1$(quote)$(squote)
+
+###
 # Easy method for doing a status message
kecho := :
  quiet_kecho := echo
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 8934b2f..bd0977e 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -99,7 +99,7 @@ obj-dirs  := $(addprefix $(obj)/,$(obj-dirs))
 # Note: Files that end up in two or more modules are compiled without the
 #   KBUILD_MODNAME definition. The reason is that any made-up name would
 #   differ in different configs.
-name-fix = $(squote)$(quote)$(subst $(comma),_,$(subst 
-,_,$1))$(quote)$(squote)
+name-fix = $(call stringify,$(subst $(comma),_,$(subst -,_,$1)))
 basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget))
 modname_flags  = $(if $(filter 1,$(words $(modname))),\
  -DKBUILD_MODNAME=$(call name-fix,$(modname)))
-- 
2.7.4

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


[U-Boot] [PATCH 1/3] kbuild: Get rid of KBUILD_STR

2017-10-13 Thread Masahiro Yamada
From: Michal Marek 

The compiler can accept -DKBUILD_MODNAME="foo", it's just a matter of
quoting. That way, we reduce the gcc command line a bit.

Signed-off-by: Michal Marek 
Signed-off-by: Masahiro Yamada 

[ Linux commit: b42841b7bb6286da56b4fa79835c27166b7e228b ]
---

 scripts/Makefile.lib | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 0d5c529..8934b2f 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -99,10 +99,10 @@ obj-dirs:= $(addprefix $(obj)/,$(obj-dirs))
 # Note: Files that end up in two or more modules are compiled without the
 #   KBUILD_MODNAME definition. The reason is that any made-up name would
 #   differ in different configs.
-name-fix = $(subst $(comma),_,$(subst -,_,$1))
-basename_flags = -D"KBUILD_BASENAME=KBUILD_STR($(call name-fix,$(basetarget)))"
+name-fix = $(squote)$(quote)$(subst $(comma),_,$(subst 
-,_,$1))$(quote)$(squote)
+basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget))
 modname_flags  = $(if $(filter 1,$(words $(modname))),\
- -D"KBUILD_MODNAME=KBUILD_STR($(call name-fix,$(modname)))")
+ -DKBUILD_MODNAME=$(call name-fix,$(modname)))
 
 orig_c_flags   = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) \
  $(ccflags-y) $(CFLAGS_$(basetarget).o)
@@ -154,7 +154,7 @@ endif
 # Modified for U-Boot: LINUXINCLUDE -> UBOOTINCLUDE
 c_flags= -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \
 $(__c_flags) $(modkern_cflags)   \
--D"KBUILD_STR(s)=\#s" $(basename_flags) $(modname_flags)
+$(basename_flags) $(modname_flags)
 
 a_flags= -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(UBOOTINCLUDE) \
 $(__a_flags) $(modkern_aflags)
-- 
2.7.4

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


Re: [U-Boot] [PATCH] arm: Start AArch32 Linux in EL1 instead of EL2 on AArch64

2017-10-13 Thread Marc Zyngier
On 13/10/17 09:37, Michal Simek wrote:
> On 13.10.2017 10:33, Marc Zyngier wrote:
>> On 13/10/17 08:26, Michal Simek wrote:
>>> On 13.10.2017 09:19, Alexander Graf wrote:


 On 13.10.17 09:08, Michal Simek wrote:
> AArch32 Linux should start in EL1 instead of EL2.

 Why? There is KVM on AArch32 as well.
>>>
>>> Is AArch32 without KVM able to start from EL2?
>>> At least based on my tests this is not working.
>>
>> Then someone broke it. Please report the bug on LAKML.
> 
> Do you have any kernel version which you are sure it should work?
> Or any kernel version which you know that it started to work?
It should have worked from the day 32bit KVM was merged (3.9), and still
does as of 4.13.

M.
-- 
Jazz is not dead. It just smells funny...
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PULL] efi patch queue 2017-10-13

2017-10-13 Thread Alexander Graf
Hi Tom,

This is my current patch queue for efi.  Please pull.

Alex


The following changes since commit 39dd65a059e503883dbf16d4c00ac083d15837da:

  sandbox: Enable btrfs support (2017-10-03 08:44:55 -0400)

are available in the git repository at:

  git://github.com/agraf/u-boot.git tags/signed-efi-next

for you to fetch changes up to abe994633b2ad56c5eea87c9253873f41dab477d:

  efi_selftest: correctly check return values (2017-10-13 10:24:22 +0200)


Patch queue for efi - 2017-10-13

This is the second batch of amazing improvements for efi_loader in 2017.11:

  - New self tests to verify our own code
  - A few bug fixes
  - colored text support
  - event and SNP improvements, should get us close to iPXE working


Heinrich Schuchardt (32):
  efi_loader: support 16 protocols per efi_object
  efi_loader: allow creating new handles
  efi_selftest: enable CONFIG_CMD_BOOTEFI_SELFTEST
  efi_selftest: use efi_st_error for all error messages
  efi_loader: use type bool for event states
  efi_selftest: make tests easier to read
  efi_loader: provide function comments for boot services
  efi_loader: replace efi_div10 by do_div
  efi_loader: call EFI_EXIT in efi_copy_mem, efi_set_mem
  efi_loader: parameters of CopyMem and SetMem
  efi_loader: pass GUIDs as const efi_guid_t *
  efi_loader: wrong type in wait_for_event
  efi_loader: incorrect definition of EFI_SIMPLE_NETWORK_PROTOCOL
  efi_loader: correct bits of receive_filters bit mask
  efi_loader: fill simple network protocol revision
  efi_loader: efi_net: hwaddr_size = 6
  efi_net: return EFI_UNSUPPORTED where appropriate
  efi_loader: use events for efi_net_receive
  efi_loader: implement WaitForPacket event
  efi_loader: fix efi_net_get_status
  efi_loader: size fields in SimpleNetworkProtocol
  efi_loader: fill return values in SimpleNetworkProtocol
  efi_selftest: correct definition of efi_st_error
  efi_selftest: allow printing MAC addresses
  efi_loader: supply EFI network test
  efi_selftest: efi_st_memcmp return difference of bytes
  efi_selftest: avoid dereferencing NULL in tpl test
  efi_loader: avoid NULL dereference in efi_dp_match
  efi_loader: comments for functions add missing @return
  efi_selftest: error handling in SNP test
  efi_loader: MAX_UTF8_PER_UTF16 = 3
  efi_selftest: correctly check return values

Jonathan Gray (2):
  efi_loader: search all possible disk partitions
  efi_loader: don't increment part twice per loop

Rob Clark (3):
  efi_loader: Fix disk dp's for pre-DM/legacy devices
  efi_loader: Add mem-mapped for fallback
  efi_loader: console support for color attributes

 cmd/bootefi.c|  23 +
 configs/qemu-x86_64_defconfig|   1 +
 configs/qemu-x86_defconfig   |   1 +
 include/charset.h|   4 +-
 include/efi_api.h| 103 ++-
 include/efi_loader.h |  15 +-
 include/efi_selftest.h   |  18 +-
 lib/efi_loader/efi_boottime.c| 788 ---
 lib/efi_loader/efi_console.c |  29 +-
 lib/efi_loader/efi_device_path.c |  24 +
 lib/efi_loader/efi_device_path_to_text.c |   9 +
 lib/efi_loader/efi_disk.c|  26 +-
 lib/efi_loader/efi_net.c | 143 +++-
 lib/efi_selftest/Makefile|   8 +-
 lib/efi_selftest/efi_selftest.c  |  37 +-
 lib/efi_selftest/efi_selftest_console.c  |  41 +-
 lib/efi_selftest/efi_selftest_events.c   |  84 +--
 lib/efi_selftest/efi_selftest_exitbootservices.c |  46 +-
 lib/efi_selftest/efi_selftest_snp.c  | 431 +
 lib/efi_selftest/efi_selftest_tpl.c  |  90 +--
 lib/efi_selftest/efi_selftest_util.c |  25 +
 21 files changed, 1688 insertions(+), 258 deletions(-)
 create mode 100644 lib/efi_selftest/efi_selftest_snp.c
 create mode 100644 lib/efi_selftest/efi_selftest_util.c
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] arm: Start AArch32 Linux in EL1 instead of EL2 on AArch64

2017-10-13 Thread Michal Simek
On 13.10.2017 10:33, Marc Zyngier wrote:
> On 13/10/17 08:26, Michal Simek wrote:
>> On 13.10.2017 09:19, Alexander Graf wrote:
>>>
>>>
>>> On 13.10.17 09:08, Michal Simek wrote:
 AArch32 Linux should start in EL1 instead of EL2.
>>>
>>> Why? There is KVM on AArch32 as well.
>>
>> Is AArch32 without KVM able to start from EL2?
>> At least based on my tests this is not working.
> 
> Then someone broke it. Please report the bug on LAKML.

Do you have any kernel version which you are sure it should work?
Or any kernel version which you know that it started to work?

Thanks,
Michal

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


Re: [U-Boot] [PATCH] arm: Start AArch32 Linux in EL1 instead of EL2 on AArch64

2017-10-13 Thread Marc Zyngier
On 13/10/17 08:26, Michal Simek wrote:
> On 13.10.2017 09:19, Alexander Graf wrote:
>>
>>
>> On 13.10.17 09:08, Michal Simek wrote:
>>> AArch32 Linux should start in EL1 instead of EL2.
>>
>> Why? There is KVM on AArch32 as well.
> 
> Is AArch32 without KVM able to start from EL2?
> At least based on my tests this is not working.

Then someone broke it. Please report the bug on LAKML.

Thanks,

M.
-- 
Jazz is not dead. It just smells funny...
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH 2/3] x86: baytrail: fsp: Use a function to update the Azalia config pointer

2017-10-13 Thread Bin Meng
At present we directly pass the Azalia config pointer to the FSP UPD.
This updates to use a function to do the stuff, like Braswell does.

Signed-off-by: Bin Meng 
---

 arch/x86/cpu/baytrail/fsp_configs.c  | 15 +--
 arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h |  2 +-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/arch/x86/cpu/baytrail/fsp_configs.c 
b/arch/x86/cpu/baytrail/fsp_configs.c
index 926f26b..3052fb6 100644
--- a/arch/x86/cpu/baytrail/fsp_configs.c
+++ b/arch/x86/cpu/baytrail/fsp_configs.c
@@ -120,6 +120,17 @@ const struct azalia_config azalia_config = {
 };
 
 /**
+ * Override the FSP's Azalia configuration data
+ *
+ * @azalia:pointer to be updated to point to a ROM address where Azalia
+ * configuration data is stored
+ */
+static void update_fsp_azalia_configs(struct azalia_config **azalia)
+{
+   *azalia = (struct azalia_config *)_config;
+}
+
+/**
  * Override the FSP's configuration data.
  * If the device tree does not specify an integer setting, use the default
  * provided in Intel's Baytrail_FSP_Gold4.tgz release FSP/BayleyBayFsp.bsf 
file.
@@ -137,8 +148,6 @@ void update_fsp_configs(struct fsp_config_data *config,
rt_buf->common.boot_mode = config->common.boot_mode;
rt_buf->common.upd_data = >fsp_upd;
 
-   fsp_upd->azalia_config_ptr = (uint32_t)_config;
-
node = fdtdec_next_compatible(blob, 0, COMPAT_INTEL_BAYTRAIL_FSP);
if (node < 0) {
debug("%s: Cannot find FSP node\n", __func__);
@@ -173,6 +182,8 @@ void update_fsp_configs(struct fsp_config_data *config,
SATA_MODE_AHCI);
fsp_upd->enable_azalia = fdtdec_get_bool(blob, node,
 "fsp,enable-azalia");
+   if (fsp_upd->enable_azalia)
+   update_fsp_azalia_configs(_upd->azalia_cfg_ptr);
fsp_upd->enable_xhci = fdtdec_get_bool(blob, node, "fsp,enable-xhci");
fsp_upd->lpe_mode = fdtdec_get_int(blob, node, "fsp,lpe-mode",
   LPE_MODE_PCI);
diff --git a/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h 
b/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h
index 8c07b37..e2f0e39 100644
--- a/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h
+++ b/arch/x86/include/asm/arch-baytrail/fsp/fsp_vpd.h
@@ -45,7 +45,7 @@ struct __packed upd_region {
uint8_t enable_sata;/* Offset 0x002d */
uint8_t sata_mode;  /* Offset 0x002e */
uint8_t enable_azalia;  /* Offset 0x002f */
-   uint32_t azalia_config_ptr; /* Offset 0x0030 */
+   struct azalia_config *azalia_cfg_ptr;   /* Offset 0x0030 */
uint8_t enable_xhci;/* Offset 0x0034 */
uint8_t lpe_mode;   /* Offset 0x0035 */
uint8_t lpss_sio_mode;  /* Offset 0x0036 */
-- 
2.7.4

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


[U-Boot] [PATCH 3/3] x86: baytrail: fsp: Move Azalia update codes to board

2017-10-13 Thread Bin Meng
Azalia configuration may be different across boards, hence it's not
appropriate to do that in the SoC level. Instead, let's make the
SoC update_fsp_azalia_configs() routine as a weak version, and do
the actual work in the board codes.

So far it seems only som-db5800-som-6867 board enables the Azalia.
Move the original codes into som-db5800-som-6867.c.

Signed-off-by: Bin Meng 
---

 arch/x86/cpu/baytrail/fsp_configs.c| 111 +
 .../som-db5800-som-6867/som-db5800-som-6867.c  | 111 +
 2 files changed, 113 insertions(+), 109 deletions(-)

diff --git a/arch/x86/cpu/baytrail/fsp_configs.c 
b/arch/x86/cpu/baytrail/fsp_configs.c
index 3052fb6..6b762e5 100644
--- a/arch/x86/cpu/baytrail/fsp_configs.c
+++ b/arch/x86/cpu/baytrail/fsp_configs.c
@@ -12,122 +12,15 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/* ALC262 Verb Table - 10EC0262 */
-static const u32 verb_table_data13[] = {
-   /* Pin Complex (NID 0x11) */
-   0x01171cf0,
-   0x01171d11,
-   0x01171e11,
-   0x01171f41,
-   /* Pin Complex (NID 0x12) */
-   0x01271cf0,
-   0x01271d11,
-   0x01271e11,
-   0x01271f41,
-   /* Pin Complex (NID 0x14) */
-   0x01471c10,
-   0x01471d40,
-   0x01471e01,
-   0x01471f01,
-   /* Pin Complex (NID 0x15) */
-   0x01571cf0,
-   0x01571d11,
-   0x01571e11,
-   0x01571f41,
-   /* Pin Complex (NID 0x16) */
-   0x01671cf0,
-   0x01671d11,
-   0x01671e11,
-   0x01671f41,
-   /* Pin Complex (NID 0x18) */
-   0x01871c20,
-   0x01871d98,
-   0x01871ea1,
-   0x01871f01,
-   /* Pin Complex (NID 0x19) */
-   0x01971c21,
-   0x01971d98,
-   0x01971ea1,
-   0x01971f02,
-   /* Pin Complex (NID 0x1A) */
-   0x01a71c2f,
-   0x01a71d30,
-   0x01a71e81,
-   0x01a71f01,
-   /* Pin Complex */
-   0x01b71c1f,
-   0x01b71d40,
-   0x01b71e21,
-   0x01b71f02,
-   /* Pin Complex */
-   0x01c71cf0,
-   0x01c71d11,
-   0x01c71e11,
-   0x01c71f41,
-   /* Pin Complex */
-   0x01d71c01,
-   0x01d71dc6,
-   0x01d71e14,
-   0x01d71f40,
-   /* Pin Complex */
-   0x01e71cf0,
-   0x01e71d11,
-   0x01e71e11,
-   0x01e71f41,
-   /* Pin Complex */
-   0x01f71cf0,
-   0x01f71d11,
-   0x01f71e11,
-   0x01f71f41,
-};
-
-/*
- * This needs to be in ROM since if we put it in CAR, FSP init loses it when
- * it drops CAR.
- *
- * TODO(s...@chromium.org): Move to device tree when FSP allows it
- *
- * VerbTable: (RealTek ALC262)
- * Revision ID = 0xFF, support all steps
- * Codec Verb Table For AZALIA
- * Codec Address: CAd value (0/1/2)
- * Codec Vendor: 0x10EC0262
- */
-static const struct azalia_verb_table azalia_verb_table[] = {
-   {
-   {
-   0x10ec0262,
-   0x,
-   0xff,
-   0x01,
-   0x000b,
-   0x0002,
-   },
-   verb_table_data13
-   }
-};
-
-const struct azalia_config azalia_config = {
-   .pme_enable = 1,
-   .docking_supported = 1,
-   .docking_attached = 0,
-   .hdmi_codec_enable = 1,
-   .azalia_v_ci_enable = 1,
-   .rsvdbits = 0,
-   .verb_table_num = 1,
-   .verb_table = azalia_verb_table,
-   .reset_wait_timer_ms = 300
-};
-
 /**
  * Override the FSP's Azalia configuration data
  *
  * @azalia:pointer to be updated to point to a ROM address where Azalia
  * configuration data is stored
  */
-static void update_fsp_azalia_configs(struct azalia_config **azalia)
+__weak void update_fsp_azalia_configs(struct azalia_config **azalia)
 {
-   *azalia = (struct azalia_config *)_config;
+   *azalia = NULL;
 }
 
 /**
diff --git a/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c 
b/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c
index 6158795..202e9875 100644
--- a/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c
+++ b/board/advantech/som-db5800-som-6867/som-db5800-som-6867.c
@@ -6,6 +6,117 @@
  */
 
 #include 
+#include 
+
+/* ALC262 Verb Table - 10EC0262 */
+static const u32 verb_table_data13[] = {
+   /* Pin Complex (NID 0x11) */
+   0x01171cf0,
+   0x01171d11,
+   0x01171e11,
+   0x01171f41,
+   /* Pin Complex (NID 0x12) */
+   0x01271cf0,
+   0x01271d11,
+   0x01271e11,
+   0x01271f41,
+   /* Pin Complex (NID 0x14) */
+   0x01471c10,
+   0x01471d40,
+   0x01471e01,
+   0x01471f01,
+   /* Pin Complex (NID 0x15) */
+   0x01571cf0,
+   0x01571d11,
+   0x01571e11,
+   0x01571f41,
+   /* Pin Complex (NID 0x16) */
+   0x01671cf0,
+   0x01671d11,
+   0x01671e11,
+   0x01671f41,
+   /* Pin Complex (NID 0x18) */
+   0x01871c20,
+   0x01871d98,
+   0x01871ea1,
+   0x01871f01,
+   

[U-Boot] [PATCH 1/3] x86: fsp: Consolidate Azalia header file

2017-10-13 Thread Bin Meng
So far there are two copies of Azalia struct defines with one in
baytrail and the other one in braswell. This consolidates these
two into one, put it in the common place, and remove the prefix
pch_ to these structs to make their names more generic.

This also corrects reset_wait_timer from us to ms.

Signed-off-by: Bin Meng 
---

 arch/x86/cpu/baytrail/fsp_configs.c  | 13 
 arch/x86/include/asm/arch-baytrail/fsp/azalia.h  | 39 
 arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h | 26 
 arch/x86/include/asm/fsp/fsp_azalia.h| 39 
 arch/x86/include/asm/fsp/fsp_support.h   |  1 +
 5 files changed, 46 insertions(+), 72 deletions(-)
 delete mode 100644 arch/x86/include/asm/arch-baytrail/fsp/azalia.h
 create mode 100644 arch/x86/include/asm/fsp/fsp_azalia.h

diff --git a/arch/x86/cpu/baytrail/fsp_configs.c 
b/arch/x86/cpu/baytrail/fsp_configs.c
index 45f9bf9..926f26b 100644
--- a/arch/x86/cpu/baytrail/fsp_configs.c
+++ b/arch/x86/cpu/baytrail/fsp_configs.c
@@ -8,13 +8,12 @@
 
 #include 
 #include 
-#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
 /* ALC262 Verb Table - 10EC0262 */
-static const uint32_t verb_table_data13[] = {
+static const u32 verb_table_data13[] = {
/* Pin Complex (NID 0x11) */
0x01171cf0,
0x01171d11,
@@ -94,7 +93,7 @@ static const uint32_t verb_table_data13[] = {
  * Codec Address: CAd value (0/1/2)
  * Codec Vendor: 0x10EC0262
  */
-static const struct pch_azalia_verb_table azalia_verb_table[] = {
+static const struct azalia_verb_table azalia_verb_table[] = {
{
{
0x10ec0262,
@@ -108,16 +107,16 @@ static const struct pch_azalia_verb_table 
azalia_verb_table[] = {
}
 };
 
-const struct pch_azalia_config azalia_config = {
+const struct azalia_config azalia_config = {
.pme_enable = 1,
.docking_supported = 1,
.docking_attached = 0,
.hdmi_codec_enable = 1,
.azalia_v_ci_enable = 1,
.rsvdbits = 0,
-   .azalia_verb_table_num = 1,
-   .azalia_verb_table = azalia_verb_table,
-   .reset_wait_timer_us = 300
+   .verb_table_num = 1,
+   .verb_table = azalia_verb_table,
+   .reset_wait_timer_ms = 300
 };
 
 /**
diff --git a/arch/x86/include/asm/arch-baytrail/fsp/azalia.h 
b/arch/x86/include/asm/arch-baytrail/fsp/azalia.h
deleted file mode 100644
index d96a20f..000
--- a/arch/x86/include/asm/arch-baytrail/fsp/azalia.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2013, Intel Corporation
- * Copyright (C) 2015 Google, Inc
- *
- * SPDX-License-Identifier:Intel
- */
-
-#ifndef _FSP_AZALIA_H_
-#define _FSP_AZALIA_H_
-
-struct __packed pch_azalia_verb_table_header {
-   uint32_t vendor_device_id;
-   uint16_t sub_system_id;
-   uint8_t revision_id;/* 0xff applies to all steppings */
-   uint8_t front_panel_support;
-   uint16_t number_of_rear_jacks;
-   uint16_t number_of_front_jacks;
-};
-
-struct __packed pch_azalia_verb_table {
-   struct pch_azalia_verb_table_header verb_table_header;
-   const uint32_t *verb_table_data;
-};
-
-struct __packed pch_azalia_config {
-   uint8_t pme_enable:1;
-   uint8_t docking_supported:1;
-   uint8_t docking_attached:1;
-   uint8_t hdmi_codec_enable:1;
-   uint8_t azalia_v_ci_enable:1;
-   uint8_t rsvdbits:3;
-   /* number of verb tables provided by platform */
-   uint8_t azalia_verb_table_num;
-   const struct pch_azalia_verb_table *azalia_verb_table;
-   /* delay timer after azalia reset */
-   uint16_t reset_wait_timer_us;
-};
-
-#endif
diff --git a/arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h 
b/arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h
index ecb01fa..99c4c0a 100644
--- a/arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h
+++ b/arch/x86/include/asm/arch-braswell/fsp/fsp_vpd.h
@@ -29,32 +29,6 @@ struct __packed memory_upd {
u8 reserved[189];   /* Offset 0x0043 */
 };
 
-struct __packed azalia_verb_table_header {
-   u32 vendor_device_id;
-   u16 sub_system_id;
-   u8 revision_id;
-   u8 front_panel_support;
-   u16 number_of_rear_jacks;
-   u16 number_of_front_jacks;
-};
-
-struct __packed azalia_verb_table {
-   struct azalia_verb_table_header header;
-   u32 *data;
-};
-
-struct __packed azalia_config {
-   u8 pme_enable:1;
-   u8 docking_supported:1;
-   u8 docking_attached:1;
-   u8 hdmi_codec_enable:1;
-   u8 azalia_v_ci_enable:1;
-   u8 reserved:3;
-   u8 verb_table_num;
-   struct azalia_verb_table *verb_table;
-   u16 reset_wait_timer_ms;
-};
-
 struct gpio_family {
u32 confg;
u32 confg_changes;
diff --git a/arch/x86/include/asm/fsp/fsp_azalia.h 
b/arch/x86/include/asm/fsp/fsp_azalia.h
new file mode 100644
index 000..a1467bf
--- /dev/null
+++ 

Re: [U-Boot] [PATCH 05/11] efi_loader: move efi_search_obj up in code

2017-10-13 Thread Alexander Graf


On 13.10.17 02:15, Heinrich Schuchardt wrote:
> On 10/09/2017 06:49 AM, Simon Glass wrote:
>> On 7 October 2017 at 22:57, Heinrich Schuchardt  wrote:
>>> To avoid a forward declaration move efi_search_obj before
>>> all protocol services functions.
>>>
>>> Signed-off-by: Heinrich Schuchardt 
>>> ---
>>>  lib/efi_loader/efi_boottime.c | 41 
>>> +
>>>  1 file changed, 21 insertions(+), 20 deletions(-)
>>
>> Reviewed-by: Simon Glass 
>>
> Hello Alex,
> 
> could this patch be merged?
> 
> You merged all preceding patches of the series.

This patch is only needed as prerequisite for SetWatchdogTimer. I think
it's ok to push that out to post-2017.11? We should probably focus on
stability for the release by now...

That doesn't mean the patches will rot on the list - I'll just apply
them to a different branch once the next version of the patch set hits
the ML.


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


  1   2   >