Re: [PATCH 00/45] AT91, at91sam9x5ek updates

2017-03-07 Thread Jean-Christophe PLAGNIOL-VILLARD

> On Mar 8, 2017, at 5:18 AM, Andrey Smirnov  wrote:
> 
> On Tue, Mar 7, 2017 at 12:58 PM, Sam Ravnborg  wrote:
 
 When booting from an SD-Card/NOR-Flash/USB would I then need
 to use at91bootstrap, or can I use only barebox?
 
 If I move forward with this and I can find an 9263
 evaluation kit I would then also update this.
>>> On 9263 the sram is huge so you can build barebox as first stage
>> 
>> Good - simplicity is good.
>> 
> 
> For  at91sam9x5ek I had to use at91bootstrap since there is first
> stage loader in Barebox for it. I don't know about 9263, but I trust
> Jean-Christophe to be correct on this one.

I’ve patch for all the at91 soc for the pbl and nand and mmc

but I’m really busy those days on EFI boot support 
and secure boot. To be able to pass microsoft certification so we can use 
barebox
to boot linux or even windows.

So I’ll try to dig them later

Best Regards,
J.
> 
>>> 
>>> I add this a long time ago on usb_a9263_bootstrap_defconfig
>>> or other (all the EK).
>>> 
>>> This will build a barebox that can load you image from multiple source in a 
>>> sequence
>>> 
>>> and then use a std barebox
>>> 
>>> To switch to DT you will have to import the DT I did for the kernel
>> OK, should be straighforward.
>> 
>>> and replace the hw i2c by a i2c gpio as the i2c IP on at91 has a lot of 
>>> quirks
>>> and for barebox it will not make sense to port it
>> Seems less straightforward but doable.
>> 
> 
> Not sure what the situation on 9263 is, but FWIW, kernel DT file from
> the kernel for 9x5ek secifies I2C0 as GPIO bitbanged on, and I believe
> I had it working so hopefully it would be just a DT related change
> that you'd need to do.
> 
> Thanks,
> Andrey Smirnov


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 00/45] AT91, at91sam9x5ek updates

2017-03-07 Thread Andrey Smirnov
On Tue, Mar 7, 2017 at 12:58 PM, Sam Ravnborg  wrote:
>> >
>> > When booting from an SD-Card/NOR-Flash/USB would I then need
>> > to use at91bootstrap, or can I use only barebox?
>> >
>> > If I move forward with this and I can find an 9263
>> > evaluation kit I would then also update this.
>> On 9263 the sram is huge so you can build barebox as first stage
>
> Good - simplicity is good.
>

For  at91sam9x5ek I had to use at91bootstrap since there is first
stage loader in Barebox for it. I don't know about 9263, but I trust
Jean-Christophe to be correct on this one.

>>
>> I add this a long time ago on usb_a9263_bootstrap_defconfig
>> or other (all the EK).
>>
>> This will build a barebox that can load you image from multiple source in a 
>> sequence
>>
>> and then use a std barebox
>>
>> To switch to DT you will have to import the DT I did for the kernel
> OK, should be straighforward.
>
>> and replace the hw i2c by a i2c gpio as the i2c IP on at91 has a lot of 
>> quirks
>> and for barebox it will not make sense to port it
> Seems less straightforward but doable.
>

Not sure what the situation on 9263 is, but FWIW, kernel DT file from
the kernel for 9x5ek secifies I2C0 as GPIO bitbanged on, and I believe
I had it working so hopefully it would be just a DT related change
that you'd need to do.

Thanks,
Andrey Smirnov

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 00/45] AT91, at91sam9x5ek updates

2017-03-07 Thread Sam Ravnborg
> > 
> > When booting from an SD-Card/NOR-Flash/USB would I then need
> > to use at91bootstrap, or can I use only barebox?
> > 
> > If I move forward with this and I can find an 9263
> > evaluation kit I would then also update this.
> On 9263 the sram is huge so you can build barebox as first stage

Good - simplicity is good.

