[U-Boot] [PATCH] Do not merge this to u-boot/master: disable fixdep

2014-02-02 Thread Masahiro Yamada
  --- Do not merge this patch to the main line ---

This patch is used for Kbuild performance test.

Signed-off-by: Masahiro Yamada 
---
 scripts/Kbuild.include | 4 +---
 scripts/Makefile.build | 6 +-
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 6504571..9d4dabe 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -232,9 +232,7 @@ if_changed = $(if $(strip $(any-prereq) $(arg-check)),  
 \
 if_changed_dep = $(if $(strip $(any-prereq) $(arg-check) ),  \
@set -e; \
$(echo-cmd) $(cmd_$(1)); \
-   scripts/basic/fixdep $(depfile) $@ '$(make-cmd)' > $(dot-target).tmp;\
-   rm -f $(depfile);\
-   mv -f $(dot-target).tmp $(dot-target).cmd)
+   echo 'cmd_$@ := $(make-cmd)' > $(dot-target).cmd)
 
 # Usage: $(call if_changed_rule,foo)
 # Will check if $(cmd_foo) or any of the prerequisites changed,
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index f37957f..dae809b 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -322,11 +322,7 @@ define rule_cc_o_c
$(call echo-cmd,cc_o_c) $(cmd_cc_o_c);\
$(cmd_modversions)\
$(call echo-cmd,record_mcount)\
-   $(cmd_record_mcount)  \
-   scripts/basic/fixdep $(depfile) $@ '$(call make-cmd,cc_o_c)' >\
- $(dot-target).tmp;  \
-   rm -f $(depfile); \
-   mv -f $(dot-target).tmp $(dot-target).cmd
+   $(cmd_record_mcount)
 endef
 
 # Built-in and composite module parts
-- 
1.8.3.2

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


Re: [U-Boot] [PATCH v8 0/38] Switch over to real Kbuild

2014-02-02 Thread Masahiro Yamada
Hello Simon and Tom,


This is my analysis of Kbuild performance.



[1] -j option is working

What I must say first is -j option is working correctly with Kbuild.

You can double-check by following the steps below.

Apply Kbuild series v8 on
commit 07e2822d158940a0e8ba45b6ab0344ffa1011a07.


First, build without -j option.

$ make mrproper
$ time make CROSS_COMPILE=arm-linux-gnueabi-  snow_config all
Configuring for snow board...
  GEN include/autoconf.mk.dep
  [snip]

real1m15.089s
user0m44.092s
sys 0m32.513s


Next, build with -j8 option.
(Run "make mrproper" every time because we want to be sure
that there are no generated files before build.)

$ make mrproper
$ time make -j8 CROSS_COMPILE=arm-linux-gnueabi-  snow_config all 
  [snip]

real0m17.223s
user0m50.010s
sys 0m29.038s


It is much faster with -j8 option than without -j option.
(4.3 times faster on my box.)



You will easily notice another proof that -j option is working.


If you do not add -j option, the shorten log will be displayed
in the alphabetical order of output file name:

  LD  arch/arm/cpu/built-in.o
  CC  arch/arm/cpu/armv7/cache_v7.o
  CC  arch/arm/cpu/armv7/cpu.o
  CC  arch/arm/cpu/armv7/syslib.o
  CC  arch/arm/cpu/armv7/s5p-common/cpu_info.o
  CC  arch/arm/cpu/armv7/s5p-common/timer.o
  CC  arch/arm/cpu/armv7/s5p-common/sromc.o
  CC  arch/arm/cpu/armv7/s5p-common/pwm.o
  LD  arch/arm/cpu/armv7/s5p-common/built-in.o
  LD  arch/arm/cpu/armv7/built-in.o
  AS  arch/arm/cpu/armv7/start.o
  CC  arch/arm/cpu/armv7/exynos/clock.o
  CC  arch/arm/cpu/armv7/exynos/power.o
 

On the other hand, if you add -j option, the log will be shown
in a different order:

  LD  arch/arm/cpu/built-in.o
  CC  arch/arm/cpu/armv7/cache_v7.o
  CC  arch/arm/cpu/armv7/exynos/clock.o
  CC  disk/part.o
  AS  arch/arm/lib/crt0.o
  CC  board/samsung/common/board.o
  CC  board/samsung/smdk5250/smdk5250_spl.o
  CC  common/main.o
  LD  drivers/block/built-in.o
  LD  board/samsung/common/built-in.o
  CC  arch/arm/cpu/armv7/cpu.o
  AS  arch/arm/lib/relocate.o
  CC  disk/part_dos.o
  CC  arch/arm/cpu/armv7/exynos/power.o



