diff mbox

[v7,1/4] ARM: dts: am335x-bone: add support for beaglebone NAND cape

Message ID 1400490948-11571-2-git-send-email-pekon@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

pekon gupta May 19, 2014, 9:15 a.m. UTC
Beaglebone Board can be connected to expansion boards to add devices to them.
These expansion boards are called 'capes'. This patch adds support for
following versions of Beaglebone(AM335x) NAND capes
(a) NAND Device with bus-width=16, block-size=128k, page-size=2k, oob-size=64
(b) NAND Device with bus-width=16, block-size=256k, page-size=4k, oob-size=224
Further information and datasheets can be found at [1] and [2]

* How to boot from NAND using Memory Expander + NAND Cape ? *
 - Important: As BOOTSEL values are sampled only at POR, so after changing any
   setting on SW2 (DIP switch), disconnect and reconnect all board power supply
   (including mini-USB console port) to POR the beaglebone.

 - Selection of ECC scheme
  for NAND cape(a), ROM code expects BCH8_HW ecc-scheme
  for NAND cape(b), ROM code expects BCH16_HW ecc-scheme

 - Selection of boot modes can be controlled via  DIP switch(SW2) present on
   Memory Expander cape, so first boot via MMC or other sources to flash NAND
   device and then switch to SW2[SWITCH_BOOT]=ON to boot from NAND Cape.
   SW2[SWITCH_BOOT] == OFF  follow default boot order  MMC-> SPI -> UART -> USB
   SW2[SWITCH_BOOT] == ON   boot mode selected via DIP switch(SW2)

 - For NAND boot following switch settings need to be followed
   SW2[ 0] = ON   (SYSBOOT[ 0]==0: NAND boot mode selected )
   SW2[ 1] = ON   (SYSBOOT[ 1]==0:       -- do --          )
   SW2[ 2] = OFF  (SYSBOOT[ 2]==1:       -- do --          )
   SW2[ 3] = OFF  (SYSBOOT[ 3]==1:       -- do --          )
   SW2[ 4] = ON   (SYSBOOT[ 4]==0:       -- do --          )
   SW2[ 8] = OFF  (SYSBOOT[ 8]==1: 0:x8 device, 1:x16 device )
   SW2[ 9] = ON   (SYSBOOT[ 9]==0: ECC done by ROM  )
   SW2[10] = ON   (SYSBOOT[10]==0: Non Muxed device )
   SW2[11] = ON   (SYSBOOT[11]==0:    -- do --      )

[1] http://beagleboardtoys.info/index.php?title=BeagleBone_Memory_Expansion
[2] http://beagleboardtoys.info/index.php?title=BeagleBone_4Gb_16-Bit_NAND_Module

Signed-off-by: Pekon Gupta <pekon@ti.com>
Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org>
---
 arch/arm/boot/dts/am335x-bone-memory-cape.dts | 123 ++++++++++++++++++++++++++
 arch/arm/boot/dts/am335x-bone.dts             |   1 +
 arch/arm/boot/dts/am335x-boneblack.dts        |   1 +
 3 files changed, 125 insertions(+)
 create mode 100644 arch/arm/boot/dts/am335x-bone-memory-cape.dts

Comments

