mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Porting BareBox to Variscite iMX6 SOM
@ 2013-08-21 15:48 Michael Burkey
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Burkey @ 2013-08-21 15:48 UTC (permalink / raw)
  To: barebox

Sascha,

>When doing so please start with a devicetree based board to copy-paste
>from. The imx6q-phytec-pbab01 should be a pretty good example.

Where does said imx6q-phytec-pbab01 example happen to live?

Which brings up another question:

I know you were heavily involved in the bring-up of Barebox on the
Phyflex iMX6 and in the creation of the BSP (which is still based on
2012.02). When working with iMX6 platforms, which is a better starting
point -- the Phytec 2012.02 BSP version, or the current 2013.08
version?

Right now I've been working from the 2013.08 version -- but, unless
I'm missing something, it doesn't look like the Phyflex support has
been incorporated in the mainline Barebox.

Thanks!
Michael Burkey

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Porting BareBox to Variscite iMX6 SOM
  2013-08-22 19:18   ` Michael Burkey
@ 2013-08-22 21:09     ` Sascha Hauer
  0 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2013-08-22 21:09 UTC (permalink / raw)
  To: Michael Burkey; +Cc: barebox

On Thu, Aug 22, 2013 at 03:18:13PM -0400, Michael Burkey wrote:
> Sascha,
> 
> Based on a fairly thorough perusal of the current HEAD from the git, I
> am thinking I will implement the Variscite SOM in the following file
> structure:
> 
> (FYI - the Variscite development kit includes their own carrier board
> which is simply referred to in their published schematics as
> "MX6CustomBoard", so I am thinking of segmenting things by SOM and
> carrier board, much as you have the PhyFlex and its carrier board.)
> 
> /arch/arm/configs/variscite_mx6_custom_defconfig
> /arch/arm/boards/variscite-mx6-custom/board.c
> /arch/arm/boards/variscite-mx6-custom/flash-header.imxcfg
> /arch/arm/boards/variscite-mx6-custom/lowlevel.c
> /arch/arm/boards/variscite-mx6-custom/Makefile
> /arch/arm/boards/variscite-mx6-custom/env/(To Be Determined)
> /arch/arm/dts/imx6q-var-custom.dts
> /arch/arm/dts/imx6q-var-som.dtsi
> 
> Does this fit into your current methodology pretty well?

Yes, this looks good.

Note that i.MX6 boards often come in different quad/dual variants with
slightly different devicetrees. Just to explain the mess we have with
the i.MX6 devicetrees...

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-5555 |

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Porting BareBox to Variscite iMX6 SOM
  2013-08-22 15:49   ` Michael Burkey
@ 2013-08-22 21:06     ` Sascha Hauer
  0 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2013-08-22 21:06 UTC (permalink / raw)
  To: Michael Burkey; +Cc: barebox

On Thu, Aug 22, 2013 at 11:49:01AM -0400, Michael Burkey wrote:
> I don't know why I said github -- the one at pengutronix is the one I
> have been looking at. I think my brain must have been focused on lunch
> when I was sending that!

;)

> 
> The PhyFlex and i.MX6 NAND support being in the next release was sort
> of what I thought based on the comments in the mailing list and the
> differences in the code on the git vs the actual release.
> 
> Which brings me to my next question: what is the preferred way of
> setting up a new platform at this point in time?
> 
> Specifically, things seem to be in a lot of flux with the i.MX systems.
> 
> So, right now, for new systems:
> 1) The initial hardware setup should be in devicetree format under
> arch/arm/dts, correct?

Yes, correct.

> 
> 2) Where should the DCD config go? I am looking at multiple i.MX6
> platforms with it in 4 different spots -- lowlevel.c, flash_header.c,
> an imxcfg file, as a .h file included from the imxcfg file, etc.

The imxcfg file is the way to go. Historically we assembled the flash
header as struct types in C, but that turned out to be too inflexible.