> 
> I add this a long time ago on usb_a9263_bootstrap_defconfig
> or other (all the EK).
> 
> This will build a barebox that can load you image from multiple source in a 
> sequence
> 
> and then use a std barebox
> 
> To switch to DT you will have to import the DT I did for the kernel
OK, should be straighforward.

> and replace the hw i2c by a i2c gpio as the i2c IP on at91 has a lot of quirks
> and for barebox it will not make sense to port it
Seems less straightforward but doable.

I will see if I can find time to give it a try and then post patches.

Sam

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 00/45] AT91, at91sam9x5ek updates

2017-03-07 Thread Andrey Smirnov
On Tue, Mar 7, 2017 at 12:13 AM, Sascha Hauer  wrote:
> Hi Andrey,
>
> On Mon, Mar 06, 2017 at 02:53:11PM -0800, Andrey Smirnov wrote:
>> Hi everyone,
>>
>> I recently had a chance to work with at91sam9x5ek board and as a part
>> of that effort I converted the code to support features found in
>> Barebox for i.MX based SoCs. Most notably this patchset converts
>> at91sam9x5ek to use multi-image PBL build process as well as adds
>> support for board initialization from attached devicetree blob.
>>
>> Sascha, at least for now, all of the patches, in chronological order,
>> are included in this submission. However if this proves to be too
>> burdensome to review, I'd be more than happy to split it into several
>> individual submissions. One such division could be:
>>
>>  - Generic bug fixes/infrastructure enhancements
>>  - Peripheral drivers updates
>>  - at91sam9x5ek specific changes
>>
>> Please let me know if that is preferrable.
>
> I had a short look at all patches, overall they look good. Nevertheless
> it would be good to sort them like you suggested. It just makes it
> easier to apply.
>

OK, will do.

> Thanks for working on this, a general AT91 overhaul was long overdue. I
> hope this series prepares a path to cleanup the other AT91 SoCs aswell.
>

Yeah, I have a bit more AT91 based hardware (at least SAMA5D3 Xplained
board and maybe more), so I was hoping to get those done after this
merge request.

> The clock support you ported over from the kernel is for all AT91 SoCs
> and not only one, right?

Yeah, I belive it should be usable by the whole AT91 family.

Thanks,
Andrey

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 00/45] AT91, at91sam9x5ek updates

2017-03-07 Thread Jean-Christophe PLAGNIOL-VILLARD

> On Mar 8, 2017, at 12:34 AM, Sam Ravnborg  wrote:
> 
> Hi Andrey.
> 
> On Mon, Mar 06, 2017 at 02:53:11PM -0800, Andrey Smirnov wrote:
>> Hi everyone,
>> 
>> I recently had a chance to work with at91sam9x5ek board and as a part
>> of that effort I converted the code to support features found in
>> Barebox for i.MX based SoCs. Most notably this patchset converts
>> at91sam9x5ek to use multi-image PBL build process as well as adds
>> support for board initialization from attached devicetree blob.
> 
> Impressive series - looks good! And timing was good.
> 
> I have a proprietary at91sam9263 based bord that is familiar
> with the 9263 evaluation kit.
> The current bootloader is latest bootstrap + an ancient U-Boot.
> As we have another board (i.MX6 based) there is some synergy into
> using the same bootloader on both boards.
> 
> Can you give any hints on what needs to be done on top of
> your patch-set to support the 9263 evalutation kit?
> 
> When booting from an SD-Card/NOR-Flash/USB would I then need
> to use at91bootstrap, or can I use only barebox?
> 
> If I move forward with this and I can find an 9263
> evaluation kit I would then also update this.
On 9263 the sram is huge so you can build barebox as first stage

I add this a long time ago on usb_a9263_bootstrap_defconfig
or other (all the EK).

This will build a barebox that can load you image from multiple source in a 
sequence

and then use a std barebox

To switch to DT you will have to import the DT I did for the kernel
and replace the hw i2c by a i2c gpio as the i2c IP on at91 has a lot of quirks
and for barebox it will not make sense to port it