Tony Lindgren May 19, 2014, 4:25 p.m. UTC | #1
* Pekon Gupta <pekon@ti.com> [140519 02:16]:
> --- a/arch/arm/boot/dts/am335x-bone.dts
> +++ b/arch/arm/boot/dts/am335x-bone.dts
> @@ -9,6 +9,7 @@
>  
>  #include "am33xx.dtsi"
>  #include "am335x-bone-common.dtsi"
> +#include "am335x-bone-memory-cape.dts"
>  
>  &ldo3_reg {
>  	regulator-min-microvolt = <1800000>;
> --- a/arch/arm/boot/dts/am335x-boneblack.dts
> +++ b/arch/arm/boot/dts/am335x-boneblack.dts
> @@ -9,6 +9,7 @@
>  
>  #include "am33xx.dtsi"
>  #include "am335x-bone-common.dtsi"
> +#include "am335x-bone-memory-cape.dts"
>  
>  &ldo3_reg {
>  	regulator-min-microvolt = <1800000>;

Based on the recent discussions on the capes, it seems that nobody
wants to implement toggling of the capes in u-boot. And as there
can be other capes using GPMC bus, we can't merge this. And because
the capes are stackable, we can't really have .dts files for all
the combinations. And no, we're not merging any unconnected .dts
files either, sorry.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
pekon gupta May 19, 2014, 5:52 p.m. UTC | #2
Hi Tony,

>From: Tony Lindgren [mailto:tony@atomide.com]
>
>* Pekon Gupta <pekon@ti.com> [140519 02:16]:
>> --- a/arch/arm/boot/dts/am335x-bone.dts
>> +++ b/arch/arm/boot/dts/am335x-bone.dts
>> @@ -9,6 +9,7 @@
>>
>>  #include "am33xx.dtsi"
>>  #include "am335x-bone-common.dtsi"
>> +#include "am335x-bone-memory-cape.dts"
>>
>>  &ldo3_reg {
>>  	regulator-min-microvolt = <1800000>;
>> --- a/arch/arm/boot/dts/am335x-boneblack.dts
>> +++ b/arch/arm/boot/dts/am335x-boneblack.dts
>> @@ -9,6 +9,7 @@
>>
>>  #include "am33xx.dtsi"
>>  #include "am335x-bone-common.dtsi"
>> +#include "am335x-bone-memory-cape.dts"
>>
>>  &ldo3_reg {
>>  	regulator-min-microvolt = <1800000>;
>
>Based on the recent discussions on the capes, it seems that nobody
>wants to implement toggling of the capes in u-boot. And as there
>can be other capes using GPMC bus, we can't merge this. And because
>the capes are stackable, we can't really have .dts files for all
>the combinations. And no, we're not merging any unconnected .dts
>files either, sorry.
>
Yes, I fully understand. This is like death for most of the capes from point
of view of mainline support. But I have submitted this patch just for sake
of completion. And to provide reference if someone wants to locally work
on beaglebone NAND cape.
You may ignore this patch, and take the remaining ones if they are suitable.

with regards, pekon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ezequiel Garcia May 19, 2014, 6:16 p.m. UTC | #3
On 19 May 05:52 PM, Gupta, Pekon wrote:
> Hi Tony,
> 
> >From: Tony Lindgren [mailto:tony@atomide.com]
> >
> >* Pekon Gupta <pekon@ti.com> [140519 02:16]:
> >> --- a/arch/arm/boot/dts/am335x-bone.dts
> >> +++ b/arch/arm/boot/dts/am335x-bone.dts
> >> @@ -9,6 +9,7 @@
> >>
> >>  #include "am33xx.dtsi"
> >>  #include "am335x-bone-common.dtsi"
> >> +#include "am335x-bone-memory-cape.dts"
> >>
> >>  &ldo3_reg {
> >>  	regulator-min-microvolt = <1800000>;
> >> --- a/arch/arm/boot/dts/am335x-boneblack.dts
> >> +++ b/arch/arm/boot/dts/am335x-boneblack.dts
> >> @@ -9,6 +9,7 @@
> >>
> >>  #include "am33xx.dtsi"
> >>  #include "am335x-bone-common.dtsi"
> >> +#include "am335x-bone-memory-cape.dts"
> >>
> >>  &ldo3_reg {
> >>  	regulator-min-microvolt = <1800000>;
> >
> >Based on the recent discussions on the capes, it seems that nobody
> >wants to implement toggling of the capes in u-boot. And as there
> >can be other capes using GPMC bus, we can't merge this. And because
> >the capes are stackable, we can't really have .dts files for all
> >the combinations. And no, we're not merging any unconnected .dts
> >files either, sorry.
> >
> Yes, I fully understand. This is like death for most of the capes from point
> of view of mainline support. But I have submitted this patch just for sake
> of completion. And to provide reference if someone wants to locally work
> on beaglebone NAND cape.

While I fully agree with Tony on this, I think the reference is much
appreciated. Do you think you can push the NAND cape DT example somewhere?

Maybe some TI wiki page?
pekon gupta May 19, 2014, 6:22 p.m. UTC | #4
From: Ezequiel Garcia [mailto:ezequiel.garcia@free-electrons.com]
>On 19 May 05:52 PM, Gupta, Pekon wrote:
>> >From: Tony Lindgren [mailto:tony@atomide.com]
>> >Based on the recent discussions on the capes, it seems that nobody
>> >wants to implement toggling of the capes in u-boot. And as there
>> >can be other capes using GPMC bus, we can't merge this. And because
>> >the capes are stackable, we can't really have .dts files for all
>> >the combinations. And no, we're not merging any unconnected .dts
>> >files either, sorry.
>> >
>> Yes, I fully understand. This is like death for most of the capes from point
>> of view of mainline support. But I have submitted this patch just for sake
>> of completion. And to provide reference if someone wants to locally work
>> on beaglebone NAND cape.
>
>While I fully agree with Tony on this, I think the reference is much
>appreciated. Do you think you can push the NAND cape DT example somewhere?
>
>Maybe some TI wiki page?

Yes, that's my intent. I usually keep updating following TI wiki pages [1] and [2]
which I think are helpful for NAND users on OMAP platforms.

[1]  https://processors.wiki.ti.com/index.php/Linux_Core_NAND_User%27s_Guide#Board_specific_configurations
[2] https://processors.wiki.ti.com/index.php/Linux_Core_NAND_User%27s_Guide

with regards, pekon
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Robert Nelson May 19, 2014, 6:39 p.m. UTC | #5
On Mon, May 19, 2014 at 1:16 PM, Ezequiel Garcia
<ezequiel.garcia@free-electrons.com> wrote:
> On 19 May 05:52 PM, Gupta, Pekon wrote:
>> Hi Tony,
>>
>> >From: Tony Lindgren [mailto:tony@atomide.com]
>> >
>> >* Pekon Gupta <pekon@ti.com> [140519 02:16]:
>> >> --- a/arch/arm/boot/dts/am335x-bone.dts
>> >> +++ b/arch/arm/boot/dts/am335x-bone.dts
>> >> @@ -9,6 +9,7 @@
>> >>
>> >>  #include "am33xx.dtsi"
>> >>  #include "am335x-bone-common.dtsi"
>> >> +#include "am335x-bone-memory-cape.dts"
>> >>
>> >>  &ldo3_reg {
>> >>    regulator-min-microvolt = <1800000>;
>> >> --- a/arch/arm/boot/dts/am335x-boneblack.dts
>> >> +++ b/arch/arm/boot/dts/am335x-boneblack.dts
>> >> @@ -9,6 +9,7 @@
>> >>
>> >>  #include "am33xx.dtsi"
>> >>  #include "am335x-bone-common.dtsi"
>> >> +#include "am335x-bone-memory-cape.dts"
>> >>
>> >>  &ldo3_reg {
>> >>    regulator-min-microvolt = <1800000>;
>> >
>> >Based on the recent discussions on the capes, it seems that nobody
>> >wants to implement toggling of the capes in u-boot. And as there
>> >can be other capes using GPMC bus, we can't merge this. And because
>> >the capes are stackable, we can't really have .dts files for all
>> >the combinations. And no, we're not merging any unconnected .dts
>> >files either, sorry.
>> >
>> Yes, I fully understand. This is like death for most of the capes from point
>> of view of mainline support. But I have submitted this patch just for sake
>> of completion. And to provide reference if someone wants to locally work
>> on beaglebone NAND cape.
>
> While I fully agree with Tony on this, I think the reference is much
> appreciated. Do you think you can push the NAND cape DT example somewhere?
>
> Maybe some TI wiki page?

(resent in text mode for linux-omap list archive)

Since the capes are always some way tied with bb.org hardware, why
don't we put them up on https://github.com/beagleboard/ ?

am335x-capes.git ?

I envision, we should just mirror the base ./arch/arm/boot/dts/
directory (as someday the dts will be external anyways). In that repo,
we will keep these synced with mainline

am335x-bone-common.dtsi
am335x-bone.dts
am335x-boneblack.dts

and add the capes as:

<baseboard>-<cape>.dts

as a staging ground till a mainline overlay/etc system appears?

Thoughs?
pekon gupta May 19, 2014, 6:51 p.m. UTC | #6
>From: Robert Nelson [mailto:robertcnelson@gmail.com]

[...]
>Since the capes are always some way tied with bb.org hardware, why

>don't we put them up on https://github.com/beagleboard/ ?

>

>am335x-capes.git ?

>

>I envision, we should just mirror the base ./arch/arm/boot/dts/

>directory (as someday the dts will be external anyways). In that repo,

>we will keep these synced with mainline

>

>am335x-bone-common.dtsi

>am335x-bone.dts

>am335x-boneblack.dts

>

>and add the capes as:

>

><baseboard>-<cape>.dts

>

>as a staging ground till a mainline overlay/etc system appears?

>

>Thoughs?

>


If you know and can convince 'Gerald Coley' then plz try. I failed :-)


with regards, pekon
Robert Nelson May 19, 2014, 6:58 p.m. UTC | #7
On Mon, May 19, 2014 at 1:51 PM, Gupta, Pekon <pekon@ti.com> wrote:
>>From: Robert Nelson [mailto:robertcnelson@gmail.com]
> [...]
>>Since the capes are always some way tied with bb.org hardware, why
>>don't we put them up on https://github.com/beagleboard/ ?
>>
>>am335x-capes.git ?
>>
>>I envision, we should just mirror the base ./arch/arm/boot/dts/
>>directory (as someday the dts will be external anyways). In that repo,
>>we will keep these synced with mainline
>>
>>am335x-bone-common.dtsi
>>am335x-bone.dts
>>am335x-boneblack.dts
>>
>>and add the capes as:
>>
>><baseboard>-<cape>.dts
>>
>>as a staging ground till a mainline overlay/etc system appears?
>>
>>Thoughs?
>>
>
> If you know and can convince 'Gerald Coley' then plz try. I failed :-)

Oh, I'll do it... ;)

I just need Jason to create the intial "repo" for me on
github.com/beagleboard and enable my permission for it.

Then i'll just pull in the capes in that repo and push it to my
"--beta-kernel" option for users running the new debian image who
would like run mainline over the old v3.8.x

Regards,
Robert Nelson May 19, 2014, 7:22 p.m. UTC | #8
On Mon, May 19, 2014 at 2:11 PM, Kridner, Jason <jdk@ti.com> wrote:
>
>
> On May 19, 2014, at 11:58 AM, "Robert Nelson" <robertcnelson@gmail.com>
> wrote:
>
> On Mon, May 19, 2014 at 1:51 PM, Gupta, Pekon <pekon@ti.com> wrote:
>
> From: Robert Nelson [mailto:robertcnelson@gmail.com]
>
> [...]
>
> Since the capes are always some way tied with bb.org hardware, why
>
> don't we put them up on https://github.com/beagleboard/ ?
>
>
> am335x-capes.git ?
>
>
> I envision, we should just mirror the base ./arch/arm/boot/dts/
>
> directory (as someday the dts will be external anyways). In that repo,
>
> we will keep these synced with mainline
>
>
> am335x-bone-common.dtsi
>
> am335x-bone.dts
>
> am335x-boneblack.dts
>
>
> and add the capes as:
>
>
> <baseboard>-<cape>.dts
>
>
> as a staging ground till a mainline overlay/etc system appears?
>
>
> Thoughs?
>
>
>
> If you know and can convince 'Gerald Coley' then plz try. I failed :-)
>
>
> Oh, I'll do it... ;)
>
> I just need Jason to create the intial "repo" for me on
> github.com/beagleboard and enable my permission for it.
>
>
> I believe this is the same reason I created
> https://github.com/beagleboard/cape-firmware.  Is something else needed?

Hi Jason,

Same exact idea. But instead of the "overlay" dts's that get installed
in /lib/firmware/ this will be for the main kernel dtb files, that'll
be dumped in /boot/dtbs/*.dtb or /boot/*.dtb.  In theory we should be
able to build these outside kernel.org, so down the road we can add a
package for all the other distro's.

Regards,
Kridner, Jason May 19, 2014, 8:01 p.m. UTC | #9
> On May 19, 2014, at 12:22 PM, "Robert Nelson" <robertcnelson@gmail.com> wrote:
> 
>> On Mon, May 19, 2014 at 2:11 PM, Kridner, Jason <jdk@ti.com> wrote:
>> 
>> 
>> On May 19, 2014, at 11:58 AM, "Robert Nelson" <robertcnelson@gmail.com>
>> wrote:
>> 
>> On Mon, May 19, 2014 at 1:51 PM, Gupta, Pekon <pekon@ti.com> wrote:
>> 
>> From: Robert Nelson [mailto:robertcnelson@gmail.com]
>> 
>> [...]
>> 
>> Since the capes are always some way tied with bb.org hardware, why
>> 
>> don't we put them up on https://github.com/beagleboard/ ?
>> 
>> 
>> am335x-capes.git ?
>> 
>> 
>> I envision, we should just mirror the base ./arch/arm/boot/dts/
>> 
>> directory (as someday the dts will be external anyways). In that repo,
>> 
>> we will keep these synced with mainline
>> 
>> 
>> am335x-bone-common.dtsi
>> 
>> am335x-bone.dts
>> 
>> am335x-boneblack.dts
>> 
>> 
>> and add the capes as:
>> 
>> 
>> <baseboard>-<cape>.dts
>> 
>> 
>> as a staging ground till a mainline overlay/etc system appears?
>> 
>> 
>> Thoughs?
>> 
>> 
>> 
>> If you know and can convince 'Gerald Coley' then plz try. I failed :-)
>> 
>> 
>> Oh, I'll do it... ;)
>> 
>> I just need Jason to create the intial "repo" for me on
>> github.com/beagleboard and enable my permission for it.
>> 
>> 
>> I believe this is the same reason I created
>> https://github.com/beagleboard/cape-firmware.  Is something else needed?
> 
> Hi Jason,
> 
> Same exact idea. But instead of the "overlay" dts's that get installed
> in /lib/firmware/ this will be for the main kernel dtb files, that'll
> be dumped in /boot/dtbs/*.dtb or /boot/*.dtb.  In theory we should be
> able to build these outside kernel.org, so down the road we can add a
> package for all the other distro's.

Why not reuse the same repo since the capes would be in there too? Does it need renaming?

> 
> Regards,
> 
> -- 
> Robert Nelson
> http://www.rcn-ee.com/
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Robert Nelson May 19, 2014, 8:11 p.m. UTC | #10
>>>
>>> I believe this is the same reason I created
>>> https://github.com/beagleboard/cape-firmware.  Is something else needed?
>>
>> Hi Jason,
>>
>> Same exact idea. But instead of the "overlay" dts's that get installed
>> in /lib/firmware/ this will be for the main kernel dtb files, that'll
>> be dumped in /boot/dtbs/*.dtb or /boot/*.dtb.  In theory we should be
>> able to build these outside kernel.org, so down the road we can add a
>> package for all the other distro's.
>
> Why not reuse the same repo since the capes would be in there too? Does it need renaming?

Okay, i'll work with that repo and get something for v3.15.x/v3.16.x cleaned up.

Regards,
pekon gupta June 23, 2014, 5:40 a.m. UTC | #11
Hi Tony,

Just reviving this thread for some information..

>From: Tony Lindgren [mailto:tony@atomide.com]
>Sent: Monday, May 19, 2014 9:56 PM
>To: Gupta, Pekon
>Cc: linux-omap; Ezequiel Garcia; Stefan Roese; Javier Martinez Canillas; Quadros, Roger
>Subject: Re: [PATCH v7 1/4] ARM: dts: am335x-bone: add support for beaglebone NAND cape
>
>* Pekon Gupta <pekon@ti.com> [140519 02:16]:
>> --- a/arch/arm/boot/dts/am335x-bone.dts
>> +++ b/arch/arm/boot/dts/am335x-bone.dts
>> @@ -9,6 +9,7 @@
>>
>>  #include "am33xx.dtsi"
>>  #include "am335x-bone-common.dtsi"
>> +#include "am335x-bone-memory-cape.dts"
>>
>>  &ldo3_reg {
>>  	regulator-min-microvolt = <1800000>;
>> --- a/arch/arm/boot/dts/am335x-boneblack.dts
>> +++ b/arch/arm/boot/dts/am335x-boneblack.dts
>> @@ -9,6 +9,7 @@
>>
>>  #include "am33xx.dtsi"
>>  #include "am335x-bone-common.dtsi"
>> +#include "am335x-bone-memory-cape.dts"
>>
>>  &ldo3_reg {
>>  	regulator-min-microvolt = <1800000>;
>
>Based on the recent discussions on the capes, it seems that nobody
>wants to implement toggling of the capes in u-boot. And as there
>can be other capes using GPMC bus, we can't merge this.

I have been able to get toggling of capes (enabling and disabling of DT nodes)
in u-boot. It was already there in u-boot mainline [1], may be no-body tried it.

Example: Below sequence works for NAND cape patch mentioned in this thread.
---------------
/* load DTB */
u-boot> tftp 0x81000000 am335x-boneblack.dtb
u-boot> fdt addr 0x81000000
/* disable MMC2 node */
u-boot> fdt list /ocp/mmc@481d8000
u-boot> fdt set  /ocp/mmc@481d8000 status \d\i\s\a\b\l\e\d
u-boot> fdt list /ocp/mmc@481d8000 status
/* enable GPMC node */
u-boot> fdt list /ocp/gpmc
u-boot> fdt set  /ocp/gpmc status \o\k\a\y
u-boot> fdt list /ocp/gpmc status
/* enable ELM node */
u-boot> fdt list /ocp/elm
u-boot> fdt set  /ocp/elm status \o\k\a\y
u-boot> fdt list /ocp/elm status
/* boot uImage */
tftp 0x82000000 uImage
bootm 0x82000000 - 0x81000000

Note: "fdt set" command does not accept string literals
as binding values, it internally converts them to string, so
escape sequenced characters were used here..
"okay" == \o\k\a\y
"disabled" == \d\i\s\a\b\l\e\d"
---------------


> And because
>the capes are stackable, we can't really have .dts files for all
>the combinations. And no, we're not merging any unconnected .dts
>files either, sorry.
>
As per earlier proposal, we can have single DT files for similar
functionality capes like;
- am335x-bone-memory-cape.dts: for all Flash/Memory related capes like NAND, NOR, eMMC, etc.
- am335x-bone-display-cape.dts: for all display related capes like LCD4, LCD7..
This way you will have countable number of DTS files to maintain
And any conflict if ever in between capes can be contained within these files.

Does this suffice the requirement to accept cape DTS in mainline 
(with default state as disabled) ?

I'm re-invoking this thread because there are quite a number of
hobbyist and developers stuck without proper DT support of these
capes, so having them in mainline is better than providing a internal
or separately maintained tree.

>Regards,
>
>Tony

with regards, pekon

[1] http://www.denx.de/wiki/view/DULG/UBootCmdFDT
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tony Lindgren June 23, 2014, 5:48 a.m. UTC | #12
* Gupta, Pekon <pekon@ti.com> [140622 22:42]:
> Hi Tony,
> 
> Just reviving this thread for some information..
> 
> >From: Tony Lindgren [mailto:tony@atomide.com]
> >Sent: Monday, May 19, 2014 9:56 PM
> >To: Gupta, Pekon
> >Cc: linux-omap; Ezequiel Garcia; Stefan Roese; Javier Martinez Canillas; Quadros, Roger
> >Subject: Re: [PATCH v7 1/4] ARM: dts: am335x-bone: add support for beaglebone NAND cape
> >
> >* Pekon Gupta <pekon@ti.com> [140519 02:16]:
> >> --- a/arch/arm/boot/dts/am335x-bone.dts
> >> +++ b/arch/arm/boot/dts/am335x-bone.dts
> >> @@ -9,6 +9,7 @@
> >>
> >>  #include "am33xx.dtsi"
> >>  #include "am335x-bone-common.dtsi"
> >> +#include "am335x-bone-memory-cape.dts"
> >>
> >>  &ldo3_reg {
> >>  	regulator-min-microvolt = <1800000>;
> >> --- a/arch/arm/boot/dts/am335x-boneblack.dts
> >> +++ b/arch/arm/boot/dts/am335x-boneblack.dts
> >> @@ -9,6 +9,7 @@
> >>
> >>  #include "am33xx.dtsi"
> >>  #include "am335x-bone-common.dtsi"
> >> +#include "am335x-bone-memory-cape.dts"
> >>
> >>  &ldo3_reg {
> >>  	regulator-min-microvolt = <1800000>;
> >
> >Based on the recent discussions on the capes, it seems that nobody
> >wants to implement toggling of the capes in u-boot. And as there
> >can be other capes using GPMC bus, we can't merge this.
> 
> I have been able to get toggling of capes (enabling and disabling of DT nodes)
> in u-boot. It was already there in u-boot mainline [1], may be no-body tried it.
> 
> Example: Below sequence works for NAND cape patch mentioned in this thread.
> ---------------
> /* load DTB */
> u-boot> tftp 0x81000000 am335x-boneblack.dtb
> u-boot> fdt addr 0x81000000
> /* disable MMC2 node */
> u-boot> fdt list /ocp/mmc@481d8000
> u-boot> fdt set  /ocp/mmc@481d8000 status \d\i\s\a\b\l\e\d
> u-boot> fdt list /ocp/mmc@481d8000 status
> /* enable GPMC node */
> u-boot> fdt list /ocp/gpmc
> u-boot> fdt set  /ocp/gpmc status \o\k\a\y
> u-boot> fdt list /ocp/gpmc status
> /* enable ELM node */
> u-boot> fdt list /ocp/elm
> u-boot> fdt set  /ocp/elm status \o\k\a\y
> u-boot> fdt list /ocp/elm status
> /* boot uImage */
> tftp 0x82000000 uImage
> bootm 0x82000000 - 0x81000000
> 
> Note: "fdt set" command does not accept string literals
> as binding values, it internally converts them to string, so
> escape sequenced characters were used here..
> "okay" == \o\k\a\y
> "disabled" == \d\i\s\a\b\l\e\d"

Cool. Now all we need is a few helper functions in u-boot
so it can be done a bit easier :)

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jason Kridner June 23, 2014, 6:13 a.m. UTC | #13
On Mon, Jun 23, 2014 at 1:48 AM, Tony Lindgren <tony@atomide.com> wrote:
> * Gupta, Pekon <pekon@ti.com> [140622 22:42]:
>> Hi Tony,
>>
>> Just reviving this thread for some information..
>>
>> >From: Tony Lindgren [mailto:tony@atomide.com]
>> >Sent: Monday, May 19, 2014 9:56 PM
>> >To: Gupta, Pekon
>> >Cc: linux-omap; Ezequiel Garcia; Stefan Roese; Javier Martinez Canillas; Quadros, Roger
>> >Subject: Re: [PATCH v7 1/4] ARM: dts: am335x-bone: add support for beaglebone NAND cape
>> >
>> >* Pekon Gupta <pekon@ti.com> [140519 02:16]:
>> >> --- a/arch/arm/boot/dts/am335x-bone.dts
>> >> +++ b/arch/arm/boot/dts/am335x-bone.dts
>> >> @@ -9,6 +9,7 @@
>> >>
>> >>  #include "am33xx.dtsi"
>> >>  #include "am335x-bone-common.dtsi"
>> >> +#include "am335x-bone-memory-cape.dts"
>> >>
>> >>  &ldo3_reg {
>> >>    regulator-min-microvolt = <1800000>;
>> >> --- a/arch/arm/boot/dts/am335x-boneblack.dts
>> >> +++ b/arch/arm/boot/dts/am335x-boneblack.dts
>> >> @@ -9,6 +9,7 @@
>> >>
>> >>  #include "am33xx.dtsi"
>> >>  #include "am335x-bone-common.dtsi"
>> >> +#include "am335x-bone-memory-cape.dts"
>> >>
>> >>  &ldo3_reg {
>> >>    regulator-min-microvolt = <1800000>;
>> >
>> >Based on the recent discussions on the capes, it seems that nobody
>> >wants to implement toggling of the capes in u-boot. And as there
>> >can be other capes using GPMC bus, we can't merge this.
>>
>> I have been able to get toggling of capes (enabling and disabling of DT nodes)
>> in u-boot. It was already there in u-boot mainline [1], may be no-body tried it.
>>
>> Example: Below sequence works for NAND cape patch mentioned in this thread.
>> ---------------
>> /* load DTB */
>> u-boot> tftp 0x81000000 am335x-boneblack.dtb
>> u-boot> fdt addr 0x81000000
>> /* disable MMC2 node */
>> u-boot> fdt list /ocp/mmc@481d8000
>> u-boot> fdt set  /ocp/mmc@481d8000 status \d\i\s\a\b\l\e\d
>> u-boot> fdt list /ocp/mmc@481d8000 status
>> /* enable GPMC node */
>> u-boot> fdt list /ocp/gpmc
>> u-boot> fdt set  /ocp/gpmc status \o\k\a\y
>> u-boot> fdt list /ocp/gpmc status
>> /* enable ELM node */
>> u-boot> fdt list /ocp/elm
>> u-boot> fdt set  /ocp/elm status \o\k\a\y
>> u-boot> fdt list /ocp/elm status
>> /* boot uImage */
>> tftp 0x82000000 uImage
>> bootm 0x82000000 - 0x81000000
>>
>> Note: "fdt set" command does not accept string literals
>> as binding values, it internally converts them to string, so
>> escape sequenced characters were used here..
>> "okay" == \o\k\a\y
>> "disabled" == \d\i\s\a\b\l\e\d"
>
> Cool. Now all we need is a few helper functions in u-boot
> so it can be done a bit easier :)
>

The association of devicetree overlay files in /lib/firmware to cape
IDs made it where the kernel-based cape overlay manager could modify
the devicetree as needed without putting extensive cape-specific logic
in the kernel or bootloader. Throwing a bunch of capes into a single
class of capes won't save any work there. If we can get the bootloader
to support the .dtbo files, then we can continue to use the ID in the
cape to provide all the DT modifications we need. If we need to do
scripts for the modifications, we'd still need to associate the cape
ID to that script.

This still doesn't cover the need for run-time devicetree
modification, but I'll leave that for the other on-going thread.

I do agree with the idea of moving more of the potential sources of
conflict that can be resolved out of the overlays and into the main
devicetree, leaving the overlays or scripts simply to deal with the
conflicts that cannot be resolved at run-time given the current
infrastructure. I just think they should go into .dtsi (include) files
for the main .dts/.dtb files for the boards, rather than additional
overlays or alternative .dts files.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
pekon gupta June 24, 2014, 8:03 a.m. UTC | #14
PkZyb206IEphc29uIEtyaWRuZXIgW21haWx0bzpqa3JpZG5lckBnbWFpbC5jb21dDQo+Pk9uIE1v
biwgSnVuIDIzLCAyMDE0IGF0IDE6NDggQU0sIFRvbnkgTG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yB3b3VsZCBnaXZlIGNvbmZpZGVuY2UgdGhhdCBjYXBlIERUUw0KcGF0Y2hlcyBh
cmUgbm90IGJyZWFraW5nIGFueXRoaW5nIGluIGV4aXN0aW5nIERUUy4NCg0KDQpUaGFua3MuLg0K
d2l0aCByZWdhcmRzLCBwZWtvbg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/boot/dts/am335x-bone-memory-cape.dts b/arch/arm/boot/dts/am335x-bone-memory-cape.dts
new file mode 100644
index 0000000..ce3f87d
--- /dev/null
+++ b/arch/arm/boot/dts/am335x-bone-memory-cape.dts
@@ -0,0 +1,123 @@ 
+/*
+ * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This DTS adds supports for capes using GPMC interface to connect external
+ * memory like NAND, NOR Flash to Beaglebone-LT (white) and Beaglebone-Black.
+ */
+
+
+&am33xx_pinmux {
+	nand_flash_x16: nand_flash_x16 {
+		pinctrl-single,pins = <
+			0x00 (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad0.gpmc_ad0 */
+			0x04 (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad1.gpmc_ad1 */
+			0x08 (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad2.gpmc_ad2 */
+			0x0c (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad3.gpmc_ad3 */
+			0x10 (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad4.gpmc_ad4 */
+			0x14 (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad5.gpmc_ad5 */
+			0x18 (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad6.gpmc_ad6 */
+			0x1c (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad7.gpmc_ad7 */
+			0x20 (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad8.gpmc_ad8 */
+			0x24 (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad9.gpmc_ad9 */
+			0x28 (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad10.gpmc_ad10 */
+			0x2c (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad11.gpmc_ad11 */
+			0x30 (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad12.gpmc_ad12 */
+			0x34 (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad13.gpmc_ad13 */
+			0x38 (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad14.gpmc_ad14 */
+			0x3c (MUX_MODE0 | PIN_INPUT)	/* gpmc_ad15.gpmc_ad15 */
+			0x70 (MUX_MODE0 | PIN_INPUT_PULLUP )	/* gpmc_wait0.gpmc_wait0 */
+			0x74 (MUX_MODE7 | PIN_OUTPUT_PULLUP)	/* gpmc_wpn.gpio0_30 */
+			0x7c (MUX_MODE0 | PIN_OUTPUT_PULLUP)	/* gpmc_csn0.gpmc_csn0  */
+			0x90 (MUX_MODE0 | PIN_OUTPUT)		/* gpmc_advn_ale.gpmc_advn_ale */
+			0x94 (MUX_MODE0 | PIN_OUTPUT)		/* gpmc_oen_ren.gpmc_oen_ren */
+			0x98 (MUX_MODE0 | PIN_OUTPUT)		/* gpmc_wen.gpmc_wen */
+			0x9c (MUX_MODE0 | PIN_OUTPUT)		/* gpmc_be0n_cle.gpmc_be0n_cle */
+		>;
+	};
+};
+
+&gpmc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&nand_flash_x16>;
+	ranges = <0 0 0 0x01000000>;	/* minimum GPMC partition = 16MB */
+	nand@0,0 {
+		reg = <0 0 4>;		/* device IO registers */
+		ti,nand-ecc-opt = "bch8";
+		ti,elm-id = <&elm>;
+		nand-bus-width = <16>;
+		gpmc,device-width = <2>;
+		gpmc,sync-clk-ps = <0>;
+		gpmc,cs-on-ns = <0>;
+		gpmc,cs-rd-off-ns = <80>;
+		gpmc,cs-wr-off-ns = <80>;
+		gpmc,adv-on-ns = <0>;
+		gpmc,adv-rd-off-ns = <80>;
+		gpmc,adv-wr-off-ns = <80>;
+		gpmc,we-on-ns = <20>;
+		gpmc,we-off-ns = <60>;
+		gpmc,oe-on-ns = <20>;
+		gpmc,oe-off-ns = <60>;
+		gpmc,access-ns = <40>;
+		gpmc,rd-cycle-ns = <80>;
+		gpmc,wr-cycle-ns = <80>;
+		gpmc,wait-pin = <0>;
+		gpmc,wait-on-read;
+		gpmc,wait-on-write;
+		gpmc,bus-turnaround-ns = <0>;
+		gpmc,cycle2cycle-delay-ns = <0>;
+		gpmc,clk-activation-ns = <0>;
+		gpmc,wait-monitoring-ns = <0>;
+		gpmc,wr-access-ns = <40>;
+		gpmc,wr-data-mux-bus-ns = <0>;
+		/* MTD partition table */
+		/* All SPL-* partitions are sized to minimal length
+		 * which can be independently programmable. For
+		 * NAND flash this is equal to size of erase-block */
+		#address-cells = <1>;
+		#size-cells = <1>;
+		partition@0 {
+			label = "NAND.SPL";
+			reg = <0x00000000 0x00040000>;
+		};
+		partition@1 {
+			label = "NAND.SPL.backup1";
+			reg = <0x00040000 0x00040000>;
+		};
+		partition@2 {
+			label = "NAND.SPL.backup2";
+			reg = <0x00080000 0x00040000>;
+		};
+		partition@3 {
+			label = "NAND.SPL.backup3";
+			reg = <0x000c0000 0x00040000>;
+		};
+		partition@4 {
+			label = "NAND.u-boot-spl-os";
+			reg = <0x00100000 0x00080000>;
+		};
+		partition@5 {
+			label = "NAND.u-boot";
+			reg = <0x00180000 0x00100000>;
+		};
+		partition@6 {
+			label = "NAND.u-boot-env";
+			reg = <0x00280000 0x00040000>;
+		};
+		partition@7 {
+			label = "NAND.u-boot-env.backup1";
+			reg = <0x002c0000 0x00040000>;
+		};
+		partition@8 {
+			label = "NAND.kernel";
+			reg = <0x00300000 0x00700000>;
+		};
+		partition@9 {
+			label = "NAND.file-system";
+			reg = <0x00a00000 0x1f600000>;
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index 94ee427..f16bfcf 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -9,6 +9,7 @@ 
 
 #include "am33xx.dtsi"
 #include "am335x-bone-common.dtsi"
+#include "am335x-bone-memory-cape.dts"
 
 &ldo3_reg {
 	regulator-min-microvolt = <1800000>;
diff --git a/arch/arm/boot/dts/am335x-boneblack.dts b/arch/arm/boot/dts/am335x-boneblack.dts
index 6b71ad9..c030b24 100644
--- a/arch/arm/boot/dts/am335x-boneblack.dts
+++ b/arch/arm/boot/dts/am335x-boneblack.dts
@@ -9,6 +9,7 @@ 
 
 #include "am33xx.dtsi"
 #include "am335x-bone-common.dtsi"
+#include "am335x-bone-memory-cape.dts"
 
 &ldo3_reg {
 	regulator-min-microvolt = <1800000>;