mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Re: Porting to a new board
@ 2013-09-23 21:47 Allen Kennedy Jr.
  2013-09-24  4:24 ` Antony Pavlov
  2013-09-24  7:39 ` Sascha Hauer
  0 siblings, 2 replies; 10+ messages in thread
From: Allen Kennedy Jr. @ 2013-09-23 21:47 UTC (permalink / raw)
  To: barebox

> What's the output of some network command, like for example 'dhcp'?

This hangs the chip.

>
> What's the output of 'md -w -s /dev/phy0'?

Barebox:/ md -w -s /dev/phy0
open: No such file or directory

Indeed there is no phy0 device in the /dev directory.  It would appear
this is where the trouble is.  Why would this be missing?

> static struct fec_platform_data fec_info = {
>         .xcv_type = PHY_INTERFACE_MODE_MII,
>         .phy_addr = -1,
> };

It looks exactly like that.

> When 'md -w -s /dev/phy0' doesn't show any sensible register output then
> your pinmux may be wrong or you haven't brought your phy out of reset
> with some gpio.

I have verified that that the GPIO for the reset is outputting a high,
as it should be for the chip to not be in reset.

My pinmodes are set up thusly:
   /* FEC */
    PD0_AIN_FEC_TXD0 | GPIO_PUEN,
    PD1_AIN_FEC_TXD1 | GPIO_PUEN,
    PD2_AIN_FEC_TXD2 | GPIO_PUEN,
    PD3_AIN_FEC_TXD3 | GPIO_PUEN,
    PD4_AOUT_FEC_RX_ER | GPIO_PUEN,
    PD5_AOUT_FEC_RXD1,
    PD6_AOUT_FEC_RXD2 | GPIO_PUEN,
    PD7_AOUT_FEC_RXD3 | GPIO_PUEN,
    PD8_AF_FEC_MDIO | GPIO_PUEN,
    PD9_AIN_FEC_MDC | GPIO_PUEN,
    PD10_AOUT_FEC_CRS | GPIO_PUEN,
    PD11_AOUT_FEC_TX_CLK | GPIO_PUEN,
    PD12_AOUT_FEC_RXD0 | GPIO_PUEN,
    PD13_AOUT_FEC_RX_DV | GPIO_PUEN,
    PD14_AOUT_FEC_RX_CLK | GPIO_PUEN,
    PD15_AOUT_FEC_COL | GPIO_PUEN,
    PD16_AIN_FEC_TX_ER,
    PF23_AIN_FEC_TX_EN,

And a double check shows that this matches the schematic.
I probed the reset line with a scope, and indeed it is goes to the
correct state before the attempt to register the FEC device.

thanks,
-Allen


On Sat, Sep 21, 2013 at 2:50 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Fri, Sep 20, 2013 at 04:02:44PM -0500, Allen Kennedy Jr. wrote:
>> Thanks for the great idea to start with a loaded image in ram.
>>
>> I was able to get it to run, but I can't get the Ethernet to work.
>> I'm not entirely sure where to begin looking.
>>
>> I hit devinfo and get:
>> <snip>
>>      `---- imx27-fec
>>           `---- miibus0
>>           `---- eth0
>> <...>
>> drivers:
>> <...>
>> SMSC LAN83C185
>> SMSC LAN8187
>> SMSC LAN8700
>> SMSC LAN911x Internal PHY
>> SMSC LAN8710/LAN8720
>> fec_imx
>> Generic PHY
>> </snip>
>>
>> This would seem to indicate to me that the drivers are loading. And
>> that the register happened.
>> But I'm not sure where to go from here.
>
> What's the output of some network command, like for example 'dhcp'?
>
> What's the output of 'md -w -s /dev/phy0'?
>
> Problems with networking usually go down to problems with the phy.
> What's the content of the platform data for the FEC? It should look
> like:
>
> static struct fec_platform_data fec_info = {
>         .xcv_type = PHY_INTERFACE_MODE_MII,
>         .phy_addr = -1,
> };
>
>
> With xcv_type being MII (I think it's the only possibility on i.MX27)
> and phy_addr to either -1 for autodetecting the address or the correct
> address. Use -1 to be on the safe side.
>
> When 'md -w -s /dev/phy0' doesn't show any sensible register output then
> your pinmux may be wrong or you haven't brought your phy out of reset
> with some gpio.
>
>>
>> In another thread... the advice was given to check the MII address,
>> although I'm not sure how to interpret the data sheet.
>> It looks as though the address is 31.  But I could be wrong.  When I
>> try 31, and do a DHCP the processor hangs.
>> So I tried 0, and the processor hangs.
>>
>> Is there a "scan the bus mode" I can use in the fec driver?  I don't
>> see one, but I may be looking in the wrong spot.
>
> It's not in the FEC driver but in the generic MII support. As said, use
> -1 as phy id.
>
> 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

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

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Porting to a new board
@ 2013-09-18 21:44 Allen Kennedy Jr.
  2013-09-19  7:35 ` Sascha Hauer
  0 siblings, 1 reply; 10+ messages in thread
From: Allen Kennedy Jr. @ 2013-09-18 21:44 UTC (permalink / raw)
  To: barebox

Hello,
  I have read the documentation but I believe it to be out of date, as it
does not match up with the source from the git tree.

  To that end, I am trying to add a new board, and I can not figure out how
to do so.  My board uses the mx27 processor, and so I am attempting to
closely mimic one of the other mx27 boards, when following the steps here:
http://barebox.org/documentation/barebox-2011.05.0/dev_board.html

I find the following inconsistencies:
1. include/configs/<boardname>.h  -
the configs directory does not exist.
2. modify arch/<architecture>/Kconfig

   - add your board (MACH_*) to the list
   - add your default text base address for this architecture
   (ARCH_TEXT_BASE)
   - add BOARDINFO with valueable info for your board

None of this exists.

3. modify arch/<architecture>/Makefile:

   - add board-$(MACH_*) = <your board_dir>


This does not exist

And my board will not show up in the menu config.

Also I am finding it difficult to locate where I set things like flash
size, ram size, etc...  u-boot has a much simpler (if not less documented)
layout when it came to boards.  Alas I can not use u-boot, because of the
nand flash limitations, and thus why I am attempting to use barebox.

And finally there seems to be some confusiton both in the code and the
documentation about the difference between a board and a machine.  What is
the difference?

I'm sorry that there is a lot here, but I can not find the proper
documentation to answer these questions.


Also, for those that are curious, or can help me get around this issue.  I
attempting to get this going on a board with an mx27 booted from NAND
flash, so I believe I have to use the PBL option to setup and copy out of
nand to do the real booting.  If there is any advice on this, I would
appreciate it.  I have no other bootloader, only bare metal and a JTAG
device.


thank you.

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

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

end of thread, other threads:[~2013-09-24 17:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-23 21:47 Porting to a new board Allen Kennedy Jr.
2013-09-24  4:24 ` Antony Pavlov
2013-09-24  7:39 ` Sascha Hauer
2013-09-24 15:00   ` Allen Kennedy Jr.
2013-09-24 16:33     ` Jean-Christophe PLAGNIOL-VILLARD
2013-09-24 17:06       ` Allen Kennedy Jr.
  -- strict thread matches above, loose matches on Subject: below --
2013-09-18 21:44 Allen Kennedy Jr.
2013-09-19  7:35 ` Sascha Hauer
2013-09-20 21:02   ` Allen Kennedy Jr.
2013-09-21  7:50     ` Sascha Hauer

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