Best Regards,
J.
___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 00/45] AT91, at91sam9x5ek updates

2017-03-07 Thread Sam Ravnborg
Hi Andrey.

On Mon, Mar 06, 2017 at 02:53:11PM -0800, Andrey Smirnov wrote:
> Hi everyone,
> 
> I recently had a chance to work with at91sam9x5ek board and as a part
> of that effort I converted the code to support features found in
> Barebox for i.MX based SoCs. Most notably this patchset converts
> at91sam9x5ek to use multi-image PBL build process as well as adds
> support for board initialization from attached devicetree blob.

Impressive series - looks good! And timing was good.

I have a proprietary at91sam9263 based bord that is familiar
with the 9263 evaluation kit.
The current bootloader is latest bootstrap + an ancient U-Boot.
As we have another board (i.MX6 based) there is some synergy into
using the same bootloader on both boards.

Can you give any hints on what needs to be done on top of
your patch-set to support the 9263 evalutation kit?

When booting from an SD-Card/NOR-Flash/USB would I then need
to use at91bootstrap, or can I use only barebox?

If I move forward with this and I can find an 9263
evaluation kit I would then also update this.

Sam

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 00/45] AT91, at91sam9x5ek updates

2017-03-07 Thread Sascha Hauer
Hi Andrey,

On Mon, Mar 06, 2017 at 02:53:11PM -0800, Andrey Smirnov wrote:
> Hi everyone,
> 
> I recently had a chance to work with at91sam9x5ek board and as a part
> of that effort I converted the code to support features found in
> Barebox for i.MX based SoCs. Most notably this patchset converts
> at91sam9x5ek to use multi-image PBL build process as well as adds
> support for board initialization from attached devicetree blob.
> 
> Sascha, at least for now, all of the patches, in chronological order,
> are included in this submission. However if this proves to be too
> burdensome to review, I'd be more than happy to split it into several
> individual submissions. One such division could be:
> 
>  - Generic bug fixes/infrastructure enhancements
>  - Peripheral drivers updates
>  - at91sam9x5ek specific changes
> 
> Please let me know if that is preferrable.

I had a short look at all patches, overall they look good. Nevertheless
it would be good to sort them like you suggested. It just makes it
easier to apply.

Thanks for working on this, a general AT91 overhaul was long overdue. I
hope this series prepares a path to cleanup the other AT91 SoCs aswell.

The clock support you ported over from the kernel is for all AT91 SoCs
and not only one, right?

Sascha

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 00/45] AT91, at91sam9x5ek updates

2017-03-06 Thread Andrey Smirnov
Hi everyone,

I recently had a chance to work with at91sam9x5ek board and as a part
of that effort I converted the code to support features found in
Barebox for i.MX based SoCs. Most notably this patchset converts
at91sam9x5ek to use multi-image PBL build process as well as adds
support for board initialization from attached devicetree blob.

Sascha, at least for now, all of the patches, in chronological order,
are included in this submission. However if this proves to be too
burdensome to review, I'd be more than happy to split it into several
individual submissions. One such division could be:

   - Generic bug fixes/infrastructure enhancements
   - Peripheral drivers updates
   - at91sam9x5ek specific changes

Please let me know if that is preferrable.

Thank you,
Andrey Smirnov


