[U-Boot] [PATCH v2] arm: at91: support for the Calao USB-A9263 board (based on AT91SAM9263)

Heiko Schocher hs at denx.de
Tue Nov 12 09:53:12 CET 2013


Hello Andreas,

Am 11.11.2013 12:03, schrieb Andreas Bießmann:
> Dear Mateusz Kulikowski,
>
> On 11/02/2013 12:19 AM, Mateusz Kulikowski wrote:
>> Add support for USB-A9263 board manufactured by Calao Systems
>> (http://www.calao-systems.com/).
>> Code is based on old U-Boot sources (2010.09) released by Calao and
>> existing AT92SAM9263-EK code.
>>
>> Signed-off-by: Mateusz Kulikowski<mateusz.kulikowski at gmail.com>
>> ---
>>   board/calao/usb_a9263/Makefile    |  34 ++++++++
>>   board/calao/usb_a9263/usb_a9263.c | 167 +++++++++++++++++++++++++++++++++++++
>>   boards.cfg                        |   1 +
>>   include/configs/usb_a9263.h       | 168 ++++++++++++++++++++++++++++++++++++++
>>   4 files changed, 370 insertions(+)
>>   create mode 100644 board/calao/usb_a9263/Makefile
>>   create mode 100644 board/calao/usb_a9263/usb_a9263.c
>>   create mode 100644 include/configs/usb_a9263.h
>>
[...]
>> diff --git a/board/calao/usb_a9263/usb_a9263.c b/board/calao/usb_a9263/usb_a9263.c
>> new file mode 100644
>> index 0000000..bbc1e25
>> --- /dev/null
>> +++ b/board/calao/usb_a9263/usb_a9263.c
>> @@ -0,0 +1,167 @@
[...]
>> +#ifdef CONFIG_MACB
>> +static void usb_a9263_macb_hw_init(void)
>> +{
>> +	unsigned long erstl;
>> +	at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
>> +	at91_rstc_t *rstc = (at91_rstc_t *)ATMEL_BASE_RSTC;
>> +
>> +	/* Enable clock */
>> +	writel(1<<  ATMEL_ID_EMAC,&pmc->pcer);
>> +
>> +	/*
>> +	 * Disable pull-up on:
>> +	 *  RXDV (PC25) =>  PHY normal mode (not Test mode)
>> +	 *  ERX0 (PE25) =>  PHY ADDR0
>> +	 *  ERX1 (PE26) =>  PHY ADDR1 =>  PHYADDR = 0x0
>> +	 *
>> +	 * PHY has internal pull-down
>> +	 */
>> +	at91_set_pio_pullup(AT91_PIO_PORTC, 25, 0);
>> +	at91_set_pio_pullup(AT91_PIO_PORTE, 25, 0);
>> +	at91_set_pio_pullup(AT91_PIO_PORTE, 26, 0);
>> +
>> +	erstl = readl(&rstc->mr)&  AT91_RSTC_MR_ERSTL_MASK;
>> +
>> +	/* Need to reset PHY ->  500ms reset */
>> +	writel(AT91_RSTC_KEY | AT91_RSTC_MR_ERSTL(0x0D) |
>> +	       AT91_RSTC_MR_URSTEN,&rstc->mr);
>> +
>> +	writel(AT91_RSTC_KEY | AT91_RSTC_CR_EXTRST,&rstc->cr);
>> +
>> +	/* Wait for end hardware reset */
>> +	while (!(readl(&rstc->sr)&  AT91_RSTC_SR_NRSTL))
>> +		;
>> +
>> +	/* Restore NRST value */
>> +	writel(AT91_RSTC_KEY | erstl | AT91_RSTC_MR_URSTEN,&rstc->mr);
>> +
>> +	/* Re-enable pull-up */
>> +	at91_set_pio_pullup(AT91_PIO_PORTC, 25, 1);
>> +	at91_set_pio_pullup(AT91_PIO_PORTE, 25, 1);
>> +	at91_set_pio_pullup(AT91_PIO_PORTE, 26, 1);
>> +
>> +	at91_macb_hw_init();
>
> Heiko proposed a solution for unifying macb reset sequence.
>
> @Heiko will you send another patch?

I thought I wait for your GPIO update patches, and rebase my patch-
serie for the siemens boards on them ...

Ok, based on the spl patches from bo shen, see

http://lists.denx.de/pipermail/u-boot/2013-November/166272.html

I can sent soon the "phy_reset" patch, if the patch passes a
"MAKEALL" ;-)

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list