Re: [U-Boot] [PATCH 2/5] usb: s3c-otg: Encapsulate PHY control

2014-11-04 Thread Pavel Machek
On Tue 2014-11-04 06:07:31, Marek Vasut wrote:
 Encapsulate the Samsung PHY control and it's register accesses

its

 into the otg_phy_init() and otg_phy_off() functions.
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Chin Liang See cl...@altera.com
 Cc: Dinh Nguyen dingu...@opensource.altera.com
 Cc: Vince Bridgers vbrid...@altera.com

Acked-by: Pavel Machek pa...@denx.de


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5] usb: s3c-otg: Split out PHY control

2014-11-04 Thread Pavel Machek
On Tue 2014-11-04 06:07:32, Marek Vasut wrote:
 Split the Samsung specific PHY control into a separate file
 and compile this into the S3C OTG driver only if used on a
 Samsung system.
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Chin Liang See cl...@altera.com
 Cc: Dinh Nguyen dingu...@opensource.altera.com
 Cc: Vince Bridgers vbrid...@altera.com

Acked-by: Pavel Machek pa...@denx.de

I know you are just moving the code, but...

 +void otg_phy_init(struct s3c_udc *dev)
 +{
 + unsigned int usb_phy_ctrl = dev-pdata-usb_phy_ctrl;
 + struct s3c_usbotg_phy *phy =
 + (struct s3c_usbotg_phy *)dev-pdata-regs_phy;
 +
 + dev-pdata-phy_control(1);
 +
 + /*USB PHY0 Enable */

Wrong comment style.

 + printf(USB PHY0 Enable\n);
 +
 + /* Enable PHY */
 + writel(readl(usb_phy_ctrl) | USB_PHY_CTRL_EN0, usb_phy_ctrl);

We have helpers for setting/clearing bits, right?


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] usb: s3c-otg: Allow custom gusbcfg

2014-11-04 Thread Pavel Machek
On Tue 2014-11-04 06:07:33, Marek Vasut wrote:
 Allow passing in a custom configuration of the gusbcfg register
 via platform data.
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Chin Liang See cl...@altera.com
 Cc: Dinh Nguyen dingu...@opensource.altera.com
 Cc: Vince Bridgers vbrid...@altera.com

Acked-by: Pavel Machek pa...@denx.de

   debug(Reseting OTG controller\n);
  
 - writel(015/* PHY Low Power Clock sel*/
 + dflt_gusbcfg =
 + 015   /* PHY Low Power Clock sel*/
   |114  /* Non-Periodic TxFIFO Rewind Enable*/
   |0x510/* Turnaround time*/
   |09 | 08/* [0:HNP disable,1:HNP enable][ 0:SRP disable*/
 @@ -413,8 +415,12 @@ static void reconfig_usbd(void)
   |06   /* 0: high speed utmi+, 1: full speed serial*/
   |04   /* 0: utmi+, 1:ulpi*/
   |13   /* phy i/f  0:8bit, 1:16bit*/
 - |0x70,/* HS/FS Timeout**/
 - reg-gusbcfg);
 + |0x70;/* HS/FS Timeout**/
 +

Interesting comment style. And I'd remove 0x prefixes from constants
8...


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] usb:ehci-mx6 add board_ehci_usb_mode function

2014-11-04 Thread Jeroen Hofstee

Hello Peng,

On 04-11-14 14:36, Peng Fan wrote:


Hi Jeroen,

在 11/4/2014 7:40 PM, Jeroen Hofstee 写道:

Hello Peng,

On 04-11-14 08:50, Peng Fan wrote:

Include a weak function board_ehci_usb_mode to gives board code
a choice. If the board want the otg port work in host mode but not
device mode, this should be handled.

Signed-off-by: Peng Fan peng@freescale.com
Signed-off-by: Ye Li b37...@freescale.com
---

Changes v2:
   Introduce a new weak function to let board have a choice to 
decide which mode

   to work at.

   drivers/usb/host/ehci-mx6.c | 7 +++
   1 file changed, 7 insertions(+)

diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 9ec5a0a..3662a80 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -193,6 +193,11 @@ static void usb_oc_config(int index)
   __raw_writel(val, ctrl);
   }

+int __weak board_ehci_usb_mode(int index, enum usb_init_type *type)
+{
+return 0;
+}
+
   int __weak board_ehci_hcd_init(int port)
   {
   return 0;
@@ -223,6 +228,8 @@ int ehci_hcd_init(int index, enum usb_init_type 
init,

   usb_internal_phy_clock_gate(index, 1);
   type = usb_phy_enable(index, ehci) ? USB_INIT_DEVICE : 
USB_INIT_HOST;


+board_ehci_usb_mode(index, type);
+
   *hccr = (struct ehci_hccr *)((uint32_t)ehci-caplength);
   *hcor = (struct ehci_hcor *)((uint32_t)*hccr +
HC_LENGTH(ehci_readl((*hccr)-cr_capbase)));


Can you add a prototype type as well and make sure it is included?
I did not find a good place for the prototype type. I think ehci.h is 
not fine to include this prototype. Any suggestions?


Ah, good point. I have reserved USB as well for the not trivial to
fix warnings. Ideally there should be a header in drivers somewhere
defining what different usb drivers can/should support when dealing with
common usb code and one in include/... for the board interface.

Since this is currently lacking, I am also fine checking it in without a 
valid

prototype and fix it later.

Regards,
Jeroen



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


Re: [U-Boot] Query on the ci_udc driver for USB client implementation

2014-11-04 Thread Sanchayan Maity
On Tuesday 04 November 2014 10:25 AM, Marek Vasut wrote:
 On Monday, November 03, 2014 at 04:46:48 PM, Fabio Estevam wrote:
 On Mon, Nov 3, 2014 at 3:33 AM, Sanchayan Maity

 maitysancha...@gmail.com wrote:
 Hello,

 Any pointers?

 Adding Marek and Stefan on Cc in case they can provide some help.

 Regards,

 Fabio Estevam

 Thanks  Regards,
 Sanchayan Maity.

 On Thursday 30 October 2014 11:14 AM, Sanchayan Maity wrote:
 Hello,

 I am currently implementing USB Host and client support for Freescale
 Vybrid platform in u-boot. I managed to get the host implementation
 working.

 For the host side, usb start calls usb_init(), which in turns call,
 usb_lowlevel_init(), from there into the ehic_hcd_init() of my
 implementation. So, setting up the necessary clocks and plls for USB in
 my implementation and then setting up the usb_ehci, ehci_hccr and
 echi_hcor structures was all. The flow and setup required i was able to
 trace.

 The USB client part is not clear to me. I was thinking i can use the
 ci_udc driver somehow to implement the client part. How can i use the
 ci_udc driver to implement client functionality?. From what i could
 see, the usb_gadget_driver_register() is suppose to be the first call.
 But, i couldn't trace from where this gets called or the flow and setup
 is suppose to be. OR Is a separate client driver required and nothing
 generic can be used akin to how it could be done for host?
 
 See include/configs/sansa_fuze_plus.h , you need the gadget driver for the
 function you want to implement , in this case it's ethernet for example
 (selected via CONFIG_USB_ETH_CDC ).
 
 An example of DFU/UMS can be found in include/configs/exynos4-common.h
 and to activate those, you need to use the 'dfu' or 'ums' commands.

Thank you Marek. I had enabled usb ether options already and was trying to test
USB client functionality with RNDIS. For some reason it was not working and i 
was
not able to trace the issue and subsequently was not sure about the client 
part. 
Your inputs cleared my doubts. I tried UMS and DFU. UMS is working just fine 
and 
i can download the respective images through DFU. Though this DFU is not working
full proof, but, i can figure that out now i feel. 

Thanks again for your inputs. Cheers!

Best Regards,
Sanchayan.

 
 Sorry if i am asking this question in the wrong place. I couldn't find
 anyone in the u-boot IRC channel nor find something similar to the
 kernel-newbies mailing list.
 
 There isn't any, so ask away ;-)
 
 Hope i am asking the right questions.
 [...]
 
 Best regards,
 Marek Vasut
 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 3/6] include: move various macros to include/linux/kernel.h

2014-11-04 Thread Masahiro Yamada
U-Boot has imported various utility macros from Linux
scattering them to various places without consistency.

In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN,
container_of, DIV_ROUND_UP, etc.
In include/linux/compat.h are min_t, max_t, round_up, round_down,
etc.
We also have duplicated defines of min_t in some *.c files.

Moreover, we are suffering from too cluttered include/common.h.

This commit moves various macros that originate in
include/linux/kernel.h of Linux to their original position.

Note:
This commit simply moves the macros; roundup, min, max, min2, max3,
ARRAY_SIZE are different from those of Linux at this point.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 arch/arm/cpu/armv7/bcm281xx/clk-core.h|   4 -
 arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c |   2 -
 arch/powerpc/cpu/mpc5xxx/usb_ohci.c   |   2 -
 arch/powerpc/cpu/ppc4xx/usb_ohci.c|   2 -
 drivers/usb/host/isp116x-hcd.c|   6 --
 drivers/usb/host/ohci-hcd.c   |   3 -
 drivers/usb/host/ohci-s3c24xx.c   |   3 -
 drivers/usb/host/r8a66597-hcd.c   |   3 -
 drivers/usb/musb/musb_hcd.h   |   3 -
 drivers/video/ati_radeon_fb.c |   5 -
 fs/ubifs/ubifs.h  |   4 -
 include/common.h  |  87 +---
 include/linux/compat.h|  42 
 include/linux/kernel.h| 145 ++
 lib/vsprintf.c|   3 -
 15 files changed, 146 insertions(+), 168 deletions(-)
 create mode 100644 include/linux/kernel.h

diff --git a/arch/arm/cpu/armv7/bcm281xx/clk-core.h 
b/arch/arm/cpu/armv7/bcm281xx/clk-core.h
index 882a297..4a694d7 100644
--- a/arch/arm/cpu/armv7/bcm281xx/clk-core.h
+++ b/arch/arm/cpu/armv7/bcm281xx/clk-core.h
@@ -73,10 +73,6 @@ struct clk {
 
 struct refclk *refclk_str_to_clk(const char *name);
 
-#define U8_MAX ((u8)~0U)
-#define U32_MAX((u32)~0U)
-#define U64_MAX((u64)~0U)
-
 /* The common clock framework uses u8 to represent a parent index */
 #define PARENT_COUNT_MAX   ((u32)U8_MAX)
 
diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c 
b/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c
index a3dac70..74bdb77 100644
--- a/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c
+++ b/arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c
@@ -54,8 +54,6 @@
 #define readl(a) au_readl((long)(a))
 #define writel(v,a)  au_writel((v),(int)(a))
 
-#define min_t(type,x,y) ({ type __x = (x); type __y = (y); __x  __y ? __x: 
__y; })
-
 #define DEBUG
 #ifdef DEBUG
 #define dbg(format, arg...) printf(DEBUG:  format \n, ## arg)
diff --git a/arch/powerpc/cpu/mpc5xxx/usb_ohci.c 
b/arch/powerpc/cpu/mpc5xxx/usb_ohci.c
index 3c8b2d9..b7c1b55 100644
--- a/arch/powerpc/cpu/mpc5xxx/usb_ohci.c
+++ b/arch/powerpc/cpu/mpc5xxx/usb_ohci.c
@@ -42,8 +42,6 @@
 #define readl(a) (*((volatile u32 *)(a)))
 #define writel(a, b) (*((volatile u32 *)(b)) = ((volatile u32)a))
 
-#define min_t(type,x,y) ({ type __x = (x); type __y = (y); __x  __y ? __x: 
__y; })
-
 #ifdef DEBUG
 #define dbg(format, arg...) printf(DEBUG:  format \n, ## arg)
 #else
diff --git a/arch/powerpc/cpu/ppc4xx/usb_ohci.c 
b/arch/powerpc/cpu/ppc4xx/usb_ohci.c
index d1e78f6..65a0675 100644
--- a/arch/powerpc/cpu/ppc4xx/usb_ohci.c
+++ b/arch/powerpc/cpu/ppc4xx/usb_ohci.c
@@ -40,8 +40,6 @@
 #define readl(a) (*((volatile u32 *)(a)))
 #define writel(a, b) (*((volatile u32 *)(b)) = ((volatile u32)a))
 
-#define min_t(type,x,y) ({ type __x = (x); type __y = (y); __x  __y ? __x: 
__y; })
-
 #ifdef DEBUG
 #define dbg(format, arg...) printf(DEBUG:  format \n, ## arg)
 #else
diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
index 46e4cee..0556f32 100644
--- a/drivers/usb/host/isp116x-hcd.c
+++ b/drivers/usb/host/isp116x-hcd.c
@@ -103,12 +103,6 @@ static int rh_devnum;  /* address of Root Hub 
endpoint */
 
 /* - */
 
-#define ALIGN(x,a) (((x)+(a)-1UL)~((a)-1UL))
-#define min_t(type,x,y)\
-   ({ type __x = (x); type __y = (y); __x  __y ? __x : __y; })
-
-/* - */
-
 static int isp116x_reset(struct isp116x *isp116x);
 
 /* --- Debugging functions - */
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index dc0a4e3..9bb1d48 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -65,9 +65,6 @@
 #define OHCI_CONTROL_INIT \
(OHCI_CTRL_CBSR  0x3) | OHCI_CTRL_IE | OHCI_CTRL_PLE
 
-#define min_t(type, x, y) \
-   ({ type __x = (x); type __y = (y); __x  __y ? __x: __y; })
-
 #ifdef CONFIG_PCI_OHCI
 static struct pci_device_id ohci_pci_ids[] = {
{0x10b9, 0x5237},   /* ULI1575 PCI OHCI module ids */
diff 

[U-Boot] [PATCH 0/6] Collect utility macros to include/linux/kernel.h synced with Linux

2014-11-04 Thread Masahiro Yamada
We have imported useful macros from Linux scattering them
to various places.

In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN,
container_of, DIV_ROUND_UP, roundup, etc.
In include/linux/compat.h are min_t, max_t, round_up, round_down,
etc.
We also have duplicated defines of min_t in some *.c files.

I'd like to create include/linux/kernel.h and arrange
sprinkled Linux-originated macros in order.
I believe this work will be helpful when we import more macros
or sync include/linux/kenrel.h in the future.

I confirmed clean output of buildman.

No section: 'make-flags'
boards.cfg is up to date. Nothing to do.
Summary of 7 commits for 1175 boards (8 threads, 1 job per thread)
01: arm: interrupt_init: set sp in IRQ/FIQ modes
 nios2: +   nios2-generic
sh: +   rsk7269 rsk7264 rsk7203
  blackfin: +   bf609-ezkit
   arm: +   maxbcm smdkv310 snow smdk5250 smdk5420 origen odroid 
db-mv784mp-gp s5pc210_universal trats peach-pit arndale trats2
   powerpc: +   TQM834x
02: replace DIV_ROUND with DIV_ROUND_CLOSEST
03: include/common.h: remove DIV_ROUND definition
04: include: move various macros to include/linux/kernel.h
05: linux/kernel.h: import more macros
06: linux/kernel.h: add typechecking to roundup macro
07: linux/kernel.h: sync min, max, min3, max3 macros with Linux



Masahiro Yamada (6):
  replace DIV_ROUND with DIV_ROUND_CLOSEST
  include/common.h: remove DIV_ROUND definition
  include: move various macros to include/linux/kernel.h
  linux/kernel.h: import more macros
  linux/kernel.h: add typechecking to roundup macro
  linux/kernel.h: sync min, max, min3, max3 macros with Linux

 arch/arm/cpu/arm1176/tnetv107x/clock.c|   5 +-
 arch/arm/cpu/arm926ejs/mxs/spl_power_init.c   |   3 +-
 arch/arm/cpu/armv7/bcm281xx/clk-core.h|   4 -
 arch/arm/cpu/armv7/exynos/clock.c |   4 +-
 arch/arm/cpu/armv7/omap-common/abb.c  |   6 +-
 arch/arm/cpu/armv7/tegra20/display.c  |   4 +-
 arch/avr32/cpu/at32ap700x/clk.c   |   2 +-
 arch/blackfin/cpu/jtag-console.c  |   2 +-
 arch/blackfin/lib/string.c|   2 +-
 arch/mips/cpu/mips32/au1x00/au1x00_usb_ohci.c |   2 -
 arch/powerpc/cpu/mpc5xxx/usb_ohci.c   |   2 -
 arch/powerpc/cpu/mpc85xx/tlb.c|   2 +-
 arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c|  32 ++--
 arch/powerpc/cpu/ppc4xx/usb_ohci.c|   2 -
 arch/powerpc/lib/bootm.c  |   2 +-
 arch/sandbox/cpu/start.c  |   2 +-
 arch/x86/cpu/coreboot/pci.c   |   2 +-
 arch/x86/cpu/coreboot/sdram.c |   2 +-
 board/freescale/common/sys_eeprom.c   |   6 +-
 board/gdsys/p1022/controlcenterd-id.c |   5 +-
 board/imgtec/malta/malta.c|   2 +-
 common/cmd_elf.c  |  12 +-
 common/cmd_sf.c   |  16 +-
 common/env_nand.c |   4 +-
 common/fdt_support.c  |   3 +-
 common/lcd.c  |   6 +-
 common/usb_hub.c  |   3 +-
 drivers/block/ahci.c  |   2 +-
 drivers/ddr/fsl/ctrl_regs.c   |  22 +--
 drivers/ddr/fsl/lc_common_dimm_params.c   |  62 ---
 drivers/ddr/fsl/main.c|   3 +-
 drivers/dfu/dfu.c |   2 +-
 drivers/i2c/fsl_i2c.c |   2 +-
 drivers/misc/cros_ec_spi.c|   2 +-
 drivers/misc/mxc_ocotp.c  |   4 +-
 drivers/mmc/fsl_esdhc.c   |   2 +-
 drivers/mmc/pxa_mmc_gen.c |   6 +-
 drivers/mtd/nand/denali_spl.c |   2 +-
 drivers/mtd/spi/sandbox.c |   2 +-
 drivers/mtd/spi/sf_ops.c  |   5 +-
 drivers/net/netconsole.c  |   2 +-
 drivers/pci/pci.c |   6 +-
 drivers/pci/pci_auto.c|   2 +-
 drivers/serial/usbtty.c   |   2 +-
 drivers/spi/fsl_espi.c|   4 +-
 drivers/spi/mxc_spi.c |   2 +-
 drivers/spi/spi-uclass.c  |   2 +-
 drivers/tpm/tpm_tis_lpc.c |   2 +-
 drivers/usb/gadget/composite.c|   4 +-
 drivers/usb/gadget/designware_udc.c   |   4 +-
 drivers/usb/gadget/pxa27x_udc.c   |   3 +-
 drivers/usb/gadget/s3c_udc_otg_xfer_dma.c |   4 +-
 drivers/usb/host/dwc2.c   |  14 +-
 drivers/usb/host/ehci-hcd.c   |   2 +-
 drivers/usb/host/isp116x-hcd.c|   6 -
 drivers/usb/host/ohci-hcd.c   |   3 -
 drivers/usb/host/ohci-s3c24xx.c   |   3 -
 drivers/usb/host/r8a66597-hcd.c   |   3 -
 drivers/usb/host/xhci-ring.c  |   2 +-
 drivers/usb/host/xhci.c   |   2 +-
 

[U-Boot] mkimage and load addresses beyond 4 Gb

2014-11-04 Thread John Jacques
At present, the load address and entry point are both unsigned int.  I'm
porting to aarch64, and will run the SPL at 0x803100.  mkimage
truncates this to 0x3100.  Are there any plans to support a load
address and entry point larger than 32 bits?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 6/6] linux/kernel.h: sync min, max, min3, max3 macros with Linux

2014-11-04 Thread Masahiro Yamada
U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does.  This commit gets min, max, min3, max3
macros synced with the kernel introduing type checks.

Many of references of those macros must be fixed to suppress warnings.
We have two options:
 - Use min, max, min3, max3 only when the arguments have the same type
   (or add casts to the arguments)
 - Use min_t/max_t instead with the appropriate type for the first
   argument

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 arch/arm/cpu/arm1176/tnetv107x/clock.c|  5 ++-
 arch/arm/cpu/armv7/exynos/clock.c |  4 +-
 arch/arm/cpu/armv7/tegra20/display.c  |  4 +-
 arch/avr32/cpu/at32ap700x/clk.c   |  2 +-
 arch/blackfin/cpu/jtag-console.c  |  2 +-
 arch/blackfin/lib/string.c|  2 +-
 arch/powerpc/cpu/mpc85xx/tlb.c|  2 +-
 arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c| 32 ++--
 arch/powerpc/lib/bootm.c  |  2 +-
 arch/sandbox/cpu/start.c  |  2 +-
 arch/x86/cpu/coreboot/pci.c   |  2 +-
 arch/x86/cpu/coreboot/sdram.c |  2 +-
 board/freescale/common/sys_eeprom.c   |  6 +--
 board/gdsys/p1022/controlcenterd-id.c |  5 ++-
 board/imgtec/malta/malta.c|  2 +-
 common/cmd_elf.c  | 12 +++---
 common/cmd_sf.c   | 16 
 common/env_nand.c |  4 +-
 common/fdt_support.c  |  3 +-
 common/lcd.c  |  6 +--
 common/usb_hub.c  |  3 +-
 drivers/block/ahci.c  |  2 +-
 drivers/ddr/fsl/ctrl_regs.c   | 22 +--
 drivers/ddr/fsl/lc_common_dimm_params.c   | 62 ++-
 drivers/ddr/fsl/main.c|  3 +-
 drivers/dfu/dfu.c |  2 +-
 drivers/i2c/fsl_i2c.c |  2 +-
 drivers/misc/cros_ec_spi.c|  2 +-
 drivers/mmc/fsl_esdhc.c   |  2 +-
 drivers/mmc/pxa_mmc_gen.c |  6 +--
 drivers/mtd/nand/denali_spl.c |  2 +-
 drivers/mtd/spi/sandbox.c |  2 +-
 drivers/mtd/spi/sf_ops.c  |  5 ++-
 drivers/net/netconsole.c  |  2 +-
 drivers/pci/pci.c |  6 ++-
 drivers/pci/pci_auto.c|  2 +-
 drivers/serial/usbtty.c   |  2 +-
 drivers/spi/fsl_espi.c|  4 +-
 drivers/spi/mxc_spi.c |  2 +-
 drivers/spi/spi-uclass.c  |  2 +-
 drivers/tpm/tpm_tis_lpc.c |  2 +-
 drivers/usb/gadget/composite.c|  4 +-
 drivers/usb/gadget/designware_udc.c   |  4 +-
 drivers/usb/gadget/pxa27x_udc.c   |  3 +-
 drivers/usb/gadget/s3c_udc_otg_xfer_dma.c |  4 +-
 drivers/usb/host/dwc2.c   | 14 +++
 drivers/usb/host/ehci-hcd.c   |  2 +-
 drivers/usb/host/xhci-ring.c  |  2 +-
 drivers/usb/host/xhci.c   |  2 +-
 drivers/video/cfb_console.c   | 18 -
 fs/ext4/dev.c | 13 +++
 fs/fat/fat.c  |  2 +-
 include/linux/kernel.h| 17 ++---
 53 files changed, 179 insertions(+), 158 deletions(-)

diff --git a/arch/arm/cpu/arm1176/tnetv107x/clock.c 
b/arch/arm/cpu/arm1176/tnetv107x/clock.c
index 47c23bb..ecff24d 100644
--- a/arch/arm/cpu/arm1176/tnetv107x/clock.c
+++ b/arch/arm/cpu/arm1176/tnetv107x/clock.c
@@ -362,12 +362,13 @@ static void init_pll(const struct pll_init_data *data)
pllctl_reg_write(data-pll, ctl, tmp);
 
mult = data-pll_freq / fpll;
-   for (mult = max(mult, 1); mult = MAX_MULT; mult++) {
+   for (mult = max(mult, 1UL); mult = MAX_MULT; mult++) {
div = (fpll * mult) / data-pll_freq;
if (div  1 || div  MAX_DIV)
continue;
 
-   for (postdiv = 1; postdiv = min(div, MAX_POSTDIV); postdiv++) {
+   for (postdiv = 1; postdiv = min(div, (unsigned 
long)MAX_POSTDIV);
+   postdiv++) {
prediv = div / postdiv;
if (prediv  1 || prediv  MAX_PREDIV)
continue;
diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index 7558eff..c0c95fb 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -1422,8 +1422,8 @@ static int clock_calc_best_scalar(unsigned int 
main_scaler_bits,
return 1;
 
for (i = 1; i = loops; i++) {
-   const unsigned int effective_div = max(min(input_rate / i /
-   target_rate, cap), 1);
+   const unsigned int effective_div =
+   

Re: [U-Boot] [PATCH 5/5] arm: socfpga: Add example UDC config

2014-11-04 Thread Pavel Machek
Hi!

 Add example of an USB UDC configuration with DFU and UMS.
 
 Signed-off-by: Marek Vasut ma...@denx.de
 Cc: Chin Liang See cl...@altera.com
 Cc: Dinh Nguyen dingu...@opensource.altera.com
 Cc: Vince Bridgers vbrid...@altera.com
 Cc: Pavel Machek pa...@denx.de
 Cc: Stefan Roese s...@denx.de
 Cc: Lukasz Majewski l.majew...@samsung.com

 +/* USB IDs */
 +#define CONFIG_G_DNL_VENDOR_NUM  0x0525  /* NetChip */
 +#define CONFIG_G_DNL_PRODUCT_NUM 0xA4A5  /* Linux-USB File-backed 
 Storage Gadget */


Will not this make NetChip rather angry?

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PULL] u-boot-usb/master

2014-11-04 Thread Tom Rini
On Tue, Nov 04, 2014 at 06:09:00AM +0100, Marek Vasut wrote:

 The following changes since commit 46b7b2e8025770fb29f7810c2d7d15a6650b9643:
 
   Merge branch 'master' of git://git.denx.de/u-boot-mips (2014-11-03 12:46:12 
 -0500)
 
 are available in the git repository at:
 
 
   git://git.denx.de/u-boot-usb.git master
 
 for you to fetch changes up to 4dc949266da6f55ef221e53c637150252b6ac35a:
 
   usb: ehci: rmobile: Collect up address data (2014-11-04 06:04:01 +0100)
 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] please pull u-boot-samsung master

2014-11-04 Thread Tom Rini
On Tue, Nov 04, 2014 at 07:57:33PM +0900, Minkyu Kang wrote:

 Dear Tom,
 
 The following changes since commit 571bdf16a78e9e116a93d46f4809c4f8a3f2adb6:
 
   arm: interrupt_init: set sp in IRQ/FIQ modes (2014-10-29 09:03:28 -0400)
 
 are available in the git repository at:
 
   http://git.denx.de/u-boot-samsung 
 
 for you to fetch changes up to 4aa97312f7147b68b8b7c731d7bb01cff8dda2d6:
 
   odroid: adjust gpio calls to dm gpio api (2014-10-30 19:56:16 +0900)
 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] Pull request: u-boot-staging

2014-11-04 Thread Tom Rini
On Fri, Oct 31, 2014 at 01:02:52AM +0100, Anatolij Gustschin wrote:

 Hey Tom,
 
 The following changes since commit 571bdf16a78e9e116a93d46f4809c4f8a3f2adb6:
 
   arm: interrupt_init: set sp in IRQ/FIQ modes (2014-10-29 09:03:28 -0400)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-staging.git ag...@denx.de
 
 for you to fetch changes up to 548b310c68ac99a0330d8b56c797c09ff0742d1e:
 
   Remove the CREDITS file (2014-10-31 00:50:51 +0100)
 

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 6/6] linux/kernel.h: sync min, max, min3, max3 macros with Linux

2014-11-04 Thread Pavel Machek
On Tue 2014-11-04 20:26:26, Masahiro Yamada wrote:
 U-Boot has never cared about the type when we get max/min of two
 values, but Linux Kernel does.  This commit gets min, max, min3, max3
 macros synced with the kernel introduing type checks.

introducing

 Many of references of those macros must be fixed to suppress warnings.
 We have two options:
  - Use min, max, min3, max3 only when the arguments have the same type
(or add casts to the arguments)
  - Use min_t/max_t instead with the appropriate type for the first
argument
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com

Acked-by: Pavel Machek pa...@denx.de

[I guess the conversion is okay, as is, still, there are places where
code could be cleaned up afterwards...]

 - for (postdiv = 1; postdiv = min(div, MAX_POSTDIV); postdiv++) {
 + for (postdiv = 1; postdiv = min(div, (unsigned 
 long)MAX_POSTDIV);
 + postdiv++) {

It might be cleaner to change MAX_POSTDIV definition to include UL?


 @@ -1838,12 +1838,18 @@ static void program_tr(unsigned long *dimm_populated,
   else
   sdram_ddr1 = false;
  
 - t_rcd_ns = max(t_rcd_ns, 
 spd_read(iic0_dimm_addr[dimm_num], 29)  2);
 - t_rrd_ns = max(t_rrd_ns, 
 spd_read(iic0_dimm_addr[dimm_num], 28)  2);
 - t_rp_ns  = max(t_rp_ns,  
 spd_read(iic0_dimm_addr[dimm_num], 27)  2);
 - t_ras_ns = max(t_ras_ns, 
 spd_read(iic0_dimm_addr[dimm_num], 30));
 - t_rc_ns  = max(t_rc_ns,  
 spd_read(iic0_dimm_addr[dimm_num], 41));
 - t_rfc_ns = max(t_rfc_ns, 
 spd_read(iic0_dimm_addr[dimm_num], 42));
 + t_rcd_ns = max(t_rcd_ns,
 +(unsigned 
 long)spd_read(iic0_dimm_addr[dimm_num], 29)  2);
 + t_rrd_ns = max(t_rrd_ns,
 +(unsigned 
 long)spd_read(iic0_dimm_addr[dimm_num], 28)  2);
 + t_rp_ns  = max(t_rp_ns,
 +(unsigned 
 long)spd_read(iic0_dimm_addr[dimm_num], 27)  2);
 + t_ras_ns = max(t_ras_ns,
 +(unsigned 
 long)spd_read(iic0_dimm_addr[dimm_num], 30));
 + t_rc_ns  = max(t_rc_ns,
 +(unsigned 
 long)spd_read(iic0_dimm_addr[dimm_num], 41));
 + t_rfc_ns = max(t_rfc_ns,
 +(unsigned 
 long)spd_read(iic0_dimm_addr[dimm_num], 42));
   }
   }

Would it be feasible to make spd_read return unsigned long?

 diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
 index b3d7051..b7e12ab 100644
 --- a/arch/sandbox/cpu/start.c
 +++ b/arch/sandbox/cpu/start.c
 @@ -38,7 +38,7 @@ int sandbox_early_getopt_check(void)
  
   max_arg_len = 0;
   for (i = 0; i  num_options; ++i)
 - max_arg_len = max(strlen(sb_opt[i]-flag), max_arg_len);
 + max_arg_len = max((int)strlen(sb_opt[i]-flag), max_arg_len);
   max_noarg_len = max_arg_len + 7;
  
   for (i = 0; i  num_options; ++i) {

make max_arg_len size_t?

 diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
 index 623f749..677c89f 100644
 --- a/drivers/net/netconsole.c
 +++ b/drivers/net/netconsole.c
 @@ -256,7 +256,7 @@ static void nc_puts(struct stdio_dev *dev, const char *s)
  
   len = strlen(s);
   while (len) {
 - int send_len = min(len, sizeof(input_buffer));
 + int send_len = min(len, (int)sizeof(input_buffer));
   nc_send_packet(s, send_len);
   len -= send_len;
   s += send_len;

Looks like len/send_len wants to be size_t here.

Actually, I'd argue that anytime you need to explicitly cast one
argument would be good time to use _t variant... but that would mean
redoing rather big patch.

min((int) a, b) - min_t(int, a, b).

Thanks,
Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/3] usb:ehci-mx6 add board_ehci_usb_mode function

2014-11-04 Thread Marek Vasut
On Tuesday, November 04, 2014 at 02:29:56 PM, Peng Fan wrote:
 Hi Marek,
 
 在 11/4/2014 7:01 PM, Marek Vasut 写道:
  On Tuesday, November 04, 2014 at 11:50:29 AM, Peng Fan wrote:
  在 11/4/2014 6:33 PM, Marek Vasut 写道:
  On Tuesday, November 04, 2014 at 08:50:00 AM, Peng Fan wrote:
  Include a weak function board_ehci_usb_mode to gives board code
  a choice.
  
  What choice?
  
  If the board want the otg port work in host mode but not
  device mode, this should be handled.
  
  How?
  
  Also, isn't usb_phy_enable() supposed to do exactly this kind of
  selection between device and host mode ?
  
  In mx6sxsabresd board, there are two usb port, one used for otg, the
  other used for host. However they are connected to SOC USB controller
  otg1 core and otg2 core respectively. Like following:
  
  OTG1 CORE  board otg port
  OTG2 CORE  board host port
  
  However the board do not have ID pin set for board host port. If just
  use usb_phy_enable, the board host port will not work, because
  type = usb_phy_enable(index, ehci) ? USB_INIT_DEVICE : USB_INIT_HOST;
  will always set type with USB_INIT_DEVICE.
  
  Because i did not find way to handle this situation in
  board/freescale/mx6sxsabresd/mx6sxsabresd.c, add this function to let
  board level code handle handle 'type', if board level code want to set
  it's own 'type'.
  
  This part in usb_phy_enable()
  
  163 return val  USBPHY_CTRL_OTG_ID;
  
  should be replaced by some kind of a board-specific callback then, with
  default implmentation being the above (reading the phy ctrl register).
 
 How about using the following piece of code?
 in ehci-mx6.c
 
 unsigned int __weak board_usb_phy_mode(int index, unsigned int val)
 {
   return val  USBPHY_CTRL_OTG_ID;
 }
 
 replace return val  USBPHY_CTRL_OTG_ID; using 
 return board_usb_phy_mode(index, val);
 
 In board file,
 unsigned int board_usb_phy_mode(int index, unsigned int val)

Why not pass in full struct usb_ehci * instead ? Passing some ad-hoc $val into
the function doesn't seem like a scalable future-proof solution.
[...]
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 5/5] arm: socfpga: Add example UDC config

2014-11-04 Thread Marek Vasut
On Tuesday, November 04, 2014 at 08:51:57 PM, Pavel Machek wrote:
 Hi!
 
  Add example of an USB UDC configuration with DFU and UMS.
  
  Signed-off-by: Marek Vasut ma...@denx.de
  Cc: Chin Liang See cl...@altera.com
  Cc: Dinh Nguyen dingu...@opensource.altera.com
  Cc: Vince Bridgers vbrid...@altera.com
  Cc: Pavel Machek pa...@denx.de
  Cc: Stefan Roese s...@denx.de
  Cc: Lukasz Majewski l.majew...@samsung.com
  
  +/* USB IDs */
  +#define CONFIG_G_DNL_VENDOR_NUM0x0525  /* NetChip */
  +#define CONFIG_G_DNL_PRODUCT_NUM   0xA4A5  /* Linux-USB File-backed Storage
  Gadget */
 
 Will not this make NetChip rather angry?

You mean that netchip which reserved this ID especially for free use ? No.

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


Re: [U-Boot] [PATCH v3 1/3] mtd, spi: add MTD layer driver

2014-11-04 Thread Jagan Teki
On 5 September 2014 11:08, Heiko Schocher h...@denx.de wrote:
 From: Daniel Schwierzeck daniel.schwierz...@gmail.com

 add MTD layer driver for spi, original patch from:
 http://git.denx.de/?p=u-boot/u-boot-mips.git;a=commitdiff;h=bb246819cdc90493dd7089eaa51b9e639765cced

 changes from Heiko Schocher against this patch:
 - remove compile error if not defining CONFIG_SPI_FLASH_MTD:

   LD  drivers/mtd/spi/built-in.o
 drivers/mtd/spi/sf_probe.o: In function `spi_flash_mtd_unregister':
 /home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: multiple 
 definition of `spi_flash_mtd_unregister'
 drivers/mtd/spi/sf_params.o:/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168:
  first defined here
 drivers/mtd/spi/sf_ops.o: In function `spi_flash_mtd_unregister':
 /home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: multiple 
 definition of `spi_flash_mtd_unregister'
 drivers/mtd/spi/sf_params.o:/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168:
  first defined here
 make[1]: *** [drivers/mtd/spi/built-in.o] Fehler 1
 make: *** [drivers/mtd/spi] Fehler 2

 - add a README entry.
 - add correct writebufsize, to fit with Linux v3.14
   MTD, UBI/UBIFS sync.

 Signed-off-by: Daniel Schwierzeck daniel.schwierz...@gmail.com
 Signed-off-by: Heiko Schocher h...@denx.de
 Cc: Jagannadha Sutradharudu Teki jagannadh.t...@gmail.com

 ---
 MAKEALL for ar, mips, powerc compiles clean

 - changes for v2:
   - add comment from Daniel Schwierzeck:
 fix compile error from original patch with
 static inline rather than static __maybe_unused
 - changes for v3:
   rebase with d6c1ffc7d23f4fe4ae8c91101861055b8e1501b6
 ---
  README|   3 ++
  common/cmd_sf.c   |   9 ++--
  drivers/mtd/spi/Makefile  |   1 +
  drivers/mtd/spi/sf_internal.h |  13 ++
  drivers/mtd/spi/sf_mtd.c  | 104 
 ++
  drivers/mtd/spi/sf_probe.c|   5 ++
  6 files changed, 131 insertions(+), 4 deletions(-)
  create mode 100644 drivers/mtd/spi/sf_mtd.c

 diff --git a/README b/README
 index 0a0f528..e7be54e 100644
 --- a/README
 +++ b/README
 @@ -2965,6 +2965,9 @@ CBFS (Coreboot Filesystem) support
 operation will not execute. The only way to exit this
 hardware-protected mode is to drive W#/VPP HIGH.

 +   CONFIG_SPI_FLASH_MTD
 +   add  MTD translation layer driver.
 +
  - SystemACE Support:
 CONFIG_SYSTEMACE

 diff --git a/common/cmd_sf.c b/common/cmd_sf.c
 index b4ceb71..7653d7e 100644
 --- a/common/cmd_sf.c
 +++ b/common/cmd_sf.c
 @@ -121,16 +121,17 @@ static int do_spi_flash_probe(int argc, char * const 
 argv[])
 return -1;
 }

 +   if (flash)
 +   spi_flash_free(flash);
 +
 new = spi_flash_probe(bus, cs, speed, mode);
 +   flash = new;
 +

Why is this change? I guess it's not related to mtd.
And it's better to add new with global flash only it's probed isn't it?

 if (!new) {
 printf(Failed to initialize SPI flash at %u:%u\n, bus, cs);
 return 1;
 }

 -   if (flash)
 -   spi_flash_free(flash);
 -   flash = new;
 -
 return 0;
  }

 diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
 index 9e18fb4..b15d273 100644
 --- a/drivers/mtd/spi/Makefile
 +++ b/drivers/mtd/spi/Makefile
 @@ -12,6 +12,7 @@ endif

  obj-$(CONFIG_CMD_SF) += sf.o
  obj-$(CONFIG_SPI_FLASH) += sf_params.o sf_probe.o sf_ops.o
 +obj-$(CONFIG_SPI_FLASH_MTD) += sf_mtd.o
  obj-$(CONFIG_SPI_FRAM_RAMTRON) += ramtron.o
  obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o
  obj-$(CONFIG_SPI_M95XXX) += eeprom_m95xxx.o
 diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
 index 19d4914..a9f97d1 100644
 --- a/drivers/mtd/spi/sf_internal.h
 +++ b/drivers/mtd/spi/sf_internal.h
 @@ -160,4 +160,17 @@ int spi_flash_read_common(struct spi_flash *flash, const 
 u8 *cmd,
  int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
 size_t len, void *data);

 +#ifdef CONFIG_SPI_FLASH_MTD
 +int spi_flash_mtd_register(struct spi_flash *flash);
 +void spi_flash_mtd_unregister(void);
 +#else
 +static inline int spi_flash_mtd_register(struct spi_flash *flash)
 +{
 +   return 0;
 +}
 +static inline void spi_flash_mtd_unregister(void)
 +{
 +}
 +#endif
 +
  #endif /* _SF_INTERNAL_H_ */
 diff --git a/drivers/mtd/spi/sf_mtd.c b/drivers/mtd/spi/sf_mtd.c
 new file mode 100644
 index 000..0b9cb62
 --- /dev/null
 +++ b/drivers/mtd/spi/sf_mtd.c
 @@ -0,0 +1,104 @@
 +/*
 + * Copyright (C) 2012-2014 Daniel Schwierzeck, daniel.schwierz...@gmail.com
 + *
 + * SPDX-License-Identifier:GPL-2.0+
 + */
 +
 +#include common.h
 +#include malloc.h
 +#include asm/errno.h
 +#include linux/mtd/mtd.h
 +#include spi_flash.h
 +
 +static struct mtd_info sf_mtd_info;
 +static char sf_mtd_name[8];
 +
 +static int spi_flash_mtd_erase(struct mtd_info *mtd, struct 

Re: [U-Boot] Inconsistency between $filesize and commands which accept numeric params

2014-11-04 Thread Wolfgang Denk
Dear Ian,

In message 1415116135.11486.51.ca...@hellion.org.uk you wrote:

   /*
* Parse the user's input, partially heuristic.  Valid formats:
* 0x00112233 4 05  - an array of cells.  Numbers follow standard
*C conventions.
* [00 11 22 .. nn] - byte stream
* string   - If the the value doesn't start with  or [, it is
*treated as a string.  Note that the quotes are
*stripped by the parser before we get the string.
   
   which is inconsistent with the U-Boot uses hex input base by default
   mantra.
  
  Because this is FDT centric and not U-Boot centric, yes?
 
 I guess?

Well, we probably should not use this FDT centric decoding function
directly on arguments passed from the U-Boot command line.

Since decimal
  numbers is a valid thing to do in an entry here.  I think the right
  answer is the more hacky sounding one of when you script using 'fdt set'
  you need to be mindful of the constraints on input that are imposed upon
  us by FDT.  hex is invalid but 0xhex is what is expected.
 
 The 0x prefix hack/trick is what I'm actually doing, but the maintainer
 of our test system wanted some assurances that u-boot wasn't going to
 change under our feet if someone fixed a bug.

I think this is a hack that is bound to break.  Today you use
$filesize, tomorrow you may find you need to perform some operations
on this (say, rounding up in some way), and you may end up with a
variable that already contains a 0x prefix, and your code will fail
beause 0x0x... gets misinterpreted.

 Sounds like you are saying this is all working as designed, and there is
 no bug, but I'll let Wolfgang and you thrash that out ;-).

Tom: this is a bug ;-)

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The rule on staying alive as a program manager is to give 'em a  num-
ber or give 'em a date, but never give 'em both at once.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/3] mtd, nand: move common functions from cmd_nand.c to common place

2014-11-04 Thread Jagan Teki
Hi Heiko Schocher,

Nice pick -

On 5 September 2014 11:08, Heiko Schocher h...@denx.de wrote:
 move common functions from cmd_nand.c (for calculating offset
 and size from cmdline paramter) to common place, so they could
 used from other commands which use mtd partitions.

 For onenand the arg_off_size() is left in common/cmd_onenand.c.
 It should use now the common arg_off() function, but as I could
 not test onenand I let it there ...

 Signed-off-by: Heiko Schocher h...@denx.de
 Cc: Scott Wood scottw...@freescale.com
 Cc: Tom Rini tr...@ti.com

 ---
 - changes for v2:
   none
 - changes for v3:
   - add comments from scott wood:
 - align MTD_DEV_TYPE_NAND correct
 - remove unnecessary inline
 - rework jffs2 header problem later
   - rebase with d6c1ffc7d23f4fe4ae8c91101861055b8e1501b6
 ---
  common/cmd_nand.c   | 140 
 +---
  common/cmd_onenand.c|  19 +++
  drivers/mtd/Makefile|   4 +-
  drivers/mtd/mtd_uboot.c | 114 +++
  include/linux/mtd/mtd.h |   7 +++
  5 files changed, 154 insertions(+), 130 deletions(-)
  create mode 100644 drivers/mtd/mtd_uboot.c

 diff --git a/common/cmd_nand.c b/common/cmd_nand.c
 index f9ced9d..099ba00 100644
 --- a/common/cmd_nand.c
 +++ b/common/cmd_nand.c
 @@ -133,115 +133,6 @@ static int set_dev(int dev)
 return 0;
  }

 -static inline int str2off(const char *p, loff_t *num)
 -{
 -   char *endptr;
 -
 -   *num = simple_strtoull(p, endptr, 16);
 -   return *p != '\0'  *endptr == '\0';
 -}
 -
 -static inline int str2long(const char *p, ulong *num)
 -{
 -   char *endptr;
 -
 -   *num = simple_strtoul(p, endptr, 16);
 -   return *p != '\0'  *endptr == '\0';
 -}
 -
 -static int get_part(const char *partname, int *idx, loff_t *off, loff_t 
 *size,
 -   loff_t *maxsize)
 -{
 -#ifdef CONFIG_CMD_MTDPARTS
 -   struct mtd_device *dev;
 -   struct part_info *part;
 -   u8 pnum;
 -   int ret;
 -
 -   ret = mtdparts_init();
 -   if (ret)
 -   return ret;
 -
 -   ret = find_dev_and_part(partname, dev, pnum, part);
 -   if (ret)
 -   return ret;
 -
 -   if (dev-id-type != MTD_DEV_TYPE_NAND) {
 -   puts(not a NAND device\n);
 -   return -1;
 -   }
 -
 -   *off = part-offset;
 -   *size = part-size;
 -   *maxsize = part-size;
 -   *idx = dev-id-num;
 -
 -   ret = set_dev(*idx);
 -   if (ret)
 -   return ret;
 -
 -   return 0;
 -#else
 -   puts(offset is not a number\n);
 -   return -1;
 -#endif
 -}
 -
 -static int arg_off(const char *arg, int *idx, loff_t *off, loff_t *size,
 -   loff_t *maxsize)
 -{
 -   if (!str2off(arg, off))
 -   return get_part(arg, idx, off, size, maxsize);
 -
 -   if (*off = nand_info[*idx].size) {
 -   puts(Offset exceeds device limit\n);
 -   return -1;
 -   }
 -
 -   *maxsize = nand_info[*idx].size - *off;
 -   *size = *maxsize;
 -   return 0;
 -}
 -
 -static int arg_off_size(int argc, char *const argv[], int *idx,
 -   loff_t *off, loff_t *size, loff_t *maxsize)
 -{
 -   int ret;
 -
 -   if (argc == 0) {
 -   *off = 0;
 -   *size = nand_info[*idx].size;
 -   *maxsize = *size;
 -   goto print;
 -   }
 -
 -   ret = arg_off(argv[0], idx, off, size, maxsize);
 -   if (ret)
 -   return ret;
 -
 -   if (argc == 1)
 -   goto print;
 -
 -   if (!str2off(argv[1], size)) {
 -   printf('%s' is not a number\n, argv[1]);
 -   return -1;
 -   }
 -
 -   if (*size  *maxsize) {
 -   puts(Size exceeds partition or device limit\n);
 -   return -1;
 -   }
 -
 -print:
 -   printf(device %d , *idx);
 -   if (*size == nand_info[*idx].size)
 -   puts(whole chip\n);
 -   else
 -   printf(offset 0x%llx, size 0x%llx\n,
 -  (unsigned long long)*off, (unsigned long long)*size);
 -   return 0;
 -}
 -
  #ifdef CONFIG_CMD_NAND_LOCK_UNLOCK
  static void print_status(ulong start, ulong end, ulong erasesize, int status)
  {
 @@ -322,7 +213,12 @@ int do_nand_env_oob(cmd_tbl_t *cmdtp, int argc, char 
 *const argv[])
 goto usage;

 /* We don't care about size, or maxsize. */
 -   if (arg_off(argv[2], idx, addr, maxsize, maxsize)) {
 +   if (arg_off(argv[2], idx, addr, maxsize, maxsize,
 +   MTD_DEV_TYPE_NAND, nand_info[idx].size)) {
 +   puts(Offset or partition name expected\n);
 +   return 1;
 +   }
 +   if (set_dev(idx)) {
 puts(Offset or partition name expected\n);
 return 1;
 

Re: [U-Boot] mkimage and load addresses beyond 4 Gb

2014-11-04 Thread Wolfgang Denk
Dear John,

In message 
CANaRHtnjB-eU=au7VWzBVnM=ERrvWhF7nKUzZUC4QfsJJaNF=a...@mail.gmail.com you 
wrote:
 
 At present, the load address and entry point are both unsigned int.  I'm
 porting to aarch64, and will run the SPL at 0x803100.  mkimage
 truncates this to 0x3100.  Are there any plans to support a load
 address and entry point larger than 32 bits?

The old legacy (binary) uImage header uses u32, and there is no
compatible way to change that.

I think for any 64 bit architecture you will want to use FIT images
right from the beginning.  This will also need some patches, though.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Far back in the mists of ancient time, in the great and glorious days
of the former Galactic Empire, life was wild, rich  and  largely  tax
free. - Douglas Adams, _The Hitchhiker's Guide to the Galaxy_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Inconsistency between $filesize and commands which accept numeric params

2014-11-04 Thread Tom Rini
On Tue, Nov 04, 2014 at 09:53:02PM +0100, Wolfgang Denk wrote:
 Dear Ian,
 
 In message 1415116135.11486.51.ca...@hellion.org.uk you wrote:
 
/*
 * Parse the user's input, partially heuristic.  Valid formats:
 * 0x00112233 4 05- an array of cells.  Numbers follow standard
 *  C conventions.
 * [00 11 22 .. nn] - byte stream
 * string - If the the value doesn't start with  or [, it is
 *  treated as a string.  Note that the quotes are
 *  stripped by the parser before we get the string.

which is inconsistent with the U-Boot uses hex input base by default
mantra.
   
   Because this is FDT centric and not U-Boot centric, yes?
  
  I guess?
 
 Well, we probably should not use this FDT centric decoding function
 directly on arguments passed from the U-Boot command line.

No, look again at what we're doing.  We're not calling a U-Boot function
to do U-Boot things.  We're calling a U-Boot function to set a DT
property.  U-Boot needs to obey DT conventions here.

I can see an argument that we could try and make the heuristics smarter
to add '0x' to obvious hex strings, but that'll just cause crazier
errors when 0x1000 is passed in and seen as 1000 decimal.

-- 
Tom


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


Re: [U-Boot] [PATCH 5/5] arm: socfpga: Add example UDC config

2014-11-04 Thread Pavel Machek
On Tue 2014-11-04 21:09:38, Marek Vasut wrote:
 On Tuesday, November 04, 2014 at 08:51:57 PM, Pavel Machek wrote:
  Hi!
  
   Add example of an USB UDC configuration with DFU and UMS.
   
   Signed-off-by: Marek Vasut ma...@denx.de
   Cc: Chin Liang See cl...@altera.com
   Cc: Dinh Nguyen dingu...@opensource.altera.com
   Cc: Vince Bridgers vbrid...@altera.com
   Cc: Pavel Machek pa...@denx.de
   Cc: Stefan Roese s...@denx.de
   Cc: Lukasz Majewski l.majew...@samsung.com
   
   +/* USB IDs */
   +#define CONFIG_G_DNL_VENDOR_NUM  0x0525  /* NetChip */
   +#define CONFIG_G_DNL_PRODUCT_NUM 0xA4A5  /* Linux-USB File-backed Storage
   Gadget */
  
  Will not this make NetChip rather angry?
 
 You mean that netchip which reserved this ID especially for free use ? No.

Acked-by: Pavel Machek pa...@denx.de

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Inconsistency between $filesize and commands which accept numeric params

2014-11-04 Thread Wolfgang Denk
Dear Tom,

In message 20141104205800.GM15133@bill-the-cat you wrote:
 
  Well, we probably should not use this FDT centric decoding function
  directly on arguments passed from the U-Boot command line.
 
 No, look again at what we're doing.  We're not calling a U-Boot function
 to do U-Boot things.  We're calling a U-Boot function to set a DT
 property.  U-Boot needs to obey DT conventions here.

Well, we are running an U-Boot command.  And U-Boot documentation says
that we use hex inpout base (with the only unlucky exception of the
sleep command).  So this _command_ should also assume hex input.

 I can see an argument that we could try and make the heuristics smarter
 to add '0x' to obvious hex strings, but that'll just cause crazier
 errors when 0x1000 is passed in and seen as 1000 decimal.

Right.  So before calling the fdt code, the U-Boot command should
normalize the number.

Hm is there a way to determine in advance where we are passing a
number as argument [see common/cmd_fdt.c lines 260ff] ?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
What if is a trademark of Hewlett Packard, so stop using it in your
sentences without permission, or risk being sued.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 00/12] spi: sf: ICH SPI driver fix and flash params update

2014-11-04 Thread Jagan Teki
On 1 November 2014 14:23, Bin Meng bmeng...@gmail.com wrote:
 This series fix several bugs in current ICH SPI driver as well as
 adding byte program support for the SST25* flash.

 Flash params are updated to explicitly list supported read commands
 and change flash sector size to 4KiB as long as flash supports
 sector erase (20h) command.

 Changes for v2:
   - Rebased to u-boot-spi/mater.
   - Reviewed and updated the params of all currently supported flash
 parts per their datasheets.
   - Corrected AT25DF321 JEDEC ID.
   - Corrected Atmel bulk erase command to 50h instead of D8h.
   - Added AT25DF321A, W25X10, W25X20, W25X80 params.


 Bin Meng (12):
   spi/ich.c: Fix a bug of reading from a non-64 bytes aligned address
   spi/ich.c: Set the rx operation mode for ich 7
   spi: sf: Support byte program for sst spi flash
   sf: Update SST flash params
   sf: Update Atmel flash params
   sf: Update EON flash params
   sf: Update GigaDevice flash params
   sf: Update Macronix flash params
   sf: Update Spansion flash params
   sf: Update Micron flash params
   sf: Update Winbond flash params
   sf: Give proper spacing between flash table params

I think you combined two or more changes(unrelated) in a common patches and
Added Bulk erase support in e_cmd_rd of sf_params ie quite not correct.

Please fix those and send me one more.

Mean while I will look at your scenario like you're controller only supports AS,
As I said before as AS of AF both are similar way of transferring
except the dummy
bits passing from the driver, try to see the fix on driver point of of
instead of digging
common sf stuff.


  drivers/mtd/spi/sf_internal.h |  11 ++-
  drivers/mtd/spi/sf_ops.c  |  31 +++
  drivers/mtd/spi/sf_params.c   | 186 
 ++
  drivers/mtd/spi/sf_probe.c|  12 ++-
  drivers/spi/ich.c |  26 +++---
  include/spi.h |   1 +
  6 files changed, 159 insertions(+), 108 deletions(-)

 --
 1.8.2.1


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


Re: [U-Boot] [PATCH v3 1/3] mtd, spi: add MTD layer driver

2014-11-04 Thread Daniel Schwierzeck
2014-11-04 21:32 GMT+01:00 Jagan Teki jagannadh.t...@gmail.com:
 On 5 September 2014 11:08, Heiko Schocher h...@denx.de wrote:
 From: Daniel Schwierzeck daniel.schwierz...@gmail.com

 add MTD layer driver for spi, original patch from:
 http://git.denx.de/?p=u-boot/u-boot-mips.git;a=commitdiff;h=bb246819cdc90493dd7089eaa51b9e639765cced

 changes from Heiko Schocher against this patch:
 - remove compile error if not defining CONFIG_SPI_FLASH_MTD:

   LD  drivers/mtd/spi/built-in.o
 drivers/mtd/spi/sf_probe.o: In function `spi_flash_mtd_unregister':
 /home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: multiple 
 definition of `spi_flash_mtd_unregister'
 drivers/mtd/spi/sf_params.o:/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168:
  first defined here
 drivers/mtd/spi/sf_ops.o: In function `spi_flash_mtd_unregister':
 /home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168: multiple 
 definition of `spi_flash_mtd_unregister'
 drivers/mtd/spi/sf_params.o:/home/hs/abb/imx6/u-boot/drivers/mtd/spi/sf_internal.h:168:
  first defined here
 make[1]: *** [drivers/mtd/spi/built-in.o] Fehler 1
 make: *** [drivers/mtd/spi] Fehler 2

 - add a README entry.
 - add correct writebufsize, to fit with Linux v3.14
   MTD, UBI/UBIFS sync.

 Signed-off-by: Daniel Schwierzeck daniel.schwierz...@gmail.com
 Signed-off-by: Heiko Schocher h...@denx.de
 Cc: Jagannadha Sutradharudu Teki jagannadh.t...@gmail.com

 ---
 MAKEALL for ar, mips, powerc compiles clean

 - changes for v2:
   - add comment from Daniel Schwierzeck:
 fix compile error from original patch with
 static inline rather than static __maybe_unused
 - changes for v3:
   rebase with d6c1ffc7d23f4fe4ae8c91101861055b8e1501b6
 ---
  README|   3 ++
  common/cmd_sf.c   |   9 ++--
  drivers/mtd/spi/Makefile  |   1 +
  drivers/mtd/spi/sf_internal.h |  13 ++
  drivers/mtd/spi/sf_mtd.c  | 104 
 ++
  drivers/mtd/spi/sf_probe.c|   5 ++
  6 files changed, 131 insertions(+), 4 deletions(-)
  create mode 100644 drivers/mtd/spi/sf_mtd.c

 diff --git a/README b/README
 index 0a0f528..e7be54e 100644
 --- a/README
 +++ b/README
 @@ -2965,6 +2965,9 @@ CBFS (Coreboot Filesystem) support
 operation will not execute. The only way to exit this
 hardware-protected mode is to drive W#/VPP HIGH.

 +   CONFIG_SPI_FLASH_MTD
 +   add  MTD translation layer driver.
 +
  - SystemACE Support:
 CONFIG_SYSTEMACE

 diff --git a/common/cmd_sf.c b/common/cmd_sf.c
 index b4ceb71..7653d7e 100644
 --- a/common/cmd_sf.c
 +++ b/common/cmd_sf.c
 @@ -121,16 +121,17 @@ static int do_spi_flash_probe(int argc, char * const 
 argv[])
 return -1;
 }

 +   if (flash)
 +   spi_flash_free(flash);
 +
 new = spi_flash_probe(bus, cs, speed, mode);
 +   flash = new;
 +

 Why is this change? I guess it's not related to mtd.
 And it's better to add new with global flash only it's probed isn't it?

 if (!new) {
 printf(Failed to initialize SPI flash at %u:%u\n, bus, cs);
 return 1;
 }

 -   if (flash)
 -   spi_flash_free(flash);
 -   flash = new;
 -
 return 0;
  }

 diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
 index 9e18fb4..b15d273 100644
 --- a/drivers/mtd/spi/Makefile
 +++ b/drivers/mtd/spi/Makefile
 @@ -12,6 +12,7 @@ endif

  obj-$(CONFIG_CMD_SF) += sf.o
  obj-$(CONFIG_SPI_FLASH) += sf_params.o sf_probe.o sf_ops.o
 +obj-$(CONFIG_SPI_FLASH_MTD) += sf_mtd.o
  obj-$(CONFIG_SPI_FRAM_RAMTRON) += ramtron.o
  obj-$(CONFIG_SPI_FLASH_SANDBOX) += sandbox.o
  obj-$(CONFIG_SPI_M95XXX) += eeprom_m95xxx.o
 diff --git a/drivers/mtd/spi/sf_internal.h b/drivers/mtd/spi/sf_internal.h
 index 19d4914..a9f97d1 100644
 --- a/drivers/mtd/spi/sf_internal.h
 +++ b/drivers/mtd/spi/sf_internal.h
 @@ -160,4 +160,17 @@ int spi_flash_read_common(struct spi_flash *flash, 
 const u8 *cmd,
  int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
 size_t len, void *data);

 +#ifdef CONFIG_SPI_FLASH_MTD
 +int spi_flash_mtd_register(struct spi_flash *flash);
 +void spi_flash_mtd_unregister(void);
 +#else
 +static inline int spi_flash_mtd_register(struct spi_flash *flash)
 +{
 +   return 0;
 +}
 +static inline void spi_flash_mtd_unregister(void)
 +{
 +}
 +#endif
 +
  #endif /* _SF_INTERNAL_H_ */
 diff --git a/drivers/mtd/spi/sf_mtd.c b/drivers/mtd/spi/sf_mtd.c
 new file mode 100644
 index 000..0b9cb62
 --- /dev/null
 +++ b/drivers/mtd/spi/sf_mtd.c
 @@ -0,0 +1,104 @@
 +/*
 + * Copyright (C) 2012-2014 Daniel Schwierzeck, daniel.schwierz...@gmail.com
 + *
 + * SPDX-License-Identifier:GPL-2.0+
 + */
 +
 +#include common.h
 +#include malloc.h
 +#include asm/errno.h
 +#include linux/mtd/mtd.h
 +#include spi_flash.h
 +
 +static struct mtd_info sf_mtd_info;
 +static char sf_mtd_name[8];