Andrey Smirnov (45):
  at91: Fix bug/typo in debug_ll.h
  at91sam9x5ek: Convert to mult-image build
  at91sam9x5ek: Add CONFIG_KALLSYMS to defconfig
  at91sam9x5ek: Add preliminary device tree support
  clocksource: at91: Move to 'drivers/clocksource'
  clocksource: at91: Add DT compatibility table
  serial: atmel: Check result of clk_get()
  serial: atmel: Add DT compatibility table
  regmap: Implement syscon_node_to_regmap()
  clk: Port two helper functions from Linux
  clk: Make COMMON_CLK_OF_PROVIDER depend on OFTREE
  clk: No-op CLK_OF_DECLARE if not enabled
  clk: at91: Port at91 DT clock code
  at91sam9x5ek: Convert to use DT clock tree
  at91sam9x5ek: Remove at91sam9x5ek_mem_init()
  at91sam9x5ek: Configure LEDs in DT
  pinctrl-at91: Fix a bug in at91_pinctrl_set_conf()
  at91: Enable PINCTRL for SOC_AT91SAM9
  at91sam9x5ek: Configure I2C via DT
  mci: Allow parsing for explicit DT node
  mci: atmel_mci: Add DT support
  at91sam9x5ek: Configure MMC in DT
  of: base: Use scoring in DT device matching
  pinctrl: at91: Fix a bug in at91_pinctrl_set_state
  pinctrl: at91: Implement .get_direction hook
  spi: atmel_spi: Add DT support
  spi: atmel_spi: Configure CS GPIO as output
  spi: atmel_spi: Use VERSION register instead of CPU type
  at91sam9x5ek: Configure SPI in DT
  w1-gpio: Add DT support
  at91sam9x5ek: Configure 1-wire in DT
  usb: ohci-at91: Check result of clk_get()
  usb: ohci-at91: Convert global variables to private data
  usb: ohci-at91: Check result of clk_enable()
  usb: ohci-at91: Add DT support
  usb/host: Allow USB_OHCI_AT91 even if USB_OHCI is disabled
  usb: ehci-atmel: Check result of clk_enable()
  usb: echi-atmel: Convert global variables to private data
  usb: ehci-atmel: Zero ehci_data before using it
  usb: echi-atmel: Check result of ehci_register()
  usb: echi-atmel: Add DT support
  at91sam9x5ek: Configure USB in DT
  net: macb: Add DT support
  at91sam9x5ek: Configure Ethernet in DT
  at91sam9x5ek: Configure NAND in DT

 arch/arm/Kconfig   |   2 +-
 arch/arm/boards/at91sam9x5ek/Makefile  |   1 +
 arch/arm/boards/at91sam9x5ek/hw_version.c  |   6 +-
 arch/arm/boards/at91sam9x5ek/hw_version.h  |   1 -
 arch/arm/boards/at91sam9x5ek/init.c| 226 ++--
 arch/arm/boards/at91sam9x5ek/lowlevel.c|  21 +
 arch/arm/configs/at91sam9x5ek_defconfig|   8 +-
 arch/arm/dts/Makefile  |   2 +
 arch/arm/dts/at91sam9x5ek.dts  |  72 +++
 arch/arm/mach-at91/Kconfig |  73 ++-
 arch/arm/mach-at91/Makefile|  10 +-
 arch/arm/mach-at91/at91sam9x5.c| 311 ---
 arch/arm/mach-at91/include/mach/board.h|   6 +-
 arch/arm/mach-at91/include/mach/debug_ll.h |   2 +-
 arch/arm/mach-at91/setup.c |   4 +-
 drivers/clk/Kconfig|   1 +
 drivers/clk/Makefile   |   1 +
 drivers/clk/at91/Makefile  |  15 +
 drivers/clk/at91/clk-generated.c   | 323 
 drivers/clk/at91/clk-h32mx.c   | 125 +
 drivers/clk/at91/clk-main.c| 576 +
 drivers/clk/at91/clk-master.c  | 245 +
 drivers/clk/at91/clk-peripheral.c  | 430 +++
 drivers/clk/at91/clk-pll.c | 516 ++
 drivers/clk/at91/clk-plldiv.c  | 135 +
 drivers/clk/at91/clk-programmable.c| 254 +
 drivers/clk/at91/clk-slow.c| 108 
 drivers/clk/at91/clk-smd.c | 172 ++
 drivers/clk/at91/clk-system.c  | 160 ++
 drivers/clk/at91/clk-usb.c | 397 ++
 drivers/clk/at91/clk-utmi.c| 138 +
 drivers/clk/at91/pmc.c |  41 ++
 drivers/clk/at91/pmc.h |  27 +
 drivers/clk/at91/sckc.c| 485