[2] Is Kbuild slower than the old U-Boot build system?

Yes, Kbuild is definitely slower.
(But, as far as I tested,  I don't think it is 3 times slower.)

Let's compare the build time with the conventional build system.

Checkout master branch.
(commit 07e2822d158940a0e8ba45b6ab0344ffa1011a07)

$ make mrproper
$ time make CROSS_COMPILE=arm-linux-gnueabi-  snow

real0m45.612s
user0m28.367s
sys 0m18.969s


So, Kbuild(=real 1m15.089s) is 1.6 times slower
than the old U-Boot build system.


[3] Why is Kbuild slower?

One reason is "fixdep".

The helper program, fixdep, parses the source file
and all headers included from it to search all CONFIG
macro used there. This is a rather heavy task.

If you don't know the reason why "fixdep" is necessary,
please read the comment block of scripts/basic/fixdep.c
It is true that fixdep is meaningless for now,
but it will be a great help when switching to Kconfig.
We will get more return than we pay.
(And Kconfig series is almost ready.
I will test more and post version 1 within a couple of weeks.)


Let' check how big the impact of fixdep is.

I prepared a patch for you to disable fixdep:
http://patchwork.ozlabs.org/patch/316057/

Apply it on
commit 07e2822d158940a0e8ba45b6ab0344ffa1011a07 + Kbuild v8

And then, build.

$ make mrproper
$ time make CROSS_COMPILE=arm-linux-gnueabi-  snow_config all 

real1m2.436s
user0m38.281s
sys 0m25.871s

It is faster by 1.2 times faster without fixdep than it is with fixdep.


Another big factor is "arg-check".
This excellent routine is defined in scripts/Kbuild.include.

The dependency tracking of U-Boot old build system is
absolutely unreliable.
It compares the timestamp between object files and source files,
but never checks the arguments given to the compiler.

Kbuild checks both of them to precisely detect which objects must
be re-built.

To see how heavy "arg-check" task is,
build with KBUILD_NOCMDDEP=1 option to disable "arg-check".

$ make mrproper
$ time make CROSS_COMPILE=arm-linux-gnueabi- KBUILD_NOCMDDEP=1 snow_config all

real0m41.882s
user0m28.432s
sys 0m14.971s

See?
It is as fast as the old U-boot system(=0m45.612) .


Conclusion:
The main reasons of the slow down with Kbuild are "fixdep" and "arg-check".
Both of them are really important features for Kbuild and Kconfig.
- "fixdep" is mandatory for our better life with Kconfig.
- "arg-check" is for perfect dependency tracking.



> > What's your plan about this series?
> > Are we ready to switch to Kbuild, or need more review?
> 
> Lets get the performance problem Simon found figured out, but then
> otherwise, yes, I think we're about ready to merge.

Tom, are you satisfied with my analisys?

But, please hold merging Kbuild series.
I wi

Re: [U-Boot] [PATCH 1/2] exynos5250: usb: Fix VBus gpio numbers for ehci and xhci controllers

2014-02-02 Thread Minkyu Kang
On 03/01/14 19:40, Vivek Gautam wrote:
> The gpio_*() apis require the exact gpio line number to deduce
> the gpio bank and the gpio pin addresses.
> So fix the gpio number for VBUS used for EHCI ports as well as
> XHCI ports on exynos5250 boards.
> 
> Signed-off-by: Vivek Gautam 
> Cc: Julius Werner 
> Cc: Minkyu Kang 
> Cc: Marek Vasut 
> ---
>  board/samsung/dts/exynos5250-smdk5250.dts |2 +-
>  board/samsung/dts/exynos5250-snow.dts |4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 

applied to u-boot-samsung.

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


Re: [U-Boot] [PATCH 2/2] smdk5250: Remove 'board_usb_vbus_init()' function

2014-02-02 Thread Minkyu Kang
On 03/01/14 19:40, Vivek Gautam wrote:
> Previously as a part of moving the VBUS gpio support to device tree
> following patch removed this and added relevant support in driver:
> 4a271cb exynos: usb: Switch USB VBUS GPIOs to be device tree configured
> 
> Recent changes for common board file migration for exynos platform
> added it again. So removing it now.
> 
> Signed-off-by: Vivek Gautam 
> Cc: Julius Werner 
> Cc: Minkyu Kang 
> Cc: Marek Vasut 
> ---
>  board/samsung/smdk5250/smdk5250.c |   19 ---
>  1 file changed, 19 deletions(-)
> 

applied to u-boot-samsung.

Thanks,
Minkyu Kang.

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


Re: [U-Boot] [PATCH v2 2/2] Powerpc/QE: Add QE support for T1040

2014-02-02 Thread Timur Tabi
On Mon, Jan 27, 2014 at 2:14 AM, Zhao Qiang  wrote:
> +#ifndef CONFIG_PPC_T1040

Nack.  You need to write this code without all this T1040-specific
#ifdefs everywhere.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Signed-off-by for RPI U-Boot USB patches

2014-02-02 Thread Oleksandr Tymoshenko

On 2014-02-01, at 10:17 PM, Stephen Warren  wrote:

> (Sorry for the spam; resending with the correct U-Boot mailing list in CC)
> 
> On 02/01/2014 11:14 PM, Stephen Warren wrote:
>> Oleksandr, I'm starting to look at getting USB support enabled for the
>> Raspberry Pi in mainline U-Boot. To that end, I looked at:
>> 
>> git://github.com/gonzoua/u-boot-pi.git rpi
>> 
>> I took the DWC driver from there and applied it to a very recent
>> mainline U-Boot. It works very well:-)

Nice to know :) Thanks for bringing this stuff to upstream. 

>> 
>> The main thing preventing me from sending the driver for inclusion in
>> mainline U-Boot is that none of the commits in that branch contain a
>> Signed-off-by tag from you. Could you please reply here with your s-o-b
>> line for all the commits listed below?

I really should start using commit -s :) 

Signed-off-by: Oleksandr Tymoshenko 



>> 
>> Thank you very much!
>> 
>> For details of what s-o-b means, please see
>> https://www.kernel.org/doc/Documentation/SubmittingPatches section 12
>> "Sign your work". (There's also a standalone website containing that
>> section now, but I can't for the life of me find it...)
>> 
>> b22090f Fix usb_lowlevel_init and usb_lowlevel_stop
>> 8d5c624 Merge of doom: update to latest u-boot
>> cd2dac2 Increase buffer for bulk transfers and make virtual hub highspeed
>> fc4164b Enable USB mass storage support
>> 9085155 Increase timeout for soft reset
>> 4b3863c More sophysticated initialization code
>> 8cb8ecc Rmeove hardcoded MAC address
>> 6ab7258 Report error, do not hang
>> 9e5763c Fix typo and whitespaces
>> d141598 Fix memory layout for U-Boot
>> 5d8b20f Cleanup and add function declarations
>> eb2bb98 Add sanity check, just in case
>> 8c85e48 Clean up mess with buffers
>> d8fb4c3 Get rid of device-specific structures/registers
>> ce7f827 Merge branch 'rpi' of github.com:gonzoua/u-boot-pi into rpi
>> a78f29e Slap licenses on top of the newly created files
>> d80dd6a Remove debug level
>> cc7227e Minor cleanup
>> 0d3c12f More stable CONTROL transfers, working BULK transfers
>> 9da26b0 Remove debug output
>> 70f4b54 Add support for USB ethernet and SMSC95XX
>> ae9e5fc Add stripped-down version of Linux driver for DWC OTG
>> a1bfc20 Skeleton DWC OTG driver implementation
>> b47e41c Slap licenses on top of the newly created files
>> ded1dc9 Remove debug level
>> 602704e Minor cleanup
>> ecc6e3d More stable CONTROL transfers, working BULK transfers
>> d966ac2 Add support for USB ethernet and SMSC95XX
>> 71633e5 Add stripped-down version of Linux driver for DWC OTG
>> 182c5b0 Skeleton DWC OTG driver implementation
>> 
>> (yes, there are duplicate entries in that list, because there are in the
>> git tree I took the code from)
>> 
>> ___
>> linux-rpi-kernel mailing list
>> linux-rpi-ker...@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-rpi-kernel
>> 
> 
> 

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


Re: [U-Boot] [PATCH v6 00/11] Introduce Samsung misc file and LCD menu.

2014-02-02 Thread Minkyu Kang
On 22/01/14 19:24, Przemyslaw Marczak wrote:
> This patch set includes changes required to:
> - properly use of all gpios
> - introduce common file for Samsung misc code
> - keys support (PWR, VOL:UP,DOWN)
> - console support on LCD
> - 16bpp logo support
> - introduce LCD menu on Samsung devices
> 
> Each version changes are described in each patch commit msg.
> 
> Przemyslaw Marczak (11):
>   s5p: gpio: change gpio coding method for s5p gpio.
>   trats2: Code cleanup.
>   samsung: common: Add file for common functions, draw_logo() cleanup.
>   common: lcd.c: fix data abort exception when try to access bmp header
>   lib: tizen: change Tizen logo with the new one.
>   video: exynos: fimd: add support for various display color modes
>   samsung: boards: update display configs with 16bpp mode.
>   samsung: misc: Add LCD download menu.
>   trats: add LCD download menu support
>   trats2: add LCD download menu support
>   universal: add LCD download menu support
> 
>  arch/arm/include/asm/arch-exynos/gpio.h  |  245 +-
>  arch/arm/include/asm/arch-s5pc1xx/gpio.h |   47 +-
>  board/samsung/common/Makefile|1 +
>  board/samsung/common/misc.c  |  387 ++
>  board/samsung/trats/trats.c  |   18 +-
>  board/samsung/trats2/trats2.c|   31 +-
>  board/samsung/universal_c210/universal.c |   18 +-
>  common/lcd.c |   27 +-
>  drivers/gpio/s5p_gpio.c  |   15 +-
>  drivers/power/battery/bat_trats2.c   |2 +-
>  drivers/video/exynos_fb.c|   28 -
>  drivers/video/exynos_fimd.c  |   15 +-
>  include/configs/s5p_goni.h   |4 +-
>  include/configs/s5pc210_universal.h  |   43 +-
>  include/configs/trats.h  |   35 +-
>  include/configs/trats2.h |   32 +-
>  include/lcd.h|2 +
>  include/power/max77686_pmic.h|2 +
>  include/power/pmic.h |1 -
>  include/samsung/misc.h   |   25 +
>  lib/tizen/tizen.c|   21 +-
>  lib/tizen/tizen_hd_logo.h| 5057 ---
>  lib/tizen/tizen_hd_logo_data.h   |   15 -
>  lib/tizen/tizen_logo_16bpp.h |10025 
> ++
>  lib/tizen/tizen_logo_16bpp_gzip.h|  727 +++
>  25 files changed, 11470 insertions(+), 5353 deletions(-)
>  create mode 100644 board/samsung/common/misc.c
>  create mode 100644 include/samsung/misc.h
>  delete mode 100644 lib/tizen/tizen_hd_logo.h
>  delete mode 100644 lib/tizen/tizen_hd_logo_data.h
>  create mode 100644 lib/tizen/tizen_logo_16bpp.h
>  create mode 100644 lib/tizen/tizen_logo_16bpp_gzip.h
> 

applied to u-boot-samsung.

Thanks,
Minkyu Kang.

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


Re: [U-Boot] [PATCH] config: trats: trats2: extend dfu_alt_info by env update settings

2014-02-02 Thread Minkyu Kang
On 22/01/14 20:02, Przemyslaw Marczak wrote:
> This change allows updating environment stored on MMC by dfu or thor.
> 
> New setting:
> - "params.bin mmc 0x38 0x8"
> 
> File params.bin can be generated by: tools/mkenvimage.
> e.g. ./mkenvimage -s 4096 -o params.bin 
> 
> Every new env variable in text file should start with a new line.
> 
> Sample env text file:
> - board/samsung/common/dfu_sample_env.txt
> 
> Requirements:
> - file name: "params.bin"
> - file size: 4096 Bytes - the same as CONFIG_ENV_SIZE.
>   Other size will cause CRC miscalculation at boot.
> 
> Signed-off-by: Przemyslaw Marczak 
> CC: Piotr Wilczek 
> CC: Lukasz Majewski 
> ---
>  board/samsung/common/dfu_sample_env.txt |9 +
>  include/configs/trats.h |3 ++-
>  include/configs/trats2.h|3 ++-
>  3 files changed, 13 insertions(+), 2 deletions(-)
>  create mode 100644 board/samsung/common/dfu_sample_env.txt
> 

applied to u-boot-samsung.

Thanks,
Minkyu Kang.

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


Re: [U-Boot] [PATCH 3/3] exynos: pinmux: remove unnecessary routine

2014-02-02 Thread Minkyu Kang
On 29/01/14 18:01, Rajeshwari Birje wrote:
> Hi Minkyu Knag,
> 
> On Wed, Jan 29, 2014 at 1:34 PM, Minkyu Kang  wrote:
>> Because of the list of peripherals is not sequential,
>> such a routine does not check for valid correctly.
>> Error check will be done when call the exynos_pinmux_config function.
>>
>> Signed-off-by: Minkyu Kang 
>> ---
>>  arch/arm/cpu/armv7/exynos/pinmux.c |7 +--
>>  1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
>> b/arch/arm/cpu/armv7/exynos/pinmux.c
>> index 904177a..645c497 100644
>> --- a/arch/arm/cpu/armv7/exynos/pinmux.c
>> +++ b/arch/arm/cpu/armv7/exynos/pinmux.c
>> @@ -751,12 +751,7 @@ static int exynos5_pinmux_decode_periph_id(const void 
>> *blob, int node)
>> if (err)
>> return PERIPH_ID_NONE;
>>
>> -   /* check for invalid peripheral id */
>> -   if ((PERIPH_ID_SDMMC4 > cell[1]) || (cell[1] < PERIPH_ID_UART0))
>> -   return cell[1];
> 
> Cant we check if less than PERIPH_ID_COUNT, this way we can atleast
> cut down some wrong values.
> Or value has to range between PERIPH_ID_UART0 and PERIPH_ID_COUNT
> 

possible. but I think it's unnecessary.
It can not check error correctly.
for example, if cell[1] is 55 then it's valid but does not supported.

Thanks,
Minkyu Kang.

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


Re: [U-Boot] [PATCH V5 5/6] exynos: Add a common DT based PMIC driver initialization

2014-02-02 Thread Minkyu Kang
On 16/01/14 17:55, Leela Krishna Amudala wrote:
> Most of i2c PMIC drivers follow the same initialization sequence,
> let's generalize it in a common file.
> 
> The initialization function finds the PMIC in the device tree, and if
> found - registers it in the list of known PMICs and initializes it,
> iterating through the table of settings supplied by the caller.
> 
> Signed-off-by: Vadim Bendebury 
> Signed-off-by: Leela Krishna Amudala 
> Reviewed-by: Doug Anderson 
> Acked-by: Simon Glass 
> ---
>  board/samsung/common/board.c |   26 
>  drivers/power/pmic/Makefile  |1 +
>  drivers/power/pmic/pmic_common.c |   87 
> ++
>  drivers/power/power_core.c   |   14 ++
>  include/power/pmic.h |   36 
>  5 files changed, 164 insertions(+)
>  create mode 100644 drivers/power/pmic/pmic_common.c
> 
> diff --git a/drivers/power/pmic/pmic_common.c 
> b/drivers/power/pmic/pmic_common.c
> new file mode 100644
> index 000..ea1e90f
> --- /dev/null
> +++ b/drivers/power/pmic/pmic_common.c
> @@ -0,0 +1,87 @@
> +/*
> + * Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + *
> + * Author: Vadim Bendebury 
> + */
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +int pmic_common_init(enum fdt_compat_id pmic_compat,
> +  const struct pmic_init_ops *pmic_ops,
> +  unsigned int number_of_regs)
> +{
> + const void *blob = gd->fdt_blob;
> + struct pmic *p;
> + int node, parent, ret;
> + const char *pmic_name, *comma;
> +
> + if (!number_of_regs) {
> + printf("%s: %s - not a supported PMIC\n",
> +__func__, fdtdec_get_compatible(pmic_compat));
> + return -1;
> + }
> +
> + node = fdtdec_next_compatible(blob, 0, pmic_compat);
> + if (node < 0) {
> + debug("PMIC: Error %s. No node for %s in device tree\n",
> +   fdt_strerror(node), fdtdec_get_compatible(pmic_compat));
> + return node;
> + }
> +
> + pmic_name = fdtdec_get_compatible(pmic_compat);
> + comma = strchr(pmic_name, ',');
> + if (comma)
> + pmic_name = comma + 1;
> +
> + p = pmic_alloc();
> +
> + if (!p) {
> + printf("%s: POWER allocation error!\n", __func__);
> + return -ENOMEM;
> + }
> + parent = fdt_parent_offset(blob, node);
> + if (parent < 0) {
> + debug("%s: Cannot find node parent\n", __func__);
> + return -1;
> + }
> +
> + p->bus = i2c_get_bus_num_fdt(parent);
> + if (p->bus < 0) {
> + debug("%s: Cannot find I2C bus\n", __func__);
> + return -1;
> + }
> + p->hw.i2c.addr = fdtdec_get_int(blob, node, "reg", 9);
> +
> + p->name = pmic_name;
> + p->interface = PMIC_I2C;
> + p->hw.i2c.tx_num = 1;
> + p->number_of_regs = number_of_regs;
> + p->compat_id = pmic_compat;
> +
> + ret = 0;

ret = 0; unnecessary.

> + while (pmic_ops->reg_op != PMIC_REG_BAIL) {
> + if (pmic_ops->reg_op == PMIC_REG_WRITE)
> + ret = pmic_reg_write(p,
> +  pmic_ops->reg_addr,
> +  pmic_ops->reg_value);
> + else
> + ret = pmic_reg_update(p,
> +  pmic_ops->reg_addr,
> +  pmic_ops->reg_value);
> + if (ret) {
> + printf("%s: Failed accessing reg 0x%x of %s\n",
> +__func__, pmic_ops->reg_addr, p->name);
> + return ret;
> + }
> + pmic_ops++;
> + }
> +
> + printf("PMIC %s initialized\n", p->name);
> + return ret;
> +}
> diff --git a/drivers/power/power_core.c b/drivers/power/power_core.c
> index a1c4fd0..f40be31 100644
> --- a/drivers/power/power_core.c
> +++ b/drivers/power/power_core.c
> @@ -228,6 +228,20 @@ int pmic_reg_update(struct pmic *p, int reg, u32 val)
>   return 0;
>  }
>  
> +struct pmic *pmic_get_by_id(enum fdt_compat_id pmic_compat)

Seems to did not use anywhere.

> +{
> + struct pmic *p;
> +
> + list_for_each_entry(p, &pmic_list, list) {
> + if (p->compat_id == pmic_compat) {
> + debug("%s: pmic %s -> 0x%p\n", __func__, p->name, p);
> + return p;
> + }
> + }
> +
> + return NULL;
> +}
> +
>  U_BOOT_CMD(
>   pmic,   CONFIG_SYS_MAXARGS, 1, do_pmic,
>   "PMIC",

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


[U-Boot] [PATCH v4 3/9] kmp204x: I2C deblocking support

2014-02-02 Thread Valentin Longchamp
From: Rainer Boschung 

This patch adds support for using some GPIOs that are connected to the
I2C bus to force the bus lines state and perform some bus deblocking
sequences.

The KM common deblocking algorithm from board/keymile/common/common.c is
used. The GPIO lines used for deblocking the I2C bus are some external
GPIOs provided by the QRIO CPLD:
  - SCL = GPIOA_20
  - SDA = GPIOA_21

The QRIO GPIOs act in an open-drain-like manner, for 0 the line is
driven low and for 1 the GPIO is set as input and the line gets
pulled-up.

Signed-off-by: Rainer Boschung 
Signed-off-by: Valentin Longchamp 

---

Changes in v4:
- fix usage of the #define names that got wrong in the merge process

Changes in v3:
- rewrite the commit message and and the comments for more clarity
- fix the GPIO numbers that where not correct

Changes in v2: None

 board/keymile/kmp204x/kmp204x.c | 53 ++---
 include/configs/km/kmp204x-common.h | 10 +++
 2 files changed, 60 insertions(+), 3 deletions(-)

diff --git a/board/keymile/kmp204x/kmp204x.c b/board/keymile/kmp204x/kmp204x.c
index bbb2453..a6c23a2 100644
--- a/board/keymile/kmp204x/kmp204x.c
+++ b/board/keymile/kmp204x/kmp204x.c
@@ -33,12 +33,51 @@ int checkboard(void)
return 0;
 }
 