Re: [U-Boot] [PATCH v6 2/6] fs: interface changes to accomodate files greater than 2GB

2014-11-04 Thread Suriyan Ramasami
Hello Pavel,

On Tue, Nov 4, 2014 at 11:26 AM, Pavel Machek pa...@denx.de wrote:
 On Mon 2014-11-03 18:49:58, Suriyan Ramasami wrote:
 Change the interface for the generic FS functions to take in an extra
 parameter of type loff_t * to return the size. The return values of
 these funtions now serve as an indicator of error conditions alone.

 Signed-off-by: Suriyan Ramasami suriya...@gmail.com
 ---

 Changes in v6:
 * Simon - Split this into a separate patch

 Changes in v5:
 * Simon - update fs.h with comments for fs_read/fs_write/fs_size

  common/cmd_fs.c | 17 +
  fs/fs.c | 77 
 ++---
  include/fs.h| 41 ++
  3 files changed, 88 insertions(+), 47 deletions(-)

 diff --git a/common/cmd_fs.c b/common/cmd_fs.c
 index 6754340..f70cb8a 100644
 --- a/common/cmd_fs.c
 +++ b/common/cmd_fs.c
 @@ -51,6 +51,23 @@ U_BOOT_CMD(
 If 'pos' is 0 or omitted, the file is read from the start.
  )

 +static int do_save_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
 + char * const argv[])
 +{
 + return do_save(cmdtp, flag, argc, argv, FS_TYPE_ANY);
 +}
 +
 +U_BOOT_CMD(
 + save,   7,  0,  do_save_wrapper,
 + save file to a filesystem,
 + interface [dev[:part] [addr [filename [bytes [pos]\n

 That's not correct, AFAICT.

 int do_save(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
 int fstype)
 {
 unsigned long addr;
 const char *filename;
 unsigned long bytes;
 unsigned long pos;
 int len;
 unsigned long time;

 if (argc  6 || argc  7)
 return CMD_RET_USAGE;

 More arguments are mandatory then you describe here.


You are correct. All the way upto bytes is mandatory. I shall change
the arguments as follows:
interface dev:part addr filename bytes [pos]\n

 + - Save binary file 'filename' to partition 'part' on device\n
 +   type 'interface' instance 'dev' from addr 'addr' in memory.\n
 +   'bytes' gives the size to save in bytes and is mandatory.\n
 +   'pos' gives the file byte position to start writing to.\n
 +   If 'pos' is 0 or omitted, the file is written from the start.

 Plus maybe note if it can extend existing files and create files if
 they don't exit would be nice here?

As this is the generic interface and interacts with fat/ext/sandbox,
it depends on their respective implementation. For example a non zero
pos is not yet handled in ext4, whereas its supported in fat.
Hence, I wonder if its apt at this stage to make those statements.

Thanks for the comments!
- Suriyan

 --
 (english) http://www.livejournal.com/~pavelmachek
 (cesky, pictures) 
 http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Pull request: u-boot-sh/master

2014-11-04 Thread Nobuhiro Iwamatsu
Dear Tom Rini.

Please pull u-boot-sh master branch.

The following changes since commit 571bdf16a78e9e116a93d46f4809c4f8a3f2adb6:

  arm: interrupt_init: set sp in IRQ/FIQ modes (2014-10-29 09:03:28 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-sh.git origin/master

for you to fetch changes up to f7ca1f76fd01f3fc7e75fb3fd801c7bef16598db:

  net: sh-eth: Add cache writeback control after setting bit of DMA
descriptor (2014-11-04 09:28:47 +0900)


Nobuhiro Iwamatsu (6):
  serial: sh: Add support R8A7793
  net: sh-eth: Add support R8A7793
  serial: sh: r8a7794: Add support external clock
  net: sh-eth: Remove definition of RX_DESC_SIZE and TX_DESC_SIZE
  net: sh-eth: Use memalign instead of orignal memroy alignment function
  net: sh-eth: Add cache writeback control after setting bit of
DMA descriptor

 drivers/net/sh_eth.c   | 102
+-
 drivers/net/sh_eth.h   |  14 +-
 drivers/serial/serial_sh.h |  10 ++
 3 files changed, 64 insertions(+), 62 deletions(-)

-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arm: rmobile: Add support R8A7793

2014-11-04 Thread Nobuhiro Iwamatsu
Renesas R8A7793 is CPU with Cortex-A15. This supports the basic register
definition and GPIO and framework of PFC.

Signed-off-by: Hisashi Nakamura hisashi.nakamura...@renesas.com
Signed-off-by: Nobuhiro Iwamatsu nobuhiro.iwamatsu...@renesas.com
---
 arch/arm/cpu/armv7/rmobile/Makefile  |1 +
 arch/arm/cpu/armv7/rmobile/cpu_info.c|1 +
 arch/arm/cpu/armv7/rmobile/pfc-r8a7793.c | 1926 ++
 arch/arm/include/asm/arch-rmobile/gpio.h |3 +
 arch/arm/include/asm/arch-rmobile/r8a7793-gpio.h |  438 +
 arch/arm/include/asm/arch-rmobile/r8a7793.h  |   59 +
 arch/arm/include/asm/arch-rmobile/rcar-base.h|2 +-
 arch/arm/include/asm/arch-rmobile/rmobile.h  |2 +
 8 files changed, 2431 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/cpu/armv7/rmobile/pfc-r8a7793.c
 create mode 100644 arch/arm/include/asm/arch-rmobile/r8a7793-gpio.h
 create mode 100644 arch/arm/include/asm/arch-rmobile/r8a7793.h

diff --git a/arch/arm/cpu/armv7/rmobile/Makefile 
b/arch/arm/cpu/armv7/rmobile/Makefile
index dd7de41..647e426 100644
--- a/arch/arm/cpu/armv7/rmobile/Makefile
+++ b/arch/arm/cpu/armv7/rmobile/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_GLOBAL_TIMER) += timer.o
 obj-$(CONFIG_R8A7740) += lowlevel_init.o cpu_info-r8a7740.o pfc-r8a7740.o
 obj-$(CONFIG_R8A7790) += lowlevel_init_ca15.o cpu_info-rcar.o pfc-r8a7790.o
 obj-$(CONFIG_R8A7791) += lowlevel_init_ca15.o cpu_info-rcar.o pfc-r8a7791.o
+obj-$(CONFIG_R8A7793) += lowlevel_init_ca15.o cpu_info-rcar.o pfc-r8a7793.o
 obj-$(CONFIG_R8A7794) += lowlevel_init_ca15.o cpu_info-rcar.o pfc-r8a7794.o
 obj-$(CONFIG_SH73A0) += lowlevel_init.o cpu_info-sh73a0.o pfc-sh73a0.o
 obj-$(CONFIG_TMU_TIMER) += ../../../../sh/lib/time.o
diff --git a/arch/arm/cpu/armv7/rmobile/cpu_info.c 
b/arch/arm/cpu/armv7/rmobile/cpu_info.c
index b98137e..d47c47c 100644
--- a/arch/arm/cpu/armv7/rmobile/cpu_info.c
+++ b/arch/arm/cpu/armv7/rmobile/cpu_info.c
@@ -53,6 +53,7 @@ static const struct {
{ 0x40, R8A7740 },
{ 0x45, R8A7790 },
{ 0x47, R8A7791 },
+   { 0x4B, R8A7793 },
{ 0x4C, R8A7794 },
{ 0x0, CPU },
 };
diff --git a/arch/arm/cpu/armv7/rmobile/pfc-r8a7793.c 
b/arch/arm/cpu/armv7/rmobile/pfc-r8a7793.c
new file mode 100644
index 000..03c27ad
--- /dev/null
+++ b/arch/arm/cpu/armv7/rmobile/pfc-r8a7793.c
@@ -0,0 +1,1926 @@
+/*
+ * arch/arm/cpu/armv7/rmobile/pfc-r8a7793.c
+ *
+ * Copyright (C) 2013 Renesas Electronics Corporation
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+#include common.h
+#include sh_pfc.h
+#include asm/gpio.h
+
+#define CPU_32_PORT(fn, pfx, sfx)  \
+   PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx),\
+   PORT_10(fn, pfx##2, sfx), PORT_1(fn, pfx##30, sfx), \
+   PORT_1(fn, pfx##31, sfx)
+
+#define CPU_32_PORT1(fn, pfx, sfx) \
+   PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx),\
+   PORT_1(fn, pfx##20, sfx), PORT_1(fn, pfx##21, sfx), \
+   PORT_1(fn, pfx##22, sfx), PORT_1(fn, pfx##23, sfx), \
+   PORT_1(fn, pfx##24, sfx), PORT_1(fn, pfx##25, sfx)
+
+/*
+ * GP_0_0_DATA - GP_7_25_DATA
+ * (except for GP1[26],GP1[27],GP1[28],GP1[29]),GP1[30]),GP1[31]
+ *  GP7[26],GP7[27],GP7[28],GP7[29]),GP7[30]),GP7[31])
+ */
+#define CPU_ALL_PORT(fn, pfx, sfx) \
+   CPU_32_PORT(fn, pfx##_0_, sfx), \
+   CPU_32_PORT1(fn, pfx##_1_, sfx),\
+   CPU_32_PORT(fn, pfx##_2_, sfx), \
+   CPU_32_PORT(fn, pfx##_3_, sfx), \
+   CPU_32_PORT(fn, pfx##_4_, sfx), \
+   CPU_32_PORT(fn, pfx##_5_, sfx), \
+   CPU_32_PORT(fn, pfx##_6_, sfx), \
+   CPU_32_PORT1(fn, pfx##_7_, sfx)
+
+#define _GP_GPIO(pfx, sfx) PINMUX_GPIO(GPIO_GP##pfx, GP##pfx##_DATA)
+#define _GP_DATA(pfx, sfx) PINMUX_DATA(GP##pfx##_DATA, GP##pfx##_FN,   \
+  GP##pfx##_IN, GP##pfx##_OUT)
+
+#define _GP_INOUTSEL(pfx, sfx) GP##pfx##_IN, GP##pfx##_OUT
+#define _GP_INDT(pfx, sfx) GP##pfx##_DATA
+
+#define GP_ALL(str)CPU_ALL_PORT(_PORT_ALL, GP, str)
+#define PINMUX_GPIO_GP_ALL()   CPU_ALL_PORT(_GP_GPIO, , unused)
+#define PINMUX_DATA_GP_ALL()   CPU_ALL_PORT(_GP_DATA, , unused)
+
+
+#define PORT_10_REV(fn, pfx, sfx)  \
+   PORT_1(fn, pfx##9, sfx), PORT_1(fn, pfx##8, sfx),   \
+   PORT_1(fn, pfx##7, sfx), PORT_1(fn, pfx##6, sfx),   \
+   PORT_1(fn, pfx##5, sfx), PORT_1(fn, pfx##4, sfx),   \
+   PORT_1(fn, pfx##3, sfx), PORT_1(fn, pfx##2, sfx),   \
+   PORT_1(fn, pfx##1, sfx), PORT_1(fn, pfx##0, sfx)
+
+#define CPU_32_PORT_REV(fn, pfx, sfx)  \
+   PORT_1(fn, pfx##31, sfx), PORT_1(fn, pfx##30, sfx), \
+   PORT_10_REV(fn, pfx##2, sfx), PORT_10_REV(fn, pfx##1, sfx), \

Re: [U-Boot] [PATCH] MAINTAINERS: add me as a maintainer of MTD

2014-11-04 Thread Jagan Teki
On 4 November 2014 03:04, Scott Wood scottw...@freescale.com wrote:
 On Fri, 2014-10-31 at 11:26 +0100, Heiko Schocher wrote:
 Add MAINTAINERS and doc/git-mailrc entry.

 Signed-off-by: Heiko Schocher h...@denx.de

 ---
 as discussed this step here and there first of all with Scott Wood
 for example here:
 http://lists.denx.de/pipermail/u-boot/2014-August/186005.html

 I am now ready for taking over the ownership for MTD ...

 @Scott: I would be happy, if you can still have a look in nand patches ;-)
 please inform me, if you have no longer time for it, so
 we can set u-boot-nand into not maintained state

 If you're only looking to be custodian for mtd infrastructure and not
 NAND, I guess I'll continue to do it...  I hope there won't be any more
 from-scratch updates of the NAND code, though. :-)

I thought separation of mtd is not quite good as it related to all
flash stuff, it may
find difficulty to reviewer's which in-sync with the mtd maintainer
(if separated)

And the drivers/mtd has nor, nand, and sf are the key and all together
as MTD subsystem
atleast from code point of.

IMHO, why can't we follow a maintainer list as MEMORY TECHNOLOGY DEVICES (MTD)
which can list a maintainer's who owned the drivers/mtd - I guess this
could be a defined way.

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


[U-Boot] Pull request: u-boot-sh/rmobile

2014-11-04 Thread Nobuhiro Iwamatsu
Dear Tom Rini.

Please pull u-boot-sh rmobile branch.

The following changes since commit 571bdf16a78e9e116a93d46f4809c4f8a3f2adb6:

  arm: interrupt_init: set sp in IRQ/FIQ modes (2014-10-29 09:03:28 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-sh.git HEAD

for you to fetch changes up to 9cb8d9d2e0a34582f55939cbb9b2989633f24b34:

  arm: rmobile: alt: Add VFAT filesystem support (2014-11-04 09:02:22 +0900)


Nobuhiro Iwamatsu (11):
  arm: rmobile: r8a7790: Update initialize L2 cache
  arm: rmobile: lager: Fix change of the CPU frequency
  arm: rmobile: lager: Add external RAM boot
  arm: rmobile: koelsch: Add external RAM boot
  arm: rmobile: alt: Add external RAM boot
  arm: rmobile: lager: Remove RAM address initialization
  arm: rmobile: koelsch: Remove RAM address initialization
  arm: rmobile: alt: Remove RAM address initialization
  arm: rmobile: alt: Fix typo of SCIF id
  arm: rmobile: alt: Add support USB and USB commands
  arm: rmobile: alt: Add VFAT filesystem support

 arch/arm/cpu/armv7/rmobile/Kconfig  |  5 +
 arch/arm/cpu/armv7/rmobile/lowlevel_init_ca15.S | 11 ++-
 arch/arm/include/asm/arch-rmobile/rcar-base.h   |  2 ++
 board/renesas/alt/alt.c |  7 +++
 board/renesas/alt/qos.c |  6 ++
 board/renesas/koelsch/koelsch.c |  1 -
 board/renesas/koelsch/qos.c |  7 ++-
 board/renesas/lager/lager.c |  6 +-
 board/renesas/lager/qos.c   |  7 ++-
 include/configs/alt.h   | 21 +
 include/configs/koelsch.h   | 14 --
 include/configs/lager.h | 12 ++--
 12 files changed, 78 insertions(+), 21 deletions(-)


-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] common.h: Add prototype of arch_preboot_os

2014-11-04 Thread Nobuhiro Iwamatsu
Hi!

2014-11-04 16:50 GMT+09:00 Igor Grinberg grinb...@compulab.co.il:
 On 11/04/14 09:14, Nobuhiro Iwamatsu wrote:
 When we used arch_preboot_os() function because prototype of this is not
 declared, following warning is output.

 Or.. you just need to include the correct file:

 $ grep -nr arch_preboot_os include/
 include/bootm.h:57:void arch_preboot_os(void);

Oh, I see.
Thanks for your check.

Best regards,
  Nobuhiro

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


Re: [U-Boot] Inconsistency between $filesize and commands which accept numeric params

2014-11-04 Thread Tom Rini
On Tue, Nov 04, 2014 at 10:20:46PM +0100, Wolfgang Denk wrote:
 Dear Tom,
 
 In message 20141104205800.GM15133@bill-the-cat you wrote:
  
   Well, we probably should not use this FDT centric decoding function
   directly on arguments passed from the U-Boot command line.
  
  No, look again at what we're doing.  We're not calling a U-Boot function
  to do U-Boot things.  We're calling a U-Boot function to set a DT
  property.  U-Boot needs to obey DT conventions here.
 
 Well, we are running an U-Boot command.  And U-Boot documentation says
 that we use hex inpout base (with the only unlucky exception of the
 sleep command).  So this _command_ should also assume hex input.

... when we can make assumptions about the input, yes.

  I can see an argument that we could try and make the heuristics smarter
  to add '0x' to obvious hex strings, but that'll just cause crazier
  errors when 0x1000 is passed in and seen as 1000 decimal.
 
 Right.  So before calling the fdt code, the U-Boot command should
 normalize the number.
 
 Hm is there a way to determine in advance where we are passing a
 number as argument [see common/cmd_fdt.c lines 260ff] ?

The problem is that 'fdt set ... decimal' is valid and 'fdt set ...
0xhex' is valid (as it 'fdt set ... string'). What I'm saying is that
we should think of it as 'fdt set input to DT' and within input to
DT we assume DT conventions, not U-Boot conventions.

-- 
Tom


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


Re: [U-Boot] Inconsistency between $filesize and commands which accept numeric params

2014-11-04 Thread Wolfgang Denk
Dear Tom,

In message 20141104220213.GN15133@bill-the-cat you wrote:
 
  Hm is there a way to determine in advance where we are passing a
  number as argument [see common/cmd_fdt.c lines 260ff] ?
 
 The problem is that 'fdt set ... decimal' is valid and 'fdt set ...
 0xhex' is valid (as it 'fdt set ... string'). What I'm saying is that
 we should think of it as 'fdt set input to DT' and within input to
 DT we assume DT conventions, not U-Boot conventions.

Yes, I fully understand what you mean.  I just wonder if there is a
user-friendly way to prevent such errors.

I think we should at least document this behaviour - both in the help
message for this command, and in the manual.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
A good aphorism is too hard for the tooth of time, and  is  not  worn
away  by  all  the  centuries,  although  it serves as food for every
epoch.  - Friedrich Wilhelm Nietzsche
  _Miscellaneous Maxims and Opinions_ no. 168
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Inconsistency between $filesize and commands which accept numeric params

2014-11-04 Thread Tom Rini
On Tue, Nov 04, 2014 at 11:11:40PM +0100, Wolfgang Denk wrote:
 Dear Tom,
 
 In message 20141104220213.GN15133@bill-the-cat you wrote:
  
   Hm is there a way to determine in advance where we are passing a
   number as argument [see common/cmd_fdt.c lines 260ff] ?
  
  The problem is that 'fdt set ... decimal' is valid and 'fdt set ...
  0xhex' is valid (as it 'fdt set ... string'). What I'm saying is that
  we should think of it as 'fdt set input to DT' and within input to
  DT we assume DT conventions, not U-Boot conventions.
 
 Yes, I fully understand what you mean.  I just wonder if there is a
 user-friendly way to prevent such errors.
 
 I think we should at least document this behaviour - both in the help
 message for this command, and in the manual.

I think this is a documentation (readme and command help) only thing.

-- 
Tom


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


Re: [U-Boot] [PATCH v3 1/3] i2c: use __weak

2014-11-04 Thread Tom Rini
On Mon, Oct 27, 2014 at 10:27:18PM +0100, Jeroen Hofstee wrote:

 Cc: Heiko Schocher h...@denx.de
 Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl

Applied to u-boot/master, thanks!

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


Re: [U-Boot] [PATCH 3/5] sparc: merge arch/sparc/cpu/*/config.mk to arch/sparc/config.mk

2014-11-04 Thread Tom Rini
On Thu, Oct 30, 2014 at 03:30:56PM +0900, Masahiro Yamada wrote:

 Remove arch/sparc/cpu/{leon2,leon3}/config.mk and move duplicated
 defines of -fPIC to arch/sparc/config.mk.
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Cc: Daniel Hellstrom dan...@gaisler.com

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 1/5] sparc: Use nicer prompt for board select menu

2014-11-04 Thread Tom Rini
On Thu, Oct 30, 2014 at 03:30:54PM +0900, Masahiro Yamada wrote:

 The Board names in the board select menu were simply taken from the
 board directory name by a conversion tool when switching to Kconfig.
 
 Let's use more descriptive prompts taken from
 include/configs/gr*.h and board/gaisler/*/config.mk.
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Cc: Daniel Hellstrom dan...@gaisler.com

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 2/5] sparc: move CONFIG_{LEON, LEON2, LEON3} to Kconfig

2014-11-04 Thread Tom Rini
On Thu, Oct 30, 2014 at 03:30:55PM +0900, Masahiro Yamada wrote:

 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Cc: Daniel Hellstrom dan...@gaisler.com

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v2, rebased 3/3] serial: add prototypes for init functions

2014-11-04 Thread Tom Rini
On Mon, Oct 27, 2014 at 08:10:07PM +0100, Jeroen Hofstee wrote:

 While at it, sort them.
 
 Cc: Tom Rini tr...@ti.com
 Cc: Simon Glass s...@chromium.org
 Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 4/5] sparc: merge CONFIG_SYS_CPU and CONFIG_SYS_VENDOR defines

2014-11-04 Thread Tom Rini
On Thu, Oct 30, 2014 at 03:30:57PM +0900, Masahiro Yamada wrote:

 For now, all the SPARC boards in U-Boot are provided by Gaisler.
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Cc: Daniel Hellstrom dan...@gaisler.com

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 5/5] sparc: move CONFIG_SYS_TEXT_BASE to Kconfig

2014-11-04 Thread Tom Rini
On Thu, Oct 30, 2014 at 03:30:58PM +0900, Masahiro Yamada wrote:

 Defining CONFIG_SYS_TEXT_BASE in config.mk is very old style.
 
 Create CONFIG_SYS_TEXT_BASE option in Kconfig, but let it
 depend on CONFIG_SPARC because we do not want to disturb
 the other architectures that still define CONFIG_SYS_TEXT_BASE
 in their header files.
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Cc: Daniel Hellstrom dan...@gaisler.com

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v2] kbuild: do not hide clang warnings during build with W=1

2014-11-04 Thread Tom Rini
On Fri, Oct 31, 2014 at 11:00:34AM +0900, Masahiro Yamada wrote:

 These lines originate in Linux;  it looks like Linux folks chose to
 hide bunch of warnings reported by clang rather than fixing C code.
 
 In U-boot, warnings are being fixed thanks to Jeroen's great efforts.
 Let's stop suppressing clang warnings.
 
 Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 Cc: Jeroen Hofstee jer...@myspectrum.nl

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] MAINTAINERS: fix Pantelis Antoniou email address

2014-11-04 Thread Tom Rini
On Mon, Nov 03, 2014 at 11:19:14AM +0200, Igor Grinberg wrote:

 Trivial fix (unless Pantelis has a new email address):
 
 Pantelis Antoniou panto.antoniou-consulting.com
 ^
 make it:
 Pantelis Antoniou pa...@antoniou-consulting.com
 
 Signed-off-by: Igor Grinberg grinb...@compulab.co.il
 Cc: Pantelis Antoniou pa...@antoniou-consulting.com

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH 3/3] ARM: kwimage: fix v0 format

2014-11-04 Thread Tom Rini
On Fri, Oct 31, 2014 at 01:03:27AM +0100, Gerald Kerma wrote:

 This patch fix the kwimage tools for version 0 fileformat used for kirkwood
 Tested on sheevaplug
 
 Signed-off-by: Gerald Kerma drea...@doukki.net

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] Fix cosmetic issues in mkimage manpage

2014-11-04 Thread Tom Rini
On Sat, Nov 01, 2014 at 06:09:01PM -0700, Vagrant Cascadian wrote:

 * Escape use of - in description of -F.
 
 * Fix line continuations in examples so that the continued lines are
   also bold.
 
 Signed-off-by: Vagrant Cascadian vagr...@debian.org

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH v2, rebased 2/3] arm926ejs: cache: use __weak

2014-11-04 Thread Tom Rini
On Mon, Oct 27, 2014 at 08:10:06PM +0100, Jeroen Hofstee wrote:

 Cc: Albert Aribaud albert.u.b...@aribaud.net
 Signed-off-by: Jeroen Hofstee jer...@myspectrum.nl

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [PATCH] tools/env: Fix environment size and CRC on 64-bit hosts

2014-11-04 Thread Dominic Sacré
On architectures where 'long' is 64 bit, the u-boot environment
as seen by the fw_env tools was missing 4 bytes.
This patch fixes getenvsize(), and thus also ensures that the
environment's CRC32 checksum is calculated correctly.

Signed-off-by: Dominic Sacré dominic.sa...@gmx.de
Cc: Wolfgang Denk w...@denx.de
Cc: Tom Rini tr...@ti.com
---
 tools/env/fw_env.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 30d5b03..1173eea 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -125,7 +125,7 @@ static int get_config (char *);
 #endif
 static inline ulong getenvsize (void)
 {
-   ulong rc = CUR_ENVSIZE - sizeof(long);
+   ulong rc = CUR_ENVSIZE - sizeof(uint32_t);
 
if (HaveRedundEnv)
rc -= sizeof (char);
-- 
2.1.3

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


Re: [U-Boot] mkimage and load addresses beyond 4 Gb

2014-11-04 Thread Simon Glass
Hi,

On 4 November 2014 12:55, Wolfgang Denk w...@denx.de wrote:

 Dear John,

 In message 
 CANaRHtnjB-eU=au7VWzBVnM=ERrvWhF7nKUzZUC4QfsJJaNF=a...@mail.gmail.com you 
 wrote:
 
  At present, the load address and entry point are both unsigned int.  I'm
  porting to aarch64, and will run the SPL at 0x803100.  mkimage
  truncates this to 0x3100.  Are there any plans to support a load
  address and entry point larger than 32 bits?

 The old legacy (binary) uImage header uses u32, and there is no
 compatible way to change that.

 I think for any 64 bit architecture you will want to use FIT images
 right from the beginning.  This will also need some patches, though.

That sounds good. It seems silly to maintain legacy formats with new
architectures, FIT is much much more flexible (hashing, verified boot,
more image types, etc.)

To reduce friction we could perhaps enhance mkimage so it can
auto-generate a .its file for the common case.

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


Re: [U-Boot] [PATCH v6 2/6] fs: interface changes to accomodate files greater than 2GB

2014-11-04 Thread Simon Glass
Hi,

On 3 November 2014 18:49, Suriyan Ramasami suriya...@gmail.com wrote:
 Change the interface for the generic FS functions to take in an extra
 parameter of type loff_t * to return the size. The return values of
 these funtions now serve as an indicator of error conditions alone.

 Signed-off-by: Suriyan Ramasami suriya...@gmail.com

This looks good apart from Pavel's comments and my two minor nits below.

 ---

 Changes in v6:
 * Simon - Split this into a separate patch

 Changes in v5:
 * Simon - update fs.h with comments for fs_read/fs_write/fs_size

  common/cmd_fs.c | 17 +
  fs/fs.c | 77 
 ++---
  include/fs.h| 41 ++
  3 files changed, 88 insertions(+), 47 deletions(-)

 diff --git a/common/cmd_fs.c b/common/cmd_fs.c
 index 6754340..f70cb8a 100644
 --- a/common/cmd_fs.c
 +++ b/common/cmd_fs.c
 @@ -51,6 +51,23 @@ U_BOOT_CMD(
   If 'pos' is 0 or omitted, the file is read from the start.
  )

 +static int do_save_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
 +   char * const argv[])
 +{
 +   return do_save(cmdtp, flag, argc, argv, FS_TYPE_ANY);
 +}
 +
 +U_BOOT_CMD(
 +   save,   7,  0,  do_save_wrapper,
 +   save file to a filesystem,
 +   interface [dev[:part] [addr [filename [bytes [pos]\n
 +   - Save binary file 'filename' to partition 'part' on device\n
 + type 'interface' instance 'dev' from addr 'addr' in memory.\n
 + 'bytes' gives the size to save in bytes and is mandatory.\n
 + 'pos' gives the file byte position to start writing to.\n
 + If 'pos' is 0 or omitted, the file is written from the start.
 +)
 +
  static int do_ls_wrapper(cmd_tbl_t *cmdtp, int flag, int argc,
 char * const argv[])
  {
 diff --git a/fs/fs.c b/fs/fs.c
 index dd680f3..0f5a1f4 100644
 --- a/fs/fs.c
 +++ b/fs/fs.c
 @@ -46,19 +46,21 @@ static inline int fs_exists_unsupported(const char 
 *filename)
 return 0;
  }

 -static inline int fs_size_unsupported(const char *filename)
 +static inline int fs_size_unsupported(const char *filename, loff_t *size)
  {
 return -1;
  }

  static inline int fs_read_unsupported(const char *filename, void *buf,
 - int offset, int len)
 + loff_t offset, loff_t len,
 + loff_t *actread)
  {
 return -1;
  }

  static inline int fs_write_unsupported(const char *filename, void *buf,
 - int offset, int len)
 + loff_t offset, loff_t len,
 + loff_t *actwrite)
  {
 return -1;
  }
 @@ -82,9 +84,11 @@ struct fstype_info {
  disk_partition_t *fs_partition);
 int (*ls)(const char *dirname);
 int (*exists)(const char *filename);
 -   int (*size)(const char *filename);
 -   int (*read)(const char *filename, void *buf, int offset, int len);
 -   int (*write)(const char *filename, void *buf, int offset, int len);
 +   int (*size)(const char *filename, loff_t *size);
 +   int (*read)(const char *filename, void *buf, loff_t offset,
 +   loff_t len, loff_t *actread);
 +   int (*write)(const char *filename, void *buf, loff_t offset,
 +loff_t len, loff_t *actwrite);
 void (*close)(void);
  };

 @@ -99,7 +103,11 @@ static struct fstype_info fstypes[] = {
 .exists = fat_exists,
 .size = fat_size,
 .read = fat_read_file,
 +#ifdef CONFIG_FAT_WRITE
 +   .write = file_fat_write,
 +#else
 .write = fs_write_unsupported,
 +#endif
 },
  #endif
  #ifdef CONFIG_FS_EXT4
 @@ -112,7 +120,11 @@ static struct fstype_info fstypes[] = {
 .exists = ext4fs_exists,
 .size = ext4fs_size,
 .read = ext4_read_file,
 +#ifdef CONFIG_CMD_EXT4_WRITE
 +   .write = ext4_write_file,
 +#else
 .write = fs_write_unsupported,
 +#endif
 },
  #endif
  #ifdef CONFIG_SANDBOX
 @@ -233,20 +245,21 @@ int fs_exists(const char *filename)
 return ret;
  }

 -int fs_size(const char *filename)
 +int fs_size(const char *filename, loff_t *size)
  {
 int ret;

 struct fstype_info *info = fs_get_info(fs_type);

 -   ret = info-size(filename);
 +   ret = info-size(filename, size);

 fs_close();

 return ret;
  }

 -int fs_read(const char *filename, ulong addr, int offset, int len)
 +int fs_read(const char *filename, ulong addr, loff_t offset, loff_t len,
 +   loff_t *actread)
  {
 struct fstype_info *info = fs_get_info(fs_type);
 void *buf;
 @@ -257,11 +270,11 @@ int fs_read(const char *filename, ulong addr, int 
 offset, int len)
 

Re: [U-Boot] [PATCH v6 1/6] sandbox: script for testing sandbox/ext4/fat/fs commands

2014-11-04 Thread Simon Glass
Hi,

On 3 November 2014 18:49, Suriyan Ramasami suriya...@gmail.com wrote:
 Test size/read/write commands in a sandbox environment.

 Signed-off-by: Suriyan Ramasami suriya...@gmail.com

 ---

 Changes in v6:
 * Update expected results in comments
 * Simon comments -
 *  Remove README file and add it in start of script
 *  Drop blank lines in top of functions
 *  Put repeating constants in lower case variables
 *  Refer to U-Boot as U-Boot
 *  Move settings to top of file and code in functions or otherwise at bottom
 *  Create check_prereq function
 *  Use mkfs -t type -F img for ext4, but modify for fat

 Changes in v5:
 * Simon comments -
 *   Add README file to document how to run it
 *   Generate output in a sandbox environment
 *   Add one line comments on shell variables used
 *   Avoid camel case through out
 *   Path to UBOOT is variable at top
 *   Print PASSED or FAILED at end, and set return code, 0 if OK, 1 otherwise

  test/fs/fs-test.sh | 562 
 +
  1 file changed, 562 insertions(+)
  create mode 100755 test/fs/fs-test.sh

 diff --git a/test/fs/fs-test.sh b/test/fs/fs-test.sh
 new file mode 100755
 index 000..a817de5
 --- /dev/null
 +++ b/test/fs/fs-test.sh
 @@ -0,0 +1,562 @@
 +#!/bin/bash
 +#
 +# (C) Copyright 2014 Suriyan Ramasami
 +#
 +#  SPDX-License-Identifier:GPL-2.0+
 +#
 +
 +# Invoke this test script from U-Boot base directory as ./test/fs/fs-test.sh
 +# It currently tests the fs/sb and native commands for ext4 and fat 
 partitions
 +# Expected results are as follows:
 +# EXT4 tests:
 +# fs-test.sb.ext4.out: Summary: PASS: 17 FAIL: 2
 +# fs-test.ext4.out: Summary: PASS: 11 FAIL: 8
 +# fs-test.fs.ext4.out: Summary: PASS: 11 FAIL: 8
 +# FAT tests:
 +# fs-test.sb.fat.out: Summary: PASS: 17 FAIL: 2
 +# fs-test.fat.out: Summary: PASS: 19 FAIL: 0
 +# fs-test.fs.fat.out: Summary: PASS: 19 FAIL: 0
 +# Total Summary: TOTAL PASS: 94 TOTAL FAIL: 20

I found this does not work as I have mkfs.vfat but not mkfs.fat.
Perhaps it needs to change to vfat? I've pushed a patch to
u-boot-x86/fs-working which does this.

I have a minor comment below but it isn't important. I'm a bit worried
that this script has grown so large it should be in Python, but we can
worry about that another time. It does work so let's get it in.

There is one problem though - bisectability. Some patches change the
API and thus U-Boot doesn't build.

My suggestion to reduce patch size/complexity was do break it into
independent changes - e.g. adding the 'size' parameter in one patch
and the 'actread/actwrite' parameter in another. Maybe that turned out
to be too hard?

If you want to do each FS separately, you might be able to:

- patch each FS in separate patches to handle the two parameters
internally, but don't change the outside API function. For example
leave file_fat_write() alone
- do this for each FS, and then have a final patch that changes all
the API functions and the FS layer

However if you want to squash things together a bit more, that is OK,
I feel you have put enough effort into this already!


./tools/buildman/buildman -b try-fs sandbox -se
boards.cfg is up to date. Nothing to do.
Summary of 8 commits for 1 boards (1 thread, 4 jobs per thread)
01: Merge branch 'master' of git://git.denx.de/u-boot-mips
02: sandbox: script for testing sandbox/ext4/fat/fs commands
03: fs: interface changes to accomodate files greater than 2GB
   sandbox: +   sandbox
+fs/fs.c:124:12: error: ‘ext4_write_file’ undeclared here (not in a function)
+make[2]: *** [fs/fs.o] Error 1
+make[1]: *** [fs] Error 2
+make: *** [sub-make] Error 2
w+fs/fs.c:104:3: warning: initialization from incompatible pointer
type [enabled by default]
w+fs/fs.c:104:3: warning: (near initialization for ‘fstypes[0].size’)
[enabled by default]
w+fs/fs.c:105:3: warning: initialization from incompatible pointer
type [enabled by default]
w+fs/fs.c:105:3: warning: (near initialization for ‘fstypes[0].read’)
[enabled by default]
w+fs/fs.c:121:3: warning: initialization from incompatible pointer
type [enabled by default]
w+fs/fs.c:121:3: warning: (near initialization for ‘fstypes[1].size’)
[enabled by default]
w+fs/fs.c:122:3: warning: initialization from incompatible pointer
type [enabled by default]
w+fs/fs.c:122:3: warning: (near initialization for ‘fstypes[1].read’)
[enabled by default]
w+fs/fs.c:138:3: warning: initialization from incompatible pointer
type [enabled by default]
w+fs/fs.c:138:3: warning: (near initialization for ‘fstypes[2].size’)
[enabled by default]
w+fs/fs.c:139:3: warning: initialization from incompatible pointer
type [enabled by default]
w+fs/fs.c:139:3: warning: (near initialization for ‘fstypes[2].read’)
[enabled by default]
w+fs/fs.c:140:3: warning: initialization from incompatible pointer
type [enabled by default]
w+fs/fs.c:140:3: warning: (near initialization for ‘fstypes[2].write’)
[enabled by default]
04: fat: interface changes to accomodate files greater than 2GB
w-fs/fs.c:104:3: 

Re: [U-Boot] [PATCH v6 5/6] sandbox: Use md5sum and fatwrite to enable testing of fs commands

2014-11-04 Thread Simon Glass
On 3 November 2014 18:50, Suriyan Ramasami suriya...@gmail.com wrote:
 Enable md5sum to check the MD5 of the read and written files to check
 their contents for validity.
 Use map_sysmem() to map buffer in a sandbox environment.

 Signed-off-by: Suriyan Ramasami suriya...@gmail.com

Acked-by: Simon Glass s...@chromium.org


 ---

 Changes in v6:
 * Simon - Split this into a separate patch

 Changes in v5: None

  common/cmd_md5sum.c   | 12 ++--
  include/configs/sandbox.h |  2 ++
  2 files changed, 12 insertions(+), 2 deletions(-)

 diff --git a/common/cmd_md5sum.c b/common/cmd_md5sum.c
 index 3ac8cc4..d22ace5 100644
 --- a/common/cmd_md5sum.c
 +++ b/common/cmd_md5sum.c
 @@ -11,6 +11,7 @@
  #include common.h
  #include command.h
  #include u-boot/md5.h
 +#include asm/io.h

  /*
   * Store the resulting sum to an address or variable
 @@ -79,6 +80,7 @@ int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * 
 const argv[])
 int verify = 0;
 int ac;
 char * const *av;
 +   void *buf;

 if (argc  3)
 return CMD_RET_USAGE;
 @@ -96,7 +98,9 @@ int do_md5sum(cmd_tbl_t *cmdtp, int flag, int argc, char * 
 const argv[])
 addr = simple_strtoul(*av++, NULL, 16);
 len = simple_strtoul(*av++, NULL, 16);

 -   md5_wd((unsigned char *) addr, len, output, CHUNKSZ_MD5);
 +   buf = map_sysmem(addr, len);
 +   md5_wd(buf, len, output, CHUNKSZ_MD5);
 +   unmap_sysmem(buf);

 if (!verify) {
 printf(md5 for %08lx ... %08lx == , addr, addr + len - 1);
 @@ -135,6 +139,7 @@ static int do_md5sum(cmd_tbl_t *cmdtp, int flag, int 
 argc, char * const argv[])
 unsigned long addr, len;
 unsigned int i;
 u8 output[16];
 +   void *buf;

 if (argc  3)
 return CMD_RET_USAGE;
 @@ -142,7 +147,10 @@ static int do_md5sum(cmd_tbl_t *cmdtp, int flag, int 
 argc, char * const argv[])
 addr = simple_strtoul(argv[1], NULL, 16);
 len = simple_strtoul(argv[2], NULL, 16);

 -   md5_wd((unsigned char *) addr, len, output, CHUNKSZ_MD5);
 +   buf = map_sysmem(addr, len);
 +   md5_wd(buf, len, output, CHUNKSZ_MD5);
 +   unmap_sysmem(buf);
 +
 printf(md5 for %08lx ... %08lx == , addr, addr + len - 1);
 for (i = 0; i  16; i++)
 printf(%02x, output[i]);
 diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
 index ee4b244..2b03841 100644
 --- a/include/configs/sandbox.h
 +++ b/include/configs/sandbox.h
 @@ -48,6 +48,7 @@
  #define CONFIG_ANDROID_BOOT_IMAGE

  #define CONFIG_FS_FAT
 +#define CONFIG_FAT_WRITE
  #define CONFIG_FS_EXT4
  #define CONFIG_EXT4_WRITE
  #define CONFIG_CMD_FAT
 @@ -57,6 +58,7 @@
  #define CONFIG_DOS_PARTITION
  #define CONFIG_HOST_MAX_DEVICES 4
  #define CONFIG_CMD_FS_GENERIC
 +#define CONFIG_CMD_MD5SUM

  #define CONFIG_SYS_VSNPRINTF

 --
 1.9.1

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


Re: [U-Boot] [PATCH v2 7/9] dm: at91: Convert snapper9260 to use driver model

2014-11-04 Thread Simon Glass
Hi Masahiro,

On 1 November 2014 10:27, Masahiro YAMADA yamad...@jp.panasonic.com wrote:
 Hi Simon,

 2014-10-30 4:09 GMT+09:00 Simon Glass s...@chromium.org:
 diff --git a/include/configs/snapper9260.h b/include/configs/snapper9260.h
 index e2e623e..942af2e 100644
 --- a/include/configs/snapper9260.h
 +++ b/include/configs/snapper9260.h
 @@ -21,6 +21,11 @@
  #define CONFIG_SYS_AT91_MAIN_CLOCK 18432000 /* External Crystal, in Hz 
 */
  #define CONFIG_SYS_AT91_SLOW_CLOCK 32768
  #define CONFIG_SYS_GENERIC_BOARD
 +#define CONFIG_DM
 +#define CONFIG_CMD_DM
 +#define CONFIG_DM_GPIO
 +#define CONFIG_DM_SERIAL
 +#define CONFIG_SYS_MALLOC_F_LEN(1  10)




 CONFIG_DM, CONFIG_DM_GPIO, CONFIG_DM_SERIAL are available in Kconfig.
 Could you add them into the defconfig, please?

Yes I need to do a full pass through all the boards I've added.
Hopefully next week.

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


Re: [U-Boot] [PATCH v2 00/12] spi: sf: ICH SPI driver fix and flash params update

2014-11-04 Thread Bin Meng
Hi Jagan,

On Wed, Nov 5, 2014 at 5:21 AM, Jagan Teki jagannadh.t...@gmail.com wrote:
 On 1 November 2014 14:23, Bin Meng bmeng...@gmail.com wrote:
 This series fix several bugs in current ICH SPI driver as well as
 adding byte program support for the SST25* flash.

 Flash params are updated to explicitly list supported read commands
 and change flash sector size to 4KiB as long as flash supports
 sector erase (20h) command.

 Changes for v2:
   - Rebased to u-boot-spi/mater.
   - Reviewed and updated the params of all currently supported flash
 parts per their datasheets.
   - Corrected AT25DF321 JEDEC ID.
   - Corrected Atmel bulk erase command to 50h instead of D8h.
   - Added AT25DF321A, W25X10, W25X20, W25X80 params.


 Bin Meng (12):
   spi/ich.c: Fix a bug of reading from a non-64 bytes aligned address
   spi/ich.c: Set the rx operation mode for ich 7
   spi: sf: Support byte program for sst spi flash
   sf: Update SST flash params
   sf: Update Atmel flash params
   sf: Update EON flash params
   sf: Update GigaDevice flash params
   sf: Update Macronix flash params
   sf: Update Spansion flash params
   sf: Update Micron flash params
   sf: Update Winbond flash params
   sf: Give proper spacing between flash table params

 I think you combined two or more changes(unrelated) in a common patches and
 Added Bulk erase support in e_cmd_rd of sf_params ie quite not correct.

Do you mean I should let PATCH 1/2/3 go as a separate patch set? Since
these 3 are tested on my x86 board, could it be Simon to pick up these
patches instead of through the u-boot-spi? Also I don't understand you
comments about adding bulk erase support in e_cmd_rd is not correct.
The e_cmd_rd in sf_params is updated to specify all supported read
commands the flash can support. There is no bulk erase here.

 Please fix those and send me one more.

 Mean while I will look at your scenario like you're controller only supports 
 AS,
 As I said before as AS of AF both are similar way of transferring
 except the dummy
 bits passing from the driver, try to see the fix on driver point of of
 instead of digging
 common sf stuff.

Fixing on the driver part might be possible, might be not. Even though
it is possible, I don't want to do that as the ICH manual explicitly
says fast read command (0Bh) is not supported by the controller. As
far as I can test, actually all of the commands which require an
additional dummy byte after the address cycle fail to work. The
matches what the manual says.

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


[U-Boot] SPL (Secondary Program Loader) on iMX6SL

2014-11-04 Thread John Tobias
Hi All,

I ported the SPL features of u-boot into iMX6 SabreSD. I was able to
load the SPL image and configure the DDR correctly.

Then, I ported it again on iMX6SL-evk, unfortunately, I did not get
any data on my serial port window.
I played with some different values for CCM_CCGR0 - CCM_CCGR6 and
still not getting data. I am not sure exactly what are the big
difference between the ROM code of the two chips and why it didn't
work.

Does anyone could tell me what may be the possible problem?.

Regards,

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


Re: [U-Boot] verifying signing - issue in generating private key ceritficate containing public key

2014-11-04 Thread Srinivasan S
Hi Simon


Sorry to push you hard again could you please help me in resolving the below 
issue that am facing  while generating private key  certificate containing 
public key  

ie., when executing Step 4: Create a key pair 
(http://lists.denx.de/pipermail/u-boot/2014-June/180845.html)

WARNING: can't open config file: 
/tmp///sysroots/i686-arago-linux/usr/lib/ssl/openssl.cnf
Unable to load config info from 
/tmp///sysroots/i686-arago-linux/usr/lib/ssl/openssl.cnf


Many Thanks a lot in advance

From: Srinivasan S
Sent: Tuesday, November 4, 2014 3:37 PM
To: Simon Glass
Cc: srinivasan; U-Boot Mailing List
Subject: Re: verifying  signing

Hi Simon,

When I was generating the keys ie., Step 4: Create a key pair

Am facing one more error while generating private key  certificate containing 
public key used for verification when I execute the below openssl commands it 
is saying can't open  config file:

srinivasan@tata-HP-Elite-7100-Microtower-PC:~/TUNSTALL/board-support/linux-3.12.10-ti2013.12.01/work$
 openssl genrsa -F4 -out keys/dev.key 2048
WARNING: can't open config file: 
/tmp///sysroots/i686-arago-linux/usr/lib/ssl/openssl.cnf
Generating RSA private key, 2048 bit long modulus
+++
...+++
e is 65537 (0x10001)
srinivasan@tata-HP-Elite-7100-Microtower-PC:~/TUNSTALL/board-support/linux-3.12.10-ti2013.12.01/work$
 openssl req -batch -new -x509 -key keys/dev.key -out keys/dev.crt
WARNING: can't open config file: 
/tmp///sysroots/i686-arago-linux/usr/lib/ssl/openssl.cnf
Unable to load config info from 
/tmp///sysroots/i686-arago-linux/usr/lib/ssl/openssl.cnf

Could you pls do the needful in resolving this errors cz of which am not able 
to proceed further

Many Thanks in advance


From: s...@google.com s...@google.com on behalf of Simon Glass 
s...@chromium.org
Sent: Tuesday, November 4, 2014 12:07 PM
To: Srinivasan S
Cc: srinivasan; U-Boot Mailing List
Subject: Re: verifying  signing

Hi,

On 3 November 2014 20:01, Srinivasan S srinivasa...@tataelxsi.co.in wrote:
 Hi Simon,

 Good Morning!

 Many Thanks a lot for all your support so far,

 1. With respect to the verified boot , I want to put the images onto NAND 
 FLASH, Could you please let me know what is the procedure of flashing  the 
 verified boot images onto NAND instead of micro-SD

One option would be to use UBI to provide a consistent block interface
and then sit verity on top of that. But there may be other options,
I'm not sure.


 2.Does dm-verity works only on read-only rootfs?.. or it works on read-write 
 rootfs?.. because as of  now we are looking out only for a bare minimal 
 rootfs , could you please suggest me if any rootfs with minimal support where 
 dm-verity can be applied  verified apart from android

It requires a read-only rootfs. You can enable it on a filesystem
fairly easily - you need to run a tool to generate the hashes and root
hash, then pass that to the kernel on boot. You don't need to use
Android or Chrome OS - it is available in mainline Linux. I'm not sure
if there is a cogent guide somewhere though.


  I want to implement the automatic software update  recovery feature (ie., 
 firmware update of uboot, kernel  rootfs) in ti-sdk-am335x-evm-07.00.00.00 
 BSP's , if in case if it bricks to unbrick by itself,
  Could you please help me with suitable pointers  source code links for 
 implementing this feature

This is one way.

http://www.chromium.org/chromium-os/u-boot-porting-guide/2-concepts

So ensure there can be no bricking you probably need to have a U-Boot
that you never update. It can then check the signature of a secondary
updateable U-Boot, and jump to it if it is OK. This is what Chrome OS
does.

BTW as this is a mailing list you should normally put the replies
below the text, not above.

Regards,
Simon



 Awaiting for your replies
 Many Thanks in advance again,

 Srinivasan S


 

Re: [U-Boot] [PATCH v2] mtd: nand: allow to skip BBT scanning during NAND inititialization

2014-11-04 Thread Masahiro Yamada
Hi Scott,


On Mon, 3 Nov 2014 15:40:59 -0600
Scott Wood scottw...@freescale.com wrote:

 On Thu, 2014-10-23 at 21:25 +0900, Masahiro Yamada wrote:
  Since commit ff94bc40af34 (mtd, ubi, ubifs: resync with Linux-3.14),
  chip-scan_bbt() is called at the end of nand_scan_tail().
  It means the first read access happens immediately after the generic
  NAND initialization process.
  
  It causes a problem to some SoCs of UniPhier platform because some of
  their register values need to be fixed up after the general
  initialization procedure has been finished.  Otherwise, read asccess
  fails.  Such a fix-up is SoC-specific enough to be written in a board
  file rather than in driver code.
  
  One of possible and clean enough ways to work around this issue is
  postpone the BBT scanning until necessary fix-up is done in
  board_late_init() or somewhere else.
  
  CONFIG_MTD_NAND_SKIP_BBTSCAN, if enabled, allows to skip the BBT
  scanning at the end of nand_scan_tail().
  
  Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
  Cc: Scott Wood scottw...@freescale.com
  ---
 
 Rotislav Lisovy already posted a patch to fix the regression, but I
 don't think you should be relying on this for your problem.

If you are willing to apply Rostislav's patch, I am fine.
There is no reason (at least) for me to insist on this patch any more.


Why don't
 you want to put SoC-specific knowledge in the driver?


There are two reasons:

[1] This problem occurs on some of Panasonic UniPhier SoCs.
Denali driver (drivers/mtd/nand/denali.c) is used by SOCFPGA
as well as UniPhier.
I do not think it is a good idea to put dirty and SoC-specific
work around into the driver.

[2] There is no good place to insert a callback to an SoC file.
I need to write parameters such as page_size to hardware registers.
(You can see my code, nand_denali_fixup() in 
arch/arm/cpu/armv7/uniphier/board_late_init.c)

   The NAND init procedure of U-Boot is like this:

   (1) board_nand_init()   (drivers/mtd/nand/denali.c)
   (2) nand_scan_ident()   (drivers/mtd/nand/nand_base.c)
   (3) nand_scan_tail()(drivers/mtd/nand/nand_base.c)



  (2) detects the device size and set mtd-write_size,
   mtd-erase_size, mtd-oob_size.
  I need to set these values to the Denali hardware, but
  the Denali driver code is called at (1) which is called
  before the detection of the device size.

   In Linux, nand_scan_ident() and nand_scan_tail() are called
   from each of NAND drivers, so we can use the values which
   have been set during nand_scan_ident().

   In U-Boot, I think it is impossible.




 At least make it
 a callback from the driver to an SoC file, rather than hoping the NAND
 won't be touched for a certain amount of time after the driver has told
 the subsystem I'm here and ready to be used.
 
 -Scott
 

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


Re: [U-Boot] [PATCH] nand: reinstate lazy bad block scanning

2014-11-04 Thread Masahiro Yamada
Hi Scott, Rostislav,

On Mon, 3 Nov 2014 15:42:29 -0600
Scott Wood scottw...@freescale.com wrote:

 On Wed, 2014-10-22 at 13:40 +0200, Rostislav Lisovy wrote:
  Commit ff94bc40af3481d47546595ba73c136de6af6929
  (mtd, ubi, ubifs: resync with Linux-3.14)
  accidentally reverted part of the commit
  13f0fd94e3cae6f8a0d9fba5d367e311edc8ebde
  (NAND: Scan bad blocks lazily.).
  
  Reinstate the change as by commit
  fb49454b1b6c7c6e238ac3c0b1e302e73eb1a1ea
  (nand: reinstate lazy bad block scanning)
  
  Signed-off-by: Rostislav Lisovy lis...@merica.cz
  ---
   drivers/mtd/nand/nand_base.c | 10 +++---
   1 file changed, 7 insertions(+), 3 deletions(-)
 
 Thanks for catching this.  
 
 Heiko, this is the sort of thing I was concerned about with the resync
 from scratch approach.
 

I do not believe resync is a bad idea,
of course we should be very careful not to break existing features.

I recommend to surround this code with #ifdef __UBOOT__  ... #endif
as we have done for the other parts.



BTW, we attempt to probe NAND devices during the boot sequence
just for displaying the device size, right?

NAND:   MiB


If so, can we postpone the whole of nand_scan
until we use it?  I am not sure about this, though.





Best Regards
Masahiro Yamada

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


[U-Boot] [PATCH v3 1/2] exynos5: fix GPIO information of exynos5420

2014-11-04 Thread Hyungwon Hwang
This patch fixes wrong GPIO information such as GPIO bank, table which
is used to convert GPIO name to index, bank base address, and etc.

Signed-off-by: Hyungwon Hwang human.hw...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
Cc: Lukasz Majewski l.majew...@samsung.com
---
 arch/arm/include/asm/arch-exynos/cpu.h  |  11 +-
 arch/arm/include/asm/arch-exynos/gpio.h | 232 +++-
 2 files changed, 117 insertions(+), 126 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/cpu.h 
b/arch/arm/include/asm/arch-exynos/cpu.h
index 7c5c4ff..da4ac6b 100644
--- a/arch/arm/include/asm/arch-exynos/cpu.h
+++ b/arch/arm/include/asm/arch-exynos/cpu.h
@@ -139,7 +139,7 @@
 
 /* EXYNOS5420 */
 #define EXYNOS5420_AUDIOSS_BASE0x0381
-#define EXYNOS5420_GPIO_PART6_BASE 0x0386
+#define EXYNOS5420_GPIO_PART5_BASE 0x0386
 #define EXYNOS5420_PRO_ID  0x1000
 #define EXYNOS5420_CLOCK_BASE  0x1001
 #define EXYNOS5420_POWER_BASE  0x1004
@@ -161,11 +161,10 @@
 #define EXYNOS5420_I2S_BASE0x12D6
 #define EXYNOS5420_PWMTIMER_BASE   0x12DD
 #define EXYNOS5420_SPI_ISP_BASE0x131A
-#define EXYNOS5420_GPIO_PART2_BASE 0x1340
-#define EXYNOS5420_GPIO_PART3_BASE 0x13400C00
-#define EXYNOS5420_GPIO_PART4_BASE 0x1341
-#define EXYNOS5420_GPIO_PART5_BASE 0x1400
-#define EXYNOS5420_GPIO_PART1_BASE 0x1401
+#define EXYNOS5420_GPIO_PART1_BASE 0x1340
+#define EXYNOS5420_GPIO_PART2_BASE 0x1341
+#define EXYNOS5420_GPIO_PART3_BASE 0x1400
+#define EXYNOS5420_GPIO_PART4_BASE 0x1401
 #define EXYNOS5420_MIPI_DSIM_BASE  0x1450
 #define EXYNOS5420_DP_BASE 0x145B
 
diff --git a/arch/arm/include/asm/arch-exynos/gpio.h 
b/arch/arm/include/asm/arch-exynos/gpio.h
index 32e045a..431ae3a 100644
--- a/arch/arm/include/asm/arch-exynos/gpio.h
+++ b/arch/arm/include/asm/arch-exynos/gpio.h
@@ -1028,83 +1028,7 @@ enum exynos5_gpio_pin {
 };
 
 enum exynos5420_gpio_pin {
-   /* GPIO_PART1_STARTS */
-   EXYNOS5420_GPIO_A00,/* 0 */
-   EXYNOS5420_GPIO_A01,
-   EXYNOS5420_GPIO_A02,
-   EXYNOS5420_GPIO_A03,
-   EXYNOS5420_GPIO_A04,
-   EXYNOS5420_GPIO_A05,
-   EXYNOS5420_GPIO_A06,
-   EXYNOS5420_GPIO_A07,
-   EXYNOS5420_GPIO_A10,/* 8 */
-   EXYNOS5420_GPIO_A11,
-   EXYNOS5420_GPIO_A12,
-   EXYNOS5420_GPIO_A13,
-   EXYNOS5420_GPIO_A14,
-   EXYNOS5420_GPIO_A15,
-   EXYNOS5420_GPIO_A16,
-   EXYNOS5420_GPIO_A17,
-   EXYNOS5420_GPIO_A20,/* 16 0x10 */
-   EXYNOS5420_GPIO_A21,
-   EXYNOS5420_GPIO_A22,
-   EXYNOS5420_GPIO_A23,
-   EXYNOS5420_GPIO_A24,
-   EXYNOS5420_GPIO_A25,
-   EXYNOS5420_GPIO_A26,
-   EXYNOS5420_GPIO_A27,
-   EXYNOS5420_GPIO_B00,/* 24 0x18 */
-   EXYNOS5420_GPIO_B01,
-   EXYNOS5420_GPIO_B02,
-   EXYNOS5420_GPIO_B03,
-   EXYNOS5420_GPIO_B04,
-   EXYNOS5420_GPIO_B05,
-   EXYNOS5420_GPIO_B06,
-   EXYNOS5420_GPIO_B07,
-   EXYNOS5420_GPIO_B10,/* 32 0x20 */
-   EXYNOS5420_GPIO_B11,
-   EXYNOS5420_GPIO_B12,
-   EXYNOS5420_GPIO_B13,
-   EXYNOS5420_GPIO_B14,
-   EXYNOS5420_GPIO_B15,
-   EXYNOS5420_GPIO_B16,
-   EXYNOS5420_GPIO_B17,
-   EXYNOS5420_GPIO_B20,/* 40 0x28 */
-   EXYNOS5420_GPIO_B21,
-   EXYNOS5420_GPIO_B22,
-   EXYNOS5420_GPIO_B23,
-   EXYNOS5420_GPIO_B24,
-   EXYNOS5420_GPIO_B25,
-   EXYNOS5420_GPIO_B26,
-   EXYNOS5420_GPIO_B27,
-   EXYNOS5420_GPIO_B30,/* 48 0x30 */
-   EXYNOS5420_GPIO_B31,
-   EXYNOS5420_GPIO_B32,
-   EXYNOS5420_GPIO_B33,
-   EXYNOS5420_GPIO_B34,
-   EXYNOS5420_GPIO_B35,
-   EXYNOS5420_GPIO_B36,
-   EXYNOS5420_GPIO_B37,
-   EXYNOS5420_GPIO_B40,/* 56 0x38 */
-   EXYNOS5420_GPIO_B41,
-   EXYNOS5420_GPIO_B42,
-   EXYNOS5420_GPIO_B43,
-   EXYNOS5420_GPIO_B44,
-   EXYNOS5420_GPIO_B45,
-   EXYNOS5420_GPIO_B46,
-   EXYNOS5420_GPIO_B47,
-   EXYNOS5420_GPIO_H00,/* 64 0x40 */
-   EXYNOS5420_GPIO_H01,
-   EXYNOS5420_GPIO_H02,
-   EXYNOS5420_GPIO_H03,
-   EXYNOS5420_GPIO_H04,
-   EXYNOS5420_GPIO_H05,
-   EXYNOS5420_GPIO_H06,
-   EXYNOS5420_GPIO_H07,
-
-   /* GPIO PART 2 STARTS*/
-   EXYNOS5420_GPIO_MAX_PORT_PART_1,/* 72 0x48 */
-   EXYNOS5420_GPIO_Y70 = EXYNOS5420_GPIO_MAX_PORT_PART_1,
+   EXYNOS5420_GPIO_Y70,
EXYNOS5420_GPIO_Y71,
EXYNOS5420_GPIO_Y72,
EXYNOS5420_GPIO_Y73,
@@ -1112,10 +1036,7 @@ enum exynos5420_gpio_pin {
EXYNOS5420_GPIO_Y75,
EXYNOS5420_GPIO_Y76,
EXYNOS5420_GPIO_Y77,
-
-   /* GPIO PART 3 STARTS*/
-   EXYNOS5420_GPIO_MAX_PORT_PART_2,/* 80 0x50 */
-   EXYNOS5420_GPIO_X00 = EXYNOS5420_GPIO_MAX_PORT_PART_2,
+   EXYNOS5420_GPIO_X00,
   

[U-Boot] [PATCH v3 2/2] Odroid-XU3: Add support for Odroid-XU3

2014-11-04 Thread Hyungwon Hwang
This patch adds support for Odroid-XU3.

Signed-off-by: Hyungwon Hwang human.hw...@samsung.com
Cc: Minkyu Kang mk7.k...@samsung.com
Cc: Lukasz Majewski l.majew...@samsung.com
---
Changes for v3:
- Remove unnecessary node from DT file
- Remove unnecessary features from config file
- Remove unnecessary macros from board-specific header file 
- Fix some trivial typos in comments

 arch/arm/cpu/armv7/exynos/Kconfig |   4 ++
 arch/arm/dts/Makefile |   3 +-
 arch/arm/dts/exynos5422-odroidxu3.dts |  58 +++
 board/samsung/odroid-xu3/Kconfig  |  12 
 board/samsung/odroid-xu3/MAINTAINERS  |   6 ++
 board/samsung/odroid-xu3/Makefile |   7 ++
 board/samsung/odroid-xu3/odroid-xu3.c | 131 ++
 board/samsung/odroid-xu3/setup.h  |  95 
 configs/odroid-xu3_defconfig  |   4 ++
 include/configs/odroid_xu3.h  |  74 +++
 10 files changed, 393 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/exynos5422-odroidxu3.dts
 create mode 100644 board/samsung/odroid-xu3/Kconfig
 create mode 100644 board/samsung/odroid-xu3/MAINTAINERS
 create mode 100644 board/samsung/odroid-xu3/Makefile
 create mode 100644 board/samsung/odroid-xu3/odroid-xu3.c
 create mode 100644 board/samsung/odroid-xu3/setup.h
 create mode 100644 configs/odroid-xu3_defconfig
 create mode 100644 include/configs/odroid_xu3.h

diff --git a/arch/arm/cpu/armv7/exynos/Kconfig 
b/arch/arm/cpu/armv7/exynos/Kconfig
index 3a25fee..a47cb34 100644
--- a/arch/arm/cpu/armv7/exynos/Kconfig
+++ b/arch/arm/cpu/armv7/exynos/Kconfig
@@ -22,6 +22,9 @@ config TARGET_TRATS2
 config TARGET_ODROID
bool Exynos4412 Odroid board
 
+config TARGET_ODROID_XU3
+   bool Exynos5422 Odroid board
+
 config TARGET_ARNDALE
bool Exynos5250 Arndale board
select OF_CONTROL if !SPL_BUILD
@@ -60,6 +63,7 @@ source board/samsung/universal_c210/Kconfig
 source board/samsung/origen/Kconfig
 source board/samsung/trats2/Kconfig
 source board/samsung/odroid/Kconfig
+source board/samsung/odroid-xu3/Kconfig
 source board/samsung/arndale/Kconfig
 source board/samsung/smdk5250/Kconfig
 source board/samsung/smdk5420/Kconfig
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 2dcfcc0..66191f9 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -12,7 +12,8 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \
exynos5250-smdk5250.dtb \
exynos5420-smdk5420.dtb \
exynos5420-peach-pit.dtb \
-   exynos5800-peach-pi.dtb
+   exynos5800-peach-pi.dtb \
+   exynos5422-odroidxu3.dtb
 dtb-$(CONFIG_TEGRA) += tegra20-harmony.dtb \
tegra20-medcom-wide.dtb \
tegra20-paz00.dtb \
diff --git a/arch/arm/dts/exynos5422-odroidxu3.dts 
b/arch/arm/dts/exynos5422-odroidxu3.dts
new file mode 100644
index 000..2cca27b
--- /dev/null
+++ b/arch/arm/dts/exynos5422-odroidxu3.dts
@@ -0,0 +1,58 @@
+/*
+ * Odroid XU3 device tree source
+ *
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * http://www.samsung.com
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+/dts-v1/;
+/include/ exynos54xx.dtsi
+
+/ {
+   model = Odroid XU3 based on EXYNOS5422;
+   compatible = samsung,odroidxu3, samsung,exynos5;
+
+   aliases {
+   serial0 = /serial@12C0;
+   console = /serial@12C2;
+   };
+
+   memory {
+   device_type = memory;
+   reg =  0x4000 0x1000
+   0x5000 0x1000
+   0x6000 0x1000
+   0x7000 0x1000
+   0x8000 0x1000
+   0x9000 0x1000
+   0xa000 0x1000
+   0xb000 0xea0;
+   };
+
+   serial@12C2 {
+   status=okay;
+   };
+
+   mmc@1220 {
+   samsung,bus-width = 8;
+   samsung,timing = 1 3 3;
+   samsung,removable = 0;
+   samsung,pre-init;
+   };
+
+   mmc@1221 {
+   status = disabled;
+   };
+
+   mmc@1222 {
+   samsung,bus-width = 4;
+   samsung,timing = 1 2 3;
+   samsung,removable = 1;
+   };
+
+   mmc@1223 {
+   status = disabled;
+   };
+};
diff --git a/board/samsung/odroid-xu3/Kconfig b/board/samsung/odroid-xu3/Kconfig
new file mode 100644
index 000..6159692
--- /dev/null
+++ b/board/samsung/odroid-xu3/Kconfig
@@ -0,0 +1,12 @@
+if TARGET_ODROID_XU3
+
+config SYS_BOARD
+   default odroid-xu3
+
+config SYS_VENDOR
+   default samsung
+
+config SYS_CONFIG_NAME
+   default odroid_xu3
+
+endif
diff --git a/board/samsung/odroid-xu3/MAINTAINERS 
b/board/samsung/odroid-xu3/MAINTAINERS
new file mode 100644
index 000..50cf928
--- /dev/null
+++ b/board/samsung/odroid-xu3/MAINTAINERS
@@ 

[U-Boot] [PATCH v3 0/2] Adds support for Exynos5422 odroid xu3 board

2014-11-04 Thread Hyungwon Hwang
This is v3 of the patchset adding support Odroud XU3 board.

link to the previous version:
https://www.mail-archive.com/u-boot@lists.denx.de/msg152275.html

This patchset fixes GPIO information of Exynos5420 which is needed to
support Exynos5422 Odroid XU3 board. On the base of the fixes, this
patchset adds support for Exynos5422 Odroid XU3 board. I have done
this work on the patchset submitted by Akshay Saraswat.

link: https://patchwork.ozlabs.org/patch/400043/

Changes for v2:
- Add a patch to add new common setup header file for Odroid X2/U3
and Odroid XU3
Changes for v3:
- Remove the patch which adds new common setup header file from v2
- Remove the wrong patch to fix GPIO information of Exynos 5800
- Remove unnecessary node from DT file
- Remove unnecessary features from config file
- Fix some trivial typos in comments

Hyungwon Hwang (2):
  exynos5: fix GPIO information of exynos5420
  Odroid-XU3: Add support for Odroid-XU3

 arch/arm/cpu/armv7/exynos/Kconfig   |   4 +
 arch/arm/dts/Makefile   |   3 +-
 arch/arm/dts/exynos5422-odroidxu3.dts   |  58 
 arch/arm/include/asm/arch-exynos/cpu.h  |  11 +-
 arch/arm/include/asm/arch-exynos/gpio.h | 232 +++-
 board/samsung/odroid-xu3/Kconfig|  12 ++
 board/samsung/odroid-xu3/MAINTAINERS|   6 +
 board/samsung/odroid-xu3/Makefile   |   7 +
 board/samsung/odroid-xu3/odroid-xu3.c   | 131 ++
 board/samsung/odroid-xu3/setup.h|  95 +
 configs/odroid-xu3_defconfig|   4 +
 include/configs/odroid_xu3.h|  74 ++
 12 files changed, 510 insertions(+), 127 deletions(-)
 create mode 100644 arch/arm/dts/exynos5422-odroidxu3.dts
 create mode 100644 board/samsung/odroid-xu3/Kconfig
 create mode 100644 board/samsung/odroid-xu3/MAINTAINERS
 create mode 100644 board/samsung/odroid-xu3/Makefile
 create mode 100644 board/samsung/odroid-xu3/odroid-xu3.c
 create mode 100644 board/samsung/odroid-xu3/setup.h
 create mode 100644 configs/odroid-xu3_defconfig
 create mode 100644 include/configs/odroid_xu3.h

-- 
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 0/6] kbuild, kconfig: sync with Linux 3.18-rc1

2014-11-04 Thread Masahiro Yamada
Hi Tom,


On Tue, 4 Nov 2014 10:12:15 -0500
Tom Rini tr...@ti.com wrote:

 On Thu, Oct 30, 2014 at 10:50:45AM +0900, Masahiro Yamada wrote:
 
  Masahiro Yamada (5):
kbuild: bug fixes and cleanups of Makefile.host
kbuild: improve multi-objs dependency and cleanups
kbuild: sync top Makefile with Linux 3.18-rc1
kconfig: sync kconfig files with Linux 3.18-rc1
kbuild: sync misc scripts with Linux 3.18-rc1
  
  Michal Marek (1):
kbuild: Make scripts executable
 
 So, I kinda sorta thought that we had talked about lagging behind a
 kernel release on these things, to make sure bugs get sorted out
 uptsream.  On the other hand, the kernel is up to -rc3 now, so perhaps
 we should sync to that for now and play it by ear for future syncs for
 this release?

I find no kbuild-related update since v3.18-rc1 so far.

Although there is no code diff, I can replace rc1 with rc3 in git-log
and repost this series.


Best Regards
Masahiro Yamada

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


Re: [U-Boot] verifying signing - issue in generating private key ceritficate containing public key

2014-11-04 Thread Simon Glass
Hi,

On 4 November 2014 19:36, Srinivasan S srinivasa...@tataelxsi.co.in wrote:
 Hi Simon


 Sorry to push you hard again could you please help me in resolving the below 
 issue that am facing  while generating private key  certificate containing 
 public key

 ie., when executing Step 4: Create a key pair 
 (http://lists.denx.de/pipermail/u-boot/2014-June/180845.html)

 WARNING: can't open config file: 
 /tmp///sysroots/i686-arago-linux/usr/lib/ssl/openssl.cnf
 Unable to load config info from 
 /tmp///sysroots/i686-arago-linux/usr/lib/ssl/openssl.cnf

Please don't top post.

I don't know what  is or why it appears. Did you 'mkdir keys'?

Regards,
Simon



 Many Thanks a lot in advance
 
 From: Srinivasan S
 Sent: Tuesday, November 4, 2014 3:37 PM
 To: Simon Glass
 Cc: srinivasan; U-Boot Mailing List
 Subject: Re: verifying  signing

 Hi Simon,

 When I was generating the keys ie., Step 4: Create a key pair

 Am facing one more error while generating private key  certificate 
 containing public key used for verification when I execute the below openssl 
 commands it is saying can't open  config file:

 srinivasan@tata-HP-Elite-7100-Microtower-PC:~/TUNSTALL/board-support/linux-3.12.10-ti2013.12.01/work$
  openssl genrsa -F4 -out keys/dev.key 2048
 WARNING: can't open config file: 
 /tmp///sysroots/i686-arago-linux/usr/lib/ssl/openssl.cnf
 Generating RSA private key, 2048 bit long modulus
 +++
 ...+++
 e is 65537 (0x10001)
 srinivasan@tata-HP-Elite-7100-Microtower-PC:~/TUNSTALL/board-support/linux-3.12.10-ti2013.12.01/work$
  openssl req -batch -new -x509 -key keys/dev.key -out keys/dev.crt
 WARNING: can't open config file: 
 /tmp///sysroots/i686-arago-linux/usr/lib/ssl/openssl.cnf
 Unable to load config info from 
 /tmp///sysroots/i686-arago-linux/usr/lib/ssl/openssl.cnf

 Could you pls do the needful in resolving this errors cz of which am not able 
 to proceed further

 Many Thanks in advance

 
 From: s...@google.com s...@google.com on behalf of Simon Glass 
 s...@chromium.org
 Sent: Tuesday, November 4, 2014 12:07 PM
 To: Srinivasan S
 Cc: srinivasan; U-Boot Mailing List
 Subject: Re: verifying  signing

 Hi,

 On 3 November 2014 20:01, Srinivasan S srinivasa...@tataelxsi.co.in wrote:
 Hi Simon,

 Good Morning!

 Many Thanks a lot for all your support so far,

 1. With respect to the verified boot , I want to put the images onto NAND 
 FLASH, Could you please let me know what is the procedure of flashing  the 
 verified boot images onto NAND instead of micro-SD

 One option would be to use UBI to provide a consistent block interface
 and then sit verity on top of that. But there may be other options,
 I'm not sure.


 2.Does dm-verity works only on read-only rootfs?.. or it works on read-write 
 rootfs?.. because as of  now we are looking out only for a bare minimal 
 rootfs , could you please suggest me if any rootfs with minimal support 
 where dm-verity can be applied  verified apart from android

 It requires a read-only rootfs. You can enable it on a filesystem
 fairly easily - you need to run a tool to generate the hashes and root
 hash, then pass that to the kernel on boot. You don't need to use
 Android or Chrome OS - it is available in mainline Linux. I'm not sure
 if there is a cogent guide somewhere though.


  I want to implement the automatic software update  recovery feature (ie., 
 firmware update of uboot, kernel  rootfs) in ti-sdk-am335x-evm-07.00.00.00 
 BSP's , if in case if it bricks to unbrick by itself,
  Could you please help me with suitable pointers  source code links for 
 implementing this feature

 This is one way.

 http://www.chromium.org/chromium-os/u-boot-porting-guide/2-concepts

 So ensure there can be no bricking you probably need to have a U-Boot
 that you never update. It can then check the signature of a secondary
 updateable U-Boot, and jump to it if it is OK. This 

Re: [U-Boot] [PATCH 6/6] linux/kernel.h: sync min, max, min3, max3 macros with Linux

2014-11-04 Thread Masahiro Yamada
Hi Pavel,

Thanks for your close checking.


On Tue, 4 Nov 2014 20:50:13 +0100
Pavel Machek pa...@denx.de wrote:

 On Tue 2014-11-04 20:26:26, Masahiro Yamada wrote:
  U-Boot has never cared about the type when we get max/min of two
  values, but Linux Kernel does.  This commit gets min, max, min3, max3
  macros synced with the kernel introduing type checks.
 
 introducing


I will fix this.



  Many of references of those macros must be fixed to suppress warnings.
  We have two options:
   - Use min, max, min3, max3 only when the arguments have the same type
 (or add casts to the arguments)
   - Use min_t/max_t instead with the appropriate type for the first
 argument
  
  Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
 
 Acked-by: Pavel Machek pa...@denx.de
 
 [I guess the conversion is okay, as is, still, there are places where
 code could be cleaned up afterwards...]

Fully agreed.
In some places, I think we should change the variable types as you suggested
but it is beyond the motivation of this series.





  -   for (postdiv = 1; postdiv = min(div, MAX_POSTDIV); postdiv++) {
  +   for (postdiv = 1; postdiv = min(div, (unsigned 
  long)MAX_POSTDIV);
  +   postdiv++) {
 
 It might be cleaner to change MAX_POSTDIV definition to include UL?


Sounds good to me.



 
  @@ -1838,12 +1838,18 @@ static void program_tr(unsigned long 
  *dimm_populated,
  else
  sdram_ddr1 = false;
   
  -   t_rcd_ns = max(t_rcd_ns, 
  spd_read(iic0_dimm_addr[dimm_num], 29)  2);
  -   t_rrd_ns = max(t_rrd_ns, 
  spd_read(iic0_dimm_addr[dimm_num], 28)  2);
  -   t_rp_ns  = max(t_rp_ns,  
  spd_read(iic0_dimm_addr[dimm_num], 27)  2);
  -   t_ras_ns = max(t_ras_ns, 
  spd_read(iic0_dimm_addr[dimm_num], 30));
  -   t_rc_ns  = max(t_rc_ns,  
  spd_read(iic0_dimm_addr[dimm_num], 41));
  -   t_rfc_ns = max(t_rfc_ns, 
  spd_read(iic0_dimm_addr[dimm_num], 42));
  +   t_rcd_ns = max(t_rcd_ns,
  +  (unsigned 
  long)spd_read(iic0_dimm_addr[dimm_num], 29)  2);
  +   t_rrd_ns = max(t_rrd_ns,
  +  (unsigned 
  long)spd_read(iic0_dimm_addr[dimm_num], 28)  2);
  +   t_rp_ns  = max(t_rp_ns,
  +  (unsigned 
  long)spd_read(iic0_dimm_addr[dimm_num], 27)  2);
  +   t_ras_ns = max(t_ras_ns,
  +  (unsigned 
  long)spd_read(iic0_dimm_addr[dimm_num], 30));
  +   t_rc_ns  = max(t_rc_ns,
  +  (unsigned 
  long)spd_read(iic0_dimm_addr[dimm_num], 41));
  +   t_rfc_ns = max(t_rfc_ns,
  +  (unsigned 
  long)spd_read(iic0_dimm_addr[dimm_num], 42));
  }
  }
 
 Would it be feasible to make spd_read return unsigned long?


I am not familiar enough with this code
to judge this.




  diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
  index b3d7051..b7e12ab 100644
  --- a/arch/sandbox/cpu/start.c
  +++ b/arch/sandbox/cpu/start.c
  @@ -38,7 +38,7 @@ int sandbox_early_getopt_check(void)
   
  max_arg_len = 0;
  for (i = 0; i  num_options; ++i)
  -   max_arg_len = max(strlen(sb_opt[i]-flag), max_arg_len);
  +   max_arg_len = max((int)strlen(sb_opt[i]-flag), max_arg_len);
  max_noarg_len = max_arg_len + 7;
   
  for (i = 0; i  num_options; ++i) {
 
 make max_arg_len size_t?
 
  diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
  index 623f749..677c89f 100644
  --- a/drivers/net/netconsole.c
  +++ b/drivers/net/netconsole.c
  @@ -256,7 +256,7 @@ static void nc_puts(struct stdio_dev *dev, const char 
  *s)
   
  len = strlen(s);
  while (len) {
  -   int send_len = min(len, sizeof(input_buffer));
  +   int send_len = min(len, (int)sizeof(input_buffer));
  nc_send_packet(s, send_len);
  len -= send_len;
  s += send_len;
 
 Looks like len/send_len wants to be size_t here.
 
 Actually, I'd argue that anytime you need to explicitly cast one
 argument would be good time to use _t variant... but that would mean
 redoing rather big patch.
 
 min((int) a, b) - min_t(int, a, b).


Agreed but I think we should do this
after we understand the code well.



Best Regards
Masahiro Yamada

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


[U-Boot] [PATCH] ARM: UniPhier: reset on-board devices on start-up

2014-11-04 Thread Masahiro Yamada
If a support card is attached to the main board, the on-board
SMSC9118 LAN controller is available.  It must be kept in reset
state for a while on start-up.

When the board is kicked via a debbuger rather than pushing the
hardware reset button, on-board chips are not reset; in this case
the reset signals should be asserted by software.

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
---

 arch/arm/cpu/armv7/uniphier/ph1-ld4/board_postclk_init.c  | 2 ++
 arch/arm/cpu/armv7/uniphier/ph1-pro4/board_postclk_init.c | 2 ++
 arch/arm/cpu/armv7/uniphier/reset.c   | 3 ---
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/cpu/armv7/uniphier/ph1-ld4/board_postclk_init.c 
b/arch/arm/cpu/armv7/uniphier/ph1-ld4/board_postclk_init.c
index 4302277..5bb8179 100644
--- a/arch/arm/cpu/armv7/uniphier/ph1-ld4/board_postclk_init.c
+++ b/arch/arm/cpu/armv7/uniphier/ph1-ld4/board_postclk_init.c
@@ -24,6 +24,8 @@ int board_postclk_init(void)
 
sg_init();
 
+   uniphier_board_reset();
+
pll_init();
 
uniphier_board_init();
diff --git a/arch/arm/cpu/armv7/uniphier/ph1-pro4/board_postclk_init.c 
b/arch/arm/cpu/armv7/uniphier/ph1-pro4/board_postclk_init.c
index 7198829..9a53743 100644
--- a/arch/arm/cpu/armv7/uniphier/ph1-pro4/board_postclk_init.c
+++ b/arch/arm/cpu/armv7/uniphier/ph1-pro4/board_postclk_init.c
@@ -21,6 +21,8 @@ int board_postclk_init(void)
 
sg_init();
 
+   uniphier_board_reset();
+
pll_init();
 
uniphier_board_init();
diff --git a/arch/arm/cpu/armv7/uniphier/reset.c 
b/arch/arm/cpu/armv7/uniphier/reset.c
index b0dc967..50d1fed 100644
--- a/arch/arm/cpu/armv7/uniphier/reset.c
+++ b/arch/arm/cpu/armv7/uniphier/reset.c
@@ -8,14 +8,11 @@
 #include common.h
 #include asm/io.h
 #include asm/arch/sc-regs.h
-#include asm/arch/board.h
 
 void reset_cpu(unsigned long ignored)
 {
u32 tmp;
 
-   uniphier_board_reset();
-
writel(5, SC_IRQTIMSET); /* default value */
 
tmp  = readl(SC_SLFRSTSEL);
-- 
1.9.1

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


Re: [U-Boot] [PATCH v2] mtd: nand: allow to skip BBT scanning during NAND inititialization

2014-11-04 Thread Scott Wood
On Wed, 2014-11-05 at 12:39 +0900, Masahiro Yamada wrote:
 [2] There is no good place to insert a callback to an SoC file.
 I need to write parameters such as page_size to hardware registers.
 (You can see my code, nand_denali_fixup() in 
 arch/arm/cpu/armv7/uniphier/board_late_init.c)
 
The NAND init procedure of U-Boot is like this:
 
(1) board_nand_init()   (drivers/mtd/nand/denali.c)
(2) nand_scan_ident()   (drivers/mtd/nand/nand_base.c)
(3) nand_scan_tail()(drivers/mtd/nand/nand_base.c)
 
 
 
   (2) detects the device size and set mtd-write_size,
mtd-erase_size, mtd-oob_size.
   I need to set these values to the Denali hardware, but
   the Denali driver code is called at (1) which is called
   before the detection of the device size.
 
In Linux, nand_scan_ident() and nand_scan_tail() are called
from each of NAND drivers, so we can use the values which
have been set during nand_scan_ident().
 
In U-Boot, I think it is impossible.

If you use CONFIG_SYS_NAND_SELF_INIT you can insert code between
nand_scan_ident() and nand_scan_tail(), just like in Linux.

-Scott


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


Re: [U-Boot] [PATCH] nand: reinstate lazy bad block scanning

2014-11-04 Thread Scott Wood
On Wed, 2014-11-05 at 12:40 +0900, Masahiro Yamada wrote:
 Hi Scott, Rostislav,
 
 On Mon, 3 Nov 2014 15:42:29 -0600
 Scott Wood scottw...@freescale.com wrote:
 
  On Wed, 2014-10-22 at 13:40 +0200, Rostislav Lisovy wrote:
   Commit ff94bc40af3481d47546595ba73c136de6af6929
   (mtd, ubi, ubifs: resync with Linux-3.14)
   accidentally reverted part of the commit
   13f0fd94e3cae6f8a0d9fba5d367e311edc8ebde
   (NAND: Scan bad blocks lazily.).
   
   Reinstate the change as by commit
   fb49454b1b6c7c6e238ac3c0b1e302e73eb1a1ea
   (nand: reinstate lazy bad block scanning)
   
   Signed-off-by: Rostislav Lisovy lis...@merica.cz
   ---
drivers/mtd/nand/nand_base.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
  
  Thanks for catching this.  
  
  Heiko, this is the sort of thing I was concerned about with the resync
  from scratch approach.
  
 
 I do not believe resync is a bad idea,
 of course we should be very careful not to break existing features.

I'm not saying don't sync -- I'm saying do it by generating a diff based
on the last sync (which is what all the previous NAND updates did),
rather than throwing out the U-Boot code and replacing it with Linux
files, and then fixing any problems encountered (which may be a subset
of the problems existing).

 I recommend to surround this code with #ifdef __UBOOT__  ... #endif
 as we have done for the other parts.

I recommend not making such a mess, for reasons I've described
previously.

 BTW, we attempt to probe NAND devices during the boot sequence
 just for displaying the device size, right?
 
 NAND:   MiB
 
 
 If so, can we postpone the whole of nand_scan
 until we use it?  I am not sure about this, though.

Possibly.  IIRC someone once posted a patch trying to do this, but it
was missing an initialization check on some paths where NAND could be
accessed, and the patchset never got respun.

-Scott


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


Re: [U-Boot] [PATCH v2 1/3] usb:ehci-mx6 add board_ehci_usb_mode function

2014-11-04 Thread Peng Fan



在 11/5/2014 1:33 AM, Marek Vasut 写道:

On Tuesday, November 04, 2014 at 02:29:56 PM, Peng Fan wrote:

Hi Marek,

在 11/4/2014 7:01 PM, Marek Vasut 写道:

On Tuesday, November 04, 2014 at 11:50:29 AM, Peng Fan wrote:

在 11/4/2014 6:33 PM, Marek Vasut 写道:

On Tuesday, November 04, 2014 at 08:50:00 AM, Peng Fan wrote:

Include a weak function board_ehci_usb_mode to gives board code
a choice.


What choice?


If the board want the otg port work in host mode but not
device mode, this should be handled.


How?

Also, isn't usb_phy_enable() supposed to do exactly this kind of
selection between device and host mode ?


In mx6sxsabresd board, there are two usb port, one used for otg, the
other used for host. However they are connected to SOC USB controller
otg1 core and otg2 core respectively. Like following:

OTG1 CORE  board otg port
OTG2 CORE  board host port

However the board do not have ID pin set for board host port. If just
use usb_phy_enable, the board host port will not work, because
type = usb_phy_enable(index, ehci) ? USB_INIT_DEVICE : USB_INIT_HOST;
will always set type with USB_INIT_DEVICE.

Because i did not find way to handle this situation in
board/freescale/mx6sxsabresd/mx6sxsabresd.c, add this function to let
board level code handle handle 'type', if board level code want to set
it's own 'type'.


This part in usb_phy_enable()

163 return val  USBPHY_CTRL_OTG_ID;

should be replaced by some kind of a board-specific callback then, with
default implmentation being the above (reading the phy ctrl register).


How about using the following piece of code?
in ehci-mx6.c

unsigned int __weak board_usb_phy_mode(int index, unsigned int val)
{
return val  USBPHY_CTRL_OTG_ID;
}

replace return val  USBPHY_CTRL_OTG_ID; using 
return board_usb_phy_mode(index, val);

In board file,
unsigned int board_usb_phy_mode(int index, unsigned int val)


Why not pass in full struct usb_ehci * instead ? Passing some ad-hoc $val into
the function doesn't seem like a scalable future-proof solution.
[...]


Passing struct usb_ehci * to board code seems exports ehci register 
definition to board layer. How about just use
int board_usb_phy_mode(int index) without using 'val' or 'struct 
usb_ehci *ehci'.



Best regards,
Marek Vasut


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


[U-Boot] [PATCH v6] net/phy: Add support for CS4315/CS4340 PHY

2014-11-04 Thread Shengzhou Liu
Add support for Cortina CS4315/CS4340 10G PHY.
- This driver loads CS43xx firmware from NOR/NAND/SPI/SD device
  to initialize Cortina PHY.
- Cortina PHY has non-standard offset of PHY ID registers, thus
  we define own get_phy_id() to override default get_phy_id().
- To define macro CONFIG_PHY_CORTINA will enable this driver.

Signed-off-by: Shengzhou Liu shengzhou@freescale.com
---
v6: polish it in phy.c and phy.h in alphabetical order 
v5: fix unclaimed variable in case of nand boot.
v4: add support for loading cortina phy ucode from NAND/SPI/SD
v3: move devad as '0' in cortina.c instead of in phy.c
v2: no change.

 drivers/net/phy/Makefile  |   1 +
 drivers/net/phy/cortina.c | 333 ++
 drivers/net/phy/phy.c |   3 +
 include/cortina.h |  73 ++
 include/phy.h |   2 +
 5 files changed, 412 insertions(+)
 create mode 100644 drivers/net/phy/cortina.c
 create mode 100644 include/cortina.h

diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile
index 9556536..ffbaef7 100644
--- a/drivers/net/phy/Makefile
+++ b/drivers/net/phy/Makefile
@@ -23,3 +23,4 @@ obj-$(CONFIG_PHY_REALTEK) += realtek.o
 obj-$(CONFIG_PHY_SMSC) += smsc.o
 obj-$(CONFIG_PHY_TERANETICS) += teranetics.o
 obj-$(CONFIG_PHY_VITESSE) += vitesse.o
+obj-$(CONFIG_PHY_CORTINA) += cortina.o
diff --git a/drivers/net/phy/cortina.c b/drivers/net/phy/cortina.c
new file mode 100644
index 000..e27dfed
--- /dev/null
+++ b/drivers/net/phy/cortina.c
@@ -0,0 +1,333 @@
+/*
+ * Cortina CS4315/CS4340 10G PHY drivers
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ */
+
+#include config.h
+#include common.h
+#include malloc.h
+#include linux/ctype.h
+#include linux/string.h
+#include linux/err.h
+#include phy.h
+#include cortina.h
+#ifdef CONFIG_SYS_CORTINA_FW_IN_NAND
+#include nand.h
+#elif defined(CONFIG_SYS_CORTINA_FW_IN_SPIFLASH)
+#include spi_flash.h
+#elif defined(CONFIG_SYS_CORTINA_FW_IN_MMC)
+#include mmc.h
+#endif
+
+#ifndef CONFIG_PHYLIB_10G
+#error The Cortina PHY needs 10G support
+#endif
+
+struct cortina_reg_config cortina_reg_cfg[] = {
+   /* CS4315_enable_sr_mode */
+   {VILLA_GLOBAL_MSEQCLKCTRL, 0x8004},
+   {VILLA_MSEQ_OPTIONS, 0xf},
+   {VILLA_MSEQ_PC, 0x0},
+   {VILLA_MSEQ_BANKSELECT,0x4},
+   {VILLA_LINE_SDS_COMMON_SRX0_RX_CPA, 0x55},
+   {VILLA_LINE_SDS_COMMON_SRX0_RX_LOOP_FILTER, 0x30},
+   {VILLA_DSP_SDS_SERDES_SRX_DFE0_SELECT, 0x1},
+   {VILLA_DSP_SDS_DSP_COEF_DFE0_SELECT, 0x2},
+   {VILLA_LINE_SDS_COMMON_SRX0_RX_CPB, 0x2003},
+   {VILLA_DSP_SDS_SERDES_SRX_FFE_DELAY_CTRL, 0xF047},
+   {VILLA_MSEQ_ENABLE_MSB, 0x},
+   {VILLA_MSEQ_SPARE21_LSB, 0x6},
+   {VILLA_MSEQ_RESET_COUNT_LSB, 0x0},
+   {VILLA_MSEQ_SPARE12_MSB, 0x},
+   /*
+* to invert the receiver path, uncomment the next line
+* write (VILLA_MSEQ_SPARE12_MSB, 0x4000)
+*
+* SPARE2_LSB is used to configure the device while in sr mode to
+* enable power savings and to use the optical module LOS signal.
+* in power savings mode, the internal prbs checker can not be used.
+* if the optical module LOS signal is used as an input to the micro
+* code, then the micro code will wait until the optical module
+* LOS = 0 before turning on the adaptive equalizer.
+* Setting SPARE2_LSB bit 0 to 1 places the devie in power savings mode
+* while setting bit 0 to 0 disables power savings mode.
+* Setting SPARE2_LSB bit 2 to 0 configures the device to use the
+* optical module LOS signal while setting bit 2 to 1 configures the
+* device so that it will ignore the optical module LOS SPARE2_LSB = 0
+*/
+
+   /* enable power savings, ignore optical module LOS */
+   {VILLA_MSEQ_SPARE2_LSB, 0x5},
+
+   {VILLA_MSEQ_SPARE7_LSB, 0x1e},
+   {VILLA_MSEQ_BANKSELECT, 0x4},
+   {VILLA_MSEQ_SPARE9_LSB, 0x2},
+   {VILLA_MSEQ_SPARE3_LSB, 0x0F53},
+   {VILLA_MSEQ_SPARE3_MSB, 0x2006},
+   {VILLA_MSEQ_SPARE8_LSB, 0x3FF7},
+   {VILLA_MSEQ_SPARE8_MSB, 0x0A46},
+   {VILLA_MSEQ_COEF8_FFE0_LSB, 0xD500},
+   {VILLA_MSEQ_COEF8_FFE1_LSB, 0x0200},
+   {VILLA_MSEQ_COEF8_FFE2_LSB, 0xBA00},
+   {VILLA_MSEQ_COEF8_FFE3_LSB, 0x0100},
+   {VILLA_MSEQ_COEF8_FFE4_LSB, 0x0300},
+   {VILLA_MSEQ_COEF8_FFE5_LSB, 0x0300},
+   {VILLA_MSEQ_COEF8_DFE0_LSB, 0x0700},
+   {VILLA_MSEQ_COEF8_DFE0N_LSB, 0x0E00},
+   {VILLA_MSEQ_COEF8_DFE1_LSB, 0x0B00},
+   {VILLA_DSP_SDS_DSP_COEF_LARGE_LEAK, 0x2},
+   {VILLA_DSP_SDS_SERDES_SRX_DAC_ENABLEB_LSB, 0xD000},
+   {VILLA_MSEQ_POWER_DOWN_LSB, 0x},
+   {VILLA_MSEQ_POWER_DOWN_MSB, 0x0},
+   {VILLA_MSEQ_CAL_RX_SLICER, 0x80},
+   {VILLA_DSP_SDS_SERDES_SRX_DAC_BIAS_SELECT1_MSB, 0x3f},
+   {VILLA_GLOBAL_MSEQCLKCTRL, 0x4},
+   {VILLA_MSEQ_OPTIONS, 0x7},
+
+   /* set up 

Re: [U-Boot] [PATCH 6/6] linux/kernel.h: sync min, max, min3, max3 macros with Linux

2014-11-04 Thread Marek Vasut
On Wednesday, November 05, 2014 at 06:06:09 AM, Masahiro Yamada wrote:
 Hi Pavel,
 
 Thanks for your close checking.
 
 
 On Tue, 4 Nov 2014 20:50:13 +0100
 
 Pavel Machek pa...@denx.de wrote:
  On Tue 2014-11-04 20:26:26, Masahiro Yamada wrote:
   U-Boot has never cared about the type when we get max/min of two
   values, but Linux Kernel does.  This commit gets min, max, min3, max3
   macros synced with the kernel introduing type checks.
  
  introducing
 
 I will fix this.

Are you linting the patches with aspell or something ?
[...]
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] MAINTAINERS: CFI flash maintainership only includes the CFI related files

2014-11-04 Thread Heiko Schocher

Hello Stefan,

Am 31.10.2014 13:57, schrieb Stefan Roese:

All the other files in drivers/mtd/* are not really CFI related. So lets
only include the files that are CFI specific.

Signed-off-by: Stefan Roeses...@denx.de
Cc: Heiko Schocherh...@denx.de
Cc: Scott Woodscottw...@freescale.com
Cc: Masahiro Yamadayamad...@jp.panasonic.com
Cc: Jagan Tekijagannadh.t...@gmail.com
---
  MAINTAINERS | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)


Thanks for updating!

Acked-by: Heiko Schocher h...@denx.de

bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] ubi: enable error reporting in initialization

2014-11-04 Thread Heiko Schocher

Hello Andrew,

Am 04.11.2014 17:07, schrieb Andrew Ruder:

The UBI layer will disable much of its error reporting when it is
compiled into the linux kernel to avoid stopping boot.  We want this
error reporting in U-Boot since we don't initialize the UBI layer until
it is used and want the error reporting.

We force this by telling the UBI layer we are building as a module.

Signed-off-by: Andrew Ruderandrew.ru...@elecsyscorp.com
Cc: Wolfgang Denkw...@denx.de
Cc: Heiko Schocherh...@denx.de
Cc: Kyungmin Parkkmp...@infradead.org
---
  include/ubi_uboot.h | 2 ++
  1 file changed, 2 insertions(+)


I posted such a question [1] on the ML ...

The problem is in generally enabling this feature in the size impact ...
This should be discussed if we want this for all boards ...


diff --git a/include/ubi_uboot.h b/include/ubi_uboot.h
index 1fd15f4..6ff0e23 100644
--- a/include/ubi_uboot.h
+++ b/include/ubi_uboot.h
@@ -51,6 +51,8 @@

  #undef CONFIG_MTD_UBI_BLOCK

+#define CONFIG_MTD_UBI_MODULE
+
  #if !defined(CONFIG_MTD_UBI_BEB_LIMIT)
  #define CONFIG_MTD_UBI_BEB_LIMIT  20
  #endif


Ok, didn;t tried this with enabling CONFIG_MTD_UBI_MODULE ...
But the name CONFIG_MTD_UBI_MODULE is not perfect, if we want
just to enable error messages ...

bye,
Heiko

[1] http://patchwork.ozlabs.org/patch/405259/
--
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/2] mtd: nor: initialize writebufsize field

2014-11-04 Thread Heiko Schocher

Hello Andrew,

Am 04.11.2014 17:07, schrieb Andrew Ruder:

UBI drivers error out if writebufsize is not filled in correctly.  Grab
this information from the CFI flash_info struct.

Signed-off-by: Andrew Ruderandrew.ru...@elecsyscorp.com
Cc: Wolfgang Denkw...@denx.de
Cc: Heiko Schocherh...@denx.de
Cc: Stefan Roeses...@denx.de
---
  drivers/mtd/cfi_mtd.c | 1 +
  1 file changed, 1 insertion(+)


Patch already posted on the ML, see [1]

If this Patch works for you, could you send an Acked-by for it?



diff --git a/drivers/mtd/cfi_mtd.c b/drivers/mtd/cfi_mtd.c
index ac805ff..d4c9609 100644
--- a/drivers/mtd/cfi_mtd.c
+++ b/drivers/mtd/cfi_mtd.c
@@ -226,6 +226,7 @@ int cfi_mtd_init(void)
mtd-flags   = MTD_CAP_NORFLASH;
mtd-size= fi-size;
mtd-writesize   = 1;
+   mtd-writebufsize= fi-buffer_size;

  ^ should be cfi

This is a typo ... your patch would not compile ... please just
ack the patch [1], thanks!

bye,
Heiko

[1] Patchwork [U-Boot,v2] mtd, cfi, ubi: add missing writebufsize initialization
http://patchwork.ozlabs.org/patch/405260/
--
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] doc: fix documentation of output directory

2014-11-04 Thread Masahiro Yamada
Hi Timo,


On Tue, 4 Nov 2014 12:56:50 +0200
Timo Ketola t...@exertus.fi wrote:

  
 diff --git a/doc/README.kwbimage b/doc/README.kwbimage
 index 13f6f92..8c02298 100644
 --- a/doc/README.kwbimage
 +++ b/doc/README.kwbimage
 @@ -30,10 +30,10 @@ kwbimage support available with mkimage utility will 
 generate kirkwood boot
  image that can be flashed on the board NAND/SPI flash.  The make target
  which uses mkimage to produce such an image is u-boot.kwb.  For example:
  
 -  export BUILD_DIR=/tmp/build
 +  export KBUILD_OUTPUT=/tmp/build

Correct.


make distclean
make yourboard_config
 -  make $BUILD_DIR/u-boot.kwb
 +  make $KBUILD_OUTPUT/u-boot.kwb
  
  

Should be
make yourboard_defconfig
make u-boot.kwb



Best Regards
Masahiro Yamada

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


[U-Boot] at91, usb, dfu: add dfu support for at91 boards

2014-11-04 Thread Heiko Schocher

Hello all,

I have a request for implementing DFU support an at91 based boards
(in this case for the siemens at91 boards corvus, taurus both in
mainline).

I found in include/configs/sama5d3xek.h

/* USB */
#define CONFIG_CMD_USB

#ifdef CONFIG_CMD_USB
#define CONFIG_USB_ATMEL
#define CONFIG_USB_ATMEL_CLK_SEL_UPLL
#define CONFIG_USB_OHCI_NEW
#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE   ATMEL_BASE_OHCI
#define CONFIG_SYS_USB_OHCI_SLOT_NAME   sama5d3
#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS  3
#define CONFIG_DOS_PARTITION
#define CONFIG_USB_STORAGE
#endif

/* USB device */
#define CONFIG_USB_GADGET
#define CONFIG_USB_GADGET_DUALSPEED
#define CONFIG_USB_GADGET_ATMEL_USBA
#define CONFIG_USB_ETHER
#define CONFIG_USB_ETH_RNDIS
#define CONFIG_USBNET_MANUFACTURER  Atmel SAMA5D3xEK

So, if I am correct, that USB gadget support should work on at91 (and
so DFU support should not be to hard to implement)?

Any hints, ideas?

bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] at91, usb, dfu: add dfu support for at91 boards

2014-11-04 Thread Bo Shen

Hi Heiko,

On 11/05/2014 03:30 PM, Heiko Schocher wrote:

Hello all,

I have a request for implementing DFU support an at91 based boards
(in this case for the siemens at91 boards corvus, taurus both in
mainline).

I found in include/configs/sama5d3xek.h

/* USB */
#define CONFIG_CMD_USB

#ifdef CONFIG_CMD_USB
#define CONFIG_USB_ATMEL
#define CONFIG_USB_ATMEL_CLK_SEL_UPLL
#define CONFIG_USB_OHCI_NEW
#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE   ATMEL_BASE_OHCI
#define CONFIG_SYS_USB_OHCI_SLOT_NAME   sama5d3
#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS  3
#define CONFIG_DOS_PARTITION
#define CONFIG_USB_STORAGE
#endif

/* USB device */
#define CONFIG_USB_GADGET
#define CONFIG_USB_GADGET_DUALSPEED
#define CONFIG_USB_GADGET_ATMEL_USBA
#define CONFIG_USB_ETHER
#define CONFIG_USB_ETH_RNDIS
#define CONFIG_USBNET_MANUFACTURER  Atmel SAMA5D3xEK

So, if I am correct, that USB gadget support should work on at91 (and
so DFU support should not be to hard to implement)?


The usb gadget driver for AT91 series, now it just support UDPHS gadget 
while not UDP gadget.
So, for the corvus board, it use at91sam9m10g45 which has UDPHS. So it 
will be easily. For the taurus board, it uses at91sam9260, it needs more 
work to do, need porting the gadget driver from Linux.


For DFU supports on sama5d3xek board.
https://github.com/linux4sam/u-boot-at91/commit/5030c6a0b4199243d54d87d01f76e8d6a2c057f3


Any hints, ideas?

bye,
Heiko


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


[U-Boot] [PATCH v2 6/6] linux/kernel.h: sync min, max, min3, max3 macros with Linux

2014-11-04 Thread Masahiro Yamada
U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does.  This commit gets min, max, min3, max3
macros synced with the kernel introducing type checks.

Many of references of those macros must be fixed to suppress warnings.
We have two options:
 - Use min, max, min3, max3 only when the arguments have the same type
   (or add casts to the arguments)
 - Use min_t/max_t instead with the appropriate type for the first
   argument

Signed-off-by: Masahiro Yamada yamad...@jp.panasonic.com
Acked-by: Pavel Machek pa...@denx.de
---

Changes in v2:
 - Fix a typo:  s/introduing/introducing/
 - Change arch/arm/cpu/arm1176/tnetv107x/clock.c
 #define MAXPOSTDIV8UL  seems better than adding a cast.

 arch/arm/cpu/arm1176/tnetv107x/clock.c|  4 +-
 arch/arm/cpu/armv7/exynos/clock.c |  4 +-
 arch/arm/cpu/armv7/tegra20/display.c  |  4 +-
 arch/avr32/cpu/at32ap700x/clk.c   |  2 +-
 arch/blackfin/cpu/jtag-console.c  |  2 +-
 arch/blackfin/lib/string.c|  2 +-
 arch/powerpc/cpu/mpc85xx/tlb.c|  2 +-
 arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c| 32 ++--
 arch/powerpc/lib/bootm.c  |  2 +-
 arch/sandbox/cpu/start.c  |  2 +-
 arch/x86/cpu/coreboot/pci.c   |  2 +-
 arch/x86/cpu/coreboot/sdram.c |  2 +-
 board/freescale/common/sys_eeprom.c   |  6 +--
 board/gdsys/p1022/controlcenterd-id.c |  5 ++-
 board/imgtec/malta/malta.c|  2 +-
 common/cmd_elf.c  | 12 +++---
 common/cmd_sf.c   | 16 
 common/env_nand.c |  4 +-
 common/fdt_support.c  |  3 +-
 common/lcd.c  |  6 +--
 common/usb_hub.c  |  3 +-
 drivers/block/ahci.c  |  2 +-
 drivers/ddr/fsl/ctrl_regs.c   | 22 +--
 drivers/ddr/fsl/lc_common_dimm_params.c   | 62 ++-
 drivers/ddr/fsl/main.c|  3 +-
 drivers/dfu/dfu.c |  2 +-
 drivers/i2c/fsl_i2c.c |  2 +-
 drivers/misc/cros_ec_spi.c|  2 +-
 drivers/mmc/fsl_esdhc.c   |  2 +-
 drivers/mmc/pxa_mmc_gen.c |  6 +--
 drivers/mtd/nand/denali_spl.c |  2 +-
 drivers/mtd/spi/sandbox.c |  2 +-
 drivers/mtd/spi/sf_ops.c  |  5 ++-
 drivers/net/netconsole.c  |  2 +-
 drivers/pci/pci.c |  6 ++-
 drivers/pci/pci_auto.c|  2 +-
 drivers/serial/usbtty.c   |  2 +-
 drivers/spi/fsl_espi.c|  4 +-
 drivers/spi/mxc_spi.c |  2 +-
 drivers/spi/spi-uclass.c  |  2 +-
 drivers/tpm/tpm_tis_lpc.c |  2 +-
 drivers/usb/gadget/composite.c|  4 +-
 drivers/usb/gadget/designware_udc.c   |  4 +-
 drivers/usb/gadget/pxa27x_udc.c   |  3 +-
 drivers/usb/gadget/s3c_udc_otg_xfer_dma.c |  4 +-
 drivers/usb/host/dwc2.c   | 14 +++
 drivers/usb/host/ehci-hcd.c   |  2 +-
 drivers/usb/host/xhci-ring.c  |  2 +-
 drivers/usb/host/xhci.c   |  2 +-
 drivers/video/cfb_console.c   | 18 -
 fs/ext4/dev.c | 13 +++
 fs/fat/fat.c  |  2 +-
 include/linux/kernel.h| 17 ++---
 53 files changed, 178 insertions(+), 158 deletions(-)

diff --git a/arch/arm/cpu/arm1176/tnetv107x/clock.c 
b/arch/arm/cpu/arm1176/tnetv107x/clock.c
index 47c23bb..7ba28d3 100644
--- a/arch/arm/cpu/arm1176/tnetv107x/clock.c
+++ b/arch/arm/cpu/arm1176/tnetv107x/clock.c
@@ -16,7 +16,7 @@
 #define BIT(x) (1  (x))
 
 #define MAX_PREDIV 64
-#define MAX_POSTDIV8
+#define MAX_POSTDIV8UL
 #define MAX_MULT   512
 #define MAX_DIV(MAX_PREDIV * MAX_POSTDIV)
 
@@ -362,7 +362,7 @@ static void init_pll(const struct pll_init_data *data)
pllctl_reg_write(data-pll, ctl, tmp);
 
mult = data-pll_freq / fpll;
-   for (mult = max(mult, 1); mult = MAX_MULT; mult++) {
+   for (mult = max(mult, 1UL); mult = MAX_MULT; mult++) {
div = (fpll * mult) / data-pll_freq;
if (div  1 || div  MAX_DIV)
continue;
diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index 7558eff..c0c95fb 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -1422,8 +1422,8 @@ static int clock_calc_best_scalar(unsigned int 
main_scaler_bits,
return 1;
 
for (i = 1; i = loops; i++) {
-   const unsigned int effective_div = max(min(input_rate / i /
-   target_rate, cap), 1);
+

Re: [U-Boot] [PATCH 6/6] linux/kernel.h: sync min, max, min3, max3 macros with Linux

2014-11-04 Thread Masahiro Yamada
Hi Marek,
(reduced Cc)

On Wed, 5 Nov 2014 07:02:23 +0100
Marek Vasut ma...@denx.de wrote:

 On Wednesday, November 05, 2014 at 06:06:09 AM, Masahiro Yamada wrote:
  Hi Pavel,
  
  Thanks for your close checking.
  
  
  On Tue, 4 Nov 2014 20:50:13 +0100
  
  Pavel Machek pa...@denx.de wrote:
   On Tue 2014-11-04 20:26:26, Masahiro Yamada wrote:
U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does.  This commit gets min, max, min3, max3
macros synced with the kernel introduing type checks.
   
   introducing
  
  I will fix this.
 
 Are you linting the patches with aspell or something ?

No.
Going forward I will do that. Thaks for your advice!

Best Regards
Masahiro Yamada

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


Re: [U-Boot] at91, usb, dfu: add dfu support for at91 boards

2014-11-04 Thread Heiko Schocher

Hello Bo,

Am 05.11.2014 08:40, schrieb Bo Shen:

Hi Heiko,

On 11/05/2014 03:30 PM, Heiko Schocher wrote:

Hello all,

I have a request for implementing DFU support an at91 based boards
(in this case for the siemens at91 boards corvus, taurus both in
mainline).

I found in include/configs/sama5d3xek.h

/* USB */
#define CONFIG_CMD_USB

#ifdef CONFIG_CMD_USB
#define CONFIG_USB_ATMEL
#define CONFIG_USB_ATMEL_CLK_SEL_UPLL
#define CONFIG_USB_OHCI_NEW
#define CONFIG_SYS_USB_OHCI_CPU_INIT
#define CONFIG_SYS_USB_OHCI_REGS_BASE ATMEL_BASE_OHCI
#define CONFIG_SYS_USB_OHCI_SLOT_NAME sama5d3
#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 3
#define CONFIG_DOS_PARTITION
#define CONFIG_USB_STORAGE
#endif

/* USB device */
#define CONFIG_USB_GADGET
#define CONFIG_USB_GADGET_DUALSPEED
#define CONFIG_USB_GADGET_ATMEL_USBA
#define CONFIG_USB_ETHER
#define CONFIG_USB_ETH_RNDIS
#define CONFIG_USBNET_MANUFACTURER Atmel SAMA5D3xEK

So, if I am correct, that USB gadget support should work on at91 (and
so DFU support should not be to hard to implement)?


The usb gadget driver for AT91 series, now it just support UDPHS gadget while 
not UDP gadget.
So, for the corvus board, it use at91sam9m10g45 which has UDPHS. So it will be 
easily. For the taurus board, it uses at91sam9260, it needs more work to do, 
need porting the gadget driver from Linux.

For DFU supports on sama5d3xek board.
https://github.com/linux4sam/u-boot-at91/commit/5030c6a0b4199243d54d87d01f76e8d6a2c057f3


Thanks for this perfect info!

bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] linux/kernel.h: sync min, max, min3, max3 macros with Linux

2014-11-04 Thread Marek Vasut
On Wednesday, November 05, 2014 at 08:48:19 AM, Masahiro Yamada wrote:
 Hi Marek,

Hi!

 (reduced Cc)
 
 On Wed, 5 Nov 2014 07:02:23 +0100
 
 Marek Vasut ma...@denx.de wrote:
  On Wednesday, November 05, 2014 at 06:06:09 AM, Masahiro Yamada wrote:
   Hi Pavel,
   
   Thanks for your close checking.
   
   
   On Tue, 4 Nov 2014 20:50:13 +0100
   
   Pavel Machek pa...@denx.de wrote:
On Tue 2014-11-04 20:26:26, Masahiro Yamada wrote:
 U-Boot has never cared about the type when we get max/min of two
 values, but Linux Kernel does.  This commit gets min, max, min3,
 max3 macros synced with the kernel introduing type checks.

introducing
   
   I will fix this.
  
  Are you linting the patches with aspell or something ?
 
 No.
 Going forward I will do that. Thaks for your advice!

I was just curious what Pavel does there, since I also got some spelling 
corrections from him. Please don't take it like I want to add more work
on your plate.

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


<    1   2