> (and
> the dmo-mx6-realq7 has both a very basic .imxcfg file and then
> manually configures everything else with writel's in lowlevel.c).

Yeah, this is done because the dmo board needs the SDRAM calibration
functions to setup SDRAM. You can ignore this if you do not have a
good reason to setup the SDRAM in code.

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-5555 |

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Porting BareBox to Variscite iMX6 SOM
  2013-08-22  6:55 ` Sascha Hauer
  2013-08-22 15:49   ` Michael Burkey
@ 2013-08-22 19:18   ` Michael Burkey
  2013-08-22 21:09     ` Sascha Hauer
  1 sibling, 1 reply; 12+ messages in thread
From: Michael Burkey @ 2013-08-22 19:18 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

Sascha,

Based on a fairly thorough perusal of the current HEAD from the git, I
am thinking I will implement the Variscite SOM in the following file
structure:

(FYI - the Variscite development kit includes their own carrier board
which is simply referred to in their published schematics as
"MX6CustomBoard", so I am thinking of segmenting things by SOM and
carrier board, much as you have the PhyFlex and its carrier board.)

/arch/arm/configs/variscite_mx6_custom_defconfig
/arch/arm/boards/variscite-mx6-custom/board.c
/arch/arm/boards/variscite-mx6-custom/flash-header.imxcfg
/arch/arm/boards/variscite-mx6-custom/lowlevel.c
/arch/arm/boards/variscite-mx6-custom/Makefile
/arch/arm/boards/variscite-mx6-custom/env/(To Be Determined)
/arch/arm/dts/imx6q-var-custom.dts
/arch/arm/dts/imx6q-var-som.dtsi

Does this fit into your current methodology pretty well?

Thanks!
Michael Burkey

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Porting BareBox to Variscite iMX6 SOM
  2013-08-22  6:55 ` Sascha Hauer
@ 2013-08-22 15:49   ` Michael Burkey
  2013-08-22 21:06     ` Sascha Hauer
  2013-08-22 19:18   ` Michael Burkey
  1 sibling, 1 reply; 12+ messages in thread
From: Michael Burkey @ 2013-08-22 15:49 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

I don't know why I said github -- the one at pengutronix is the one I
have been looking at. I think my brain must have been focused on lunch
when I was sending that!

The PhyFlex and i.MX6 NAND support being in the next release was sort
of what I thought based on the comments in the mailing list and the
differences in the code on the git vs the actual release.

Which brings me to my next question: what is the preferred way of
setting up a new platform at this point in time?

Specifically, things seem to be in a lot of flux with the i.MX systems.

So, right now, for new systems:
1) The initial hardware setup should be in devicetree format under
arch/arm/dts, correct?

2) Where should the DCD config go? I am looking at multiple i.MX6
platforms with it in 4 different spots -- lowlevel.c, flash_header.c,
an imxcfg file, as a .h file included from the imxcfg file, etc. (and
the dmo-mx6-realq7 has both a very basic .imxcfg file and then
manually configures everything else with writel's in lowlevel.c). If
I'm going to be porting stuff in, I'd like to put it in whichever
format you prefer it in.

Thanks!
Michael Burkey


On 8/22/13, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Wed, Aug 21, 2013 at 02:46:17PM -0400, Michael Burkey wrote:
>> Sascha,
>>
>> You can ignore part of my last post -- I found the
>> "imx6q-phytec-pbab01" on github (it looks like a lot of the things I
>> am needing and working on are right on the edge of development where
>> you are working as well).
>
> github? The original barebox repository is here:
>
> git.pengutronix.de/git/barebox.git
>
>>
>> I also noticed some posts in the mailing list that you made last month
>> regarding adding gpmi-nand support for iMX6 (or at least some wrappers
>> for it). Has the actual gpmi-nand support been completed and
>> integrated (or will the existing mxs-nand driver from the i.MX23/28
>> work as-is)?
>
> The Nand support for i.MX6 is currently in the master branch and will be
> part of the next (v2013.09.0) release. Same with the PhyFLEX i.MX6
> support. Sorry, I originally thought this was in the last release.
>
>>
>>
>> I've also been doing a lot of reading on devicetree and what it
>> entails to migrate in that direction (everything I had been doing
>> previously had been iMX35 based and started from the older Phytec
>> BSP's, so I hadn't really looked at how devicetree worked). I may have
>> some more questions on this going forward.
>
> No problem, don't hesitate to ask.
>
> 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-5555 |
>

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Porting BareBox to Variscite iMX6 SOM
  2013-08-21 18:46 Michael Burkey
@ 2013-08-22  6:55 ` Sascha Hauer
  2013-08-22 15:49   ` Michael Burkey
  2013-08-22 19:18   ` Michael Burkey
  0 siblings, 2 replies; 12+ messages in thread
From: Sascha Hauer @ 2013-08-22  6:55 UTC (permalink / raw)
  To: Michael Burkey; +Cc: barebox

On Wed, Aug 21, 2013 at 02:46:17PM -0400, Michael Burkey wrote:
> Sascha,
> 
> You can ignore part of my last post -- I found the
> "imx6q-phytec-pbab01" on github (it looks like a lot of the things I
> am needing and working on are right on the edge of development where
> you are working as well).

github? The original barebox repository is here:

git.pengutronix.de/git/barebox.git

> 
> I also noticed some posts in the mailing list that you made last month
> regarding adding gpmi-nand support for iMX6 (or at least some wrappers
> for it). Has the actual gpmi-nand support been completed and
> integrated (or will the existing mxs-nand driver from the i.MX23/28
> work as-is)?

The Nand support for i.MX6 is currently in the master branch and will be
part of the next (v2013.09.0) release. Same with the PhyFLEX i.MX6
support. Sorry, I originally thought this was in the last release.

> 
> 
> I've also been doing a lot of reading on devicetree and what it
> entails to migrate in that direction (everything I had been doing
> previously had been iMX35 based and started from the older Phytec
> BSP's, so I hadn't really looked at how devicetree worked). I may have
> some more questions on this going forward.

No problem, don't hesitate to ask.

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-5555 |

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Porting BareBox to Variscite iMX6 SOM
@ 2013-08-21 18:46 Michael Burkey
  2013-08-22  6:55 ` Sascha Hauer
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Burkey @ 2013-08-21 18:46 UTC (permalink / raw)
  To: barebox

Sascha,

You can ignore part of my last post -- I found the
"imx6q-phytec-pbab01" on github (it looks like a lot of the things I
am needing and working on are right on the edge of development where
you are working as well).

I also noticed some posts in the mailing list that you made last month
regarding adding gpmi-nand support for iMX6 (or at least some wrappers
for it). Has the actual gpmi-nand support been completed and
integrated (or will the existing mxs-nand driver from the i.MX23/28
work as-is)?


I've also been doing a lot of reading on devicetree and what it
entails to migrate in that direction (everything I had been doing
previously had been iMX35 based and started from the older Phytec
BSP's, so I hadn't really looked at how devicetree worked). I may have
some more questions on this going forward.

Thanks again,
Michael Burkey

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Porting BareBox to Variscite iMX6 SOM
  2013-08-20 18:12 Michael Burkey
@ 2013-08-21  8:28 ` Sascha Hauer
  0 siblings, 0 replies; 12+ messages in thread
From: Sascha Hauer @ 2013-08-21  8:28 UTC (permalink / raw)
  To: Michael Burkey; +Cc: barebox

Hi Michael,

On Tue, Aug 20, 2013 at 02:12:20PM -0400, Michael Burkey wrote:
> Thank you Sascha for the additional information in your earlier post!
> 
> Your comments on the imx-image method got me looking at the menuconfig
> options and I located a simple mistake I had made when changing other
> options (while manually editing some files, I had somehow managed to
> inadvertently disable the "support internal boot" option).
> 
> After fixing this, everything now works as I would expect.
> 
> So, I now have the Variscite iMX6 SOM booted directly from SD to the
> BareBox shell on UART1.

Nice. That's good to hear ;)

> 
> Now I just have to start pulling in all the other devices and getting
> them configured properly!

When doing so please start with a devicetree based board to copy-paste
from. The imx6q-phytec-pbab01 should be a pretty good example.

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-5555 |

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Porting BareBox to Variscite iMX6 SOM
@ 2013-08-20 18:12 Michael Burkey
  2013-08-21  8:28 ` Sascha Hauer
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Burkey @ 2013-08-20 18:12 UTC (permalink / raw)
  To: barebox

Thank you Sascha for the additional information in your earlier post!

Your comments on the imx-image method got me looking at the menuconfig
options and I located a simple mistake I had made when changing other
options (while manually editing some files, I had somehow managed to
inadvertently disable the "support internal boot" option).

After fixing this, everything now works as I would expect.

So, I now have the Variscite iMX6 SOM booted directly from SD to the
BareBox shell on UART1.

Now I just have to start pulling in all the other devices and getting
them configured properly!

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Porting BareBox to Variscite iMX6 SOM
  2013-08-16  9:47 ` Sascha Hauer
@ 2013-08-16 11:37   ` Alexander Aring
  0 siblings, 0 replies; 12+ messages in thread
From: Alexander Aring @ 2013-08-16 11:37 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox, Michael Burkey

thumbs up, for this explanation. :-)

- Alex

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Porting BareBox to Variscite iMX6 SOM
  2013-08-15 18:58 Michael Burkey
@ 2013-08-16  9:47 ` Sascha Hauer
  2013-08-16 11:37   ` Alexander Aring
  0 siblings, 1 reply; 12+ messages in thread
From: Sascha Hauer @ 2013-08-16  9:47 UTC (permalink / raw)
  To: Michael Burkey; +Cc: barebox

Hi Michael,

On Thu, Aug 15, 2013 at 02:58:15PM -0400, Michael Burkey wrote:
> I figured I'd throw this question out to everyone (Sascha has already
> been very helpful,
> but I don't want to pester him too much!).

No problem ;)

> 
> I have currently been attempting to port BareBox over to a Variscite
> SOM with an iMX6Q
> on it.
> 
> Steps followed so far:
> 
> 1) Started from current 8.2013 BareBox
> 2) Started from ARM2 iMX6 version which is a fairly clean/uncluttered version.

Rather start with a imx_v7_defconfig. It contains several i.MX6 boards
which use the imx-image way rather than encoding the flash_header in C.

> 3) Migrated the DCD registers from Variscite's known working u-Boot
> BSP into flash_header.c
> 4) (Hopefully) properly verified the flash header information
> 5) Verified the arm_entry and size in lowlevel.c
> 6) Updated board.c with a set of reasonable IOMUX settings, etc.
> 7) Added a few simple commands at the start of xxx_devices_init() to
> toggle a GPIO LED

devices_init is quite late. There is a lot that can go wrong before
this.

Try to figure out the register writes you need to configure the iomux
for your LED and use writel() to set it up. Also use writel to set the
gpio rather than the gpio functions.

On i.MX6 the following can help you:

static inline void setup_uart(void)
{
	void __iomem *ccmbase = (void *)MX6_CCM_BASE_ADDR;
	void __iomem *uartbase = (void *)MX6_UART4_BASE_ADDR;
	void __iomem *iomuxbase = (void *)MX6_IOMUXC_BASE_ADDR;

	writel(0x4, iomuxbase + 0x01f8);

	writel(0xffffffff, ccmbase + 0x68);
	writel(0xffffffff, ccmbase + 0x6c);
	writel(0xffffffff, ccmbase + 0x70);
	writel(0xffffffff, ccmbase + 0x74);
	writel(0xffffffff, ccmbase + 0x78);
	writel(0xffffffff, ccmbase + 0x7c);
	writel(0xffffffff, ccmbase + 0x80);

	writel(0x00000000, uartbase + 0x80);
	writel(0x00004027, uartbase + 0x84);
	writel(0x00000704, uartbase + 0x88);
	writel(0x00000a81, uartbase + 0x90);
	writel(0x0000002b, uartbase + 0x9c);
	writel(0x00013880, uartbase + 0xb0);
	writel(0x0000047f, uartbase + 0xa4);
	writel(0x0000c34f, uartbase + 0xa8);
	writel(0x00000001, uartbase + 0x80);

	PUTC_LL('>');
}

Also enable this in Kconfig:

Debugging  --->
[*] low level debug messages
    Kernel low-level debugging port (i.MX6Q Debug UART)  --->
    (4) i.MX Debug UART Port Selection
    [*] Trace initcalls

Replace '4' in uartbase and Port selection with the UART number your
board uses. Also replace the iomux setup with one suitable for your
UART.

You can call setup_uart() nearly from the first instruction.

Also remember you can always start barebox 2nd stage from U-Boot.
Starting 2nd stage is much easier since you can skip lowlevel init for
the beginning. When doing 2nd stage you don't have to do setup_uart().
Just adjust the Kconfig like described above and in U-Boot do this:

setenv serverip x.x.x.x
tftp 0x18000000 barebox
go 0x18000000

Once you have this running you can be much more confident that barebox
is running in general and only have the lowlevel init as an additional
hurdle.

Hope that helps

 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-5555 |

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Porting BareBox to Variscite iMX6 SOM
@ 2013-08-15 18:58 Michael Burkey
  2013-08-16  9:47 ` Sascha Hauer
  0 siblings, 1 reply; 12+ messages in thread
From: Michael Burkey @ 2013-08-15 18:58 UTC (permalink / raw)
  To: barebox

I figured I'd throw this question out to everyone (Sascha has already
been very helpful,
but I don't want to pester him too much!).

I have currently been attempting to port BareBox over to a Variscite
SOM with an iMX6Q
on it.

Steps followed so far:

1) Started from current 8.2013 BareBox
2) Started from ARM2 iMX6 version which is a fairly clean/uncluttered version.
3) Migrated the DCD registers from Variscite's known working u-Boot
BSP into flash_header.c
4) (Hopefully) properly verified the flash header information
5) Verified the arm_entry and size in lowlevel.c
6) Updated board.c with a set of reasonable IOMUX settings, etc.
7) Added a few simple commands at the start of xxx_devices_init() to
toggle a GPIO LED
8) Compiled BareBox on Ubuntu 12 w/Linaro tool chain
9) copied image to SD card with dd if=barebox.bin of=/dev/sdb bs=512
seek=2 skip=2 conv=fsync
10) attempted to boot the image from SD with the appropriate GPIO
strappings on BOOT_CFG pins.

The end result is, as far as I can tell, nothing happens. It attempts
to boot the code but never
succeeds in starting BareBox (my LED never changes state).

If I do the exact same operations but with the Variscite version of
u-Boot (with my LED toggle code
added) then everything works as expected.

Does anyone have any suggestions on what to try next or any thing I
may have overlooked?

Has anyone else out there attempted to port BareBox to the Variscite SOM's?

Any and all help would be greatly appreciated!

Thanks,
Michael Burkey

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-08-22 21:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-21 15:48 Porting BareBox to Variscite iMX6 SOM Michael Burkey
  -- strict thread matches above, loose matches on Subject: below --
2013-08-21 18:46 Michael Burkey
2013-08-22  6:55 ` Sascha Hauer
2013-08-22 15:49   ` Michael Burkey
2013-08-22 21:06     ` Sascha Hauer
2013-08-22 19:18   ` Michael Burkey
2013-08-22 21:09     ` Sascha Hauer
2013-08-20 18:12 Michael Burkey
2013-08-21  8:28 ` Sascha Hauer
2013-08-15 18:58 Michael Burkey
2013-08-16  9:47 ` Sascha Hauer
2013-08-16 11:37   ` Alexander Aring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox