Allwinner A13 support (patches attached)

Jakob Alvermark jakob at alvermark.net
Thu Oct 9 20:44:01 UTC 2014


On Thu, October 9, 2014 21:15, Luiz Otavio O Souza wrote:
> On 9 October 2014 01:46, Ganbold Tsagaankhuu wrote:
>
>> On Wed, Oct 8, 2014 at 4:18 AM, Jakob Alvermark wrote:
>>
>>
>>> Hello people!
>>>
>
> Hello Jakob,
>
>
>>>
>>> I have been sitting on this for too long now. (Thanks Arun Thomas for
>>>  encouraging me to send this!) I have this Allwinner A13 board from
>>> Olimex,
>>>
>>>
>>> https://www.olimex.com/Products/OLinuXino/A13/A13-OLinuXino/open-sour
>>> ce-hardware
>>>
>>> I have made it boot FreeBSD-current, and here are the patches. Hoping
>>>  anyone (committers?) might be interrested in looking at this.
>>>
>
> Yay, nice work!
>
>
>>> I also wanted to blink the onboard LED, so this is in the dts file:)
>>> ---
>>> leds { compatible = "gpio-leds";
>>>
>>> led1 { label = "led1"; gpios = <&gpio 201 1>; };
>>> };
>>> ---
>>> I do not get a /dev/led/led1 as I expected, manually toggling the LED
>>> with 'gpioctl -t 201' works fine...
>>>
>
> The gpio node from the DTS you are using (sun5i-a13.dtsi) uses '3' as
> #gpio-cells:
>
>
> gpio: gpio at 01c20800 {
> #gpio-cells = <3>;
> compatible = "allwinner,sun5i-gpio"; gpio-controller; reg =<  0x01c20800
> 0x400 >;
> interrupts = < 28 >; interrupt-parent = <&AINTC>; };
>
>
> So you need to adjust the gpios property for led and add a third value
> (in this case: pin number, not used, pin flags):
>
>
> leds { compatible = "gpio-leds";
>
> led1 { name =  "led1"; gpios = <&gpio 201 0 1>; };
> };

OK, cool, I see. I will try that. (I have to learn more about DTS)

> Changing the #gpio-cells back to 2 would also work.
>
>
>>>
>>
>> Cool.
>>
>>
>> Can a10_gpio.c and a13_gpio.c combined into one?
>> Also you disabled some gpio settings in a10_ehci.c I guess olinuxino has
>>  u-boot and u-boot sets that, or maybe different pins. I think instead
>> of disabling better make it work for both cubieboard and olinuxino.
>
> Yes, they can. I've checked and the only differences are the number of
> available banks and pins. We have a similar situation with ti_gpio.c.

I will do that, I don't know what I was thinking there. As you say, the
only difference is that the A13 has less ports.


> You could use the DTS to pass the gpio pin (or pins) we need to tweak
> at boot to enable the onboard devices.

I guess the initial A10 support was done with a Cubieboard. It has USB
power controlled by the GPIO pins. My board does not have that, the
default is that USB power is always on (although you could set a jumper,
and you would be able to control the power to all 3 USB ports with one
pin).
I believe this should not be hardcoded as it is now. Other boards with
these SOC's could have those pins wired to something completely different.

How would you do it using the DTS?

Thanks for you help,
Jakob




More information about the freebsd-arm mailing list