-/* TODO: implement the I2C deblocking function */
-int i2c_make_abort(void)
+/* I2C deblocking uses the algorithm defined in board/keymile/common/common.c
+ * 2 dedicated QRIO GPIOs externally pull the SCL and SDA lines
+ * For I2C only the low state is activly driven and high state is pulled-up
+ * by a resistor. Therefore the deblock GPIOs are used
+ *  -> as an active output to drive a low state
+ *  -> as an open-drain input to have a pulled-up high state
+ */
+
+/* QRIO GPIOs used for deblocking */
+#define DEBLOCK_PORT1  GPIO_A
+#define DEBLOCK_SCL1   20
+#define DEBLOCK_SDA1   21
+
+/* By default deblock GPIOs are floating */
+static void i2c_deblock_gpio_cfg(void)
+{
+   /* set I2C bus 1 deblocking GPIOs input, but 0 value for open drain */
+   qrio_gpio_direction_input(DEBLOCK_PORT1, DEBLOCK_SCL1);
+   qrio_gpio_direction_input(DEBLOCK_PORT1, DEBLOCK_SDA1);
+
+   qrio_set_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1, 0);
+   qrio_set_gpio(DEBLOCK_PORT1, DEBLOCK_SDA1, 0);
+}
+
+void set_sda(int state)
+{
+   qrio_set_opendrain_gpio(DEBLOCK_PORT1, DEBLOCK_SDA1, state);
+}
+
+void set_scl(int state)
+{
+   qrio_set_opendrain_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1, state);
+}
+
+int get_sda(void)
+{
+   return qrio_get_gpio(DEBLOCK_PORT1, DEBLOCK_SDA1);
+}
+
+int get_scl(void)
 {
-   return 1;
+   return qrio_get_gpio(DEBLOCK_PORT1, DEBLOCK_SCL1);
 }
 
+
 #define ZL30158_RST8
 #define ZL30343_RST9
 
@@ -77,6 +116,14 @@ unsigned long get_board_sys_clk(unsigned long dummy)
return ;
 }
 
+int misc_init_f(void)
+{
+   /* configure QRIO pis for i2c deblocking */
+   i2c_deblock_gpio_cfg();
+
+   return 0;
+}
+
 #define NUM_SRDS_BANKS 2
 #define PHY_RST15
 
diff --git a/include/configs/km/kmp204x-common.h 
b/include/configs/km/kmp204x-common.h
index e33ac90..626879a 100644
--- a/include/configs/km/kmp204x-common.h
+++ b/include/configs/km/kmp204x-common.h
@@ -211,6 +211,7 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 
 #define CONFIG_BOARD_EARLY_INIT_F
 #define CONFIG_BOARD_EARLY_INIT_R  /* call board_early_init_r function */
+#define CONFIG_MISC_INIT_F
 #define CONFIG_MISC_INIT_R
 #define CONFIG_LAST_STAGE_INIT
 
@@ -266,7 +267,10 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_FIT_VERBOSE /* enable fit_format_{error,warning}() */
 
 /* I2C */
+
 #define CONFIG_SYS_I2C
+#define CONFIG_SYS_I2C_INIT_BOARD
+#define CONFIG_SYS_I2C_SPEED   10 /* deblocking */
 #define CONFIG_SYS_NUM_I2C_BUSES   3
 #define CONFIG_SYS_I2C_MAX_HOPS1
 #define CONFIG_SYS_I2C_FSL /* Use FSL I2C driver */
@@ -279,6 +283,12 @@ unsigned long get_board_sys_clk(unsigned long dummy);
{0, {{I2C_MUX_PCA9547, 0x70, 1 } } }, \
{0, {{I2C_MUX_PCA9547, 0x70, 2 } } }, \
}
+#ifndef __ASSEMBLY__
+void set_sda(int state);
+void set_scl(int state);
+int get_sda(void);
+int get_scl(void);
+#endif
 
 #define CONFIG_KM_IVM_BUS  1   /* I2C1 (Mux-Port 1)*/
 
-- 
1.8.0.1

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


[U-Boot] [PATCH] sandbox: Enable CONFIG_CMD_LZMADEC in sandbox.h

2014-02-02 Thread Patrice B
Hello,

 As Simon Glass requested it, here's a patch that enables
CONFIG_CMD_LZMADEC in sandbox.

  Regards.

 Patrice

Signed-off-by: Patrice Bouchand 

---
 include/configs/sandbox.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index a6d5582..c995882 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -131,4 +131,6 @@

 #define CONFIG_TPM_TIS_SANDBOX

+#define CONFIG_CMD_LZMADEC
+
 #endif
--
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot