Page MenuHomeFreeBSD

Allwinner A31/A31S R-GPIO
ClosedPublic

Authored by manu_bidouilliste.com on Apr 12 2016, 10:33 PM.

Details

Summary

Add support for the other gpio controller found in A31/A31S
It need D5580

Test Plan

Apply patch and build kernel, test on Bananapi M2 (A31S)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

manu_bidouilliste.com retitled this revision from to Allwinner A31/A31S R-GPIO.
manu_bidouilliste.com updated this object.
manu_bidouilliste.com edited the test plan for this revision. (Show Details)
manu_bidouilliste.com added a reviewer: ARM.
manu_bidouilliste.com set the repository for this revision to rS FreeBSD src repository - subversion.
manu_bidouilliste.com added a project: ARM.
jmcneill added inline comments.
sys/arm/allwinner/a10_gpio.c
596 ↗(On Diff #15127)

Should this be protected with ifdef SOC_ALLWINNER_xxx ?

sys/arm/allwinner/a31/a31_r_padconf.c
37 ↗(On Diff #15127)

#ifdef SOC_ALLWINNER_xxx ?

manu_bidouilliste.com removed rS FreeBSD src repository - subversion as the repository for this revision.

Protect a31_r_padconf with ifdefs

sys/arm/allwinner/a10_gpio.c
568 ↗(On Diff #15361)

As discussed on IRC, we should move the padconf values to compat_data[] ocd_data, so something like:

static struct ofw_compat_data compat_data[] = {
#ifdef SOC_ALLWINNER_A10
    { "allwinner,sun4i-a10-pinctrl",  (uintptr_t)&a10_padconf },
#endif
    ...

and here we can simply do:

sc->padconf = (struct allwinner_padconf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data;

Put the padconf in the compat_data struct.

sys/arm/allwinner/a10_gpio.c
111 ↗(On Diff #15417)

Instead of the ifndef below, why don't we just say #if defined(SOC_ALLWINNER_A31) || defined(SOC_ALLWINNER_A31S) here? Same for the extern above.

sys/arm/allwinner/a10_gpio.c
111 ↗(On Diff #15417)

Because sometimes I'm stupid that's why :)
I'll change that

manu_bidouilliste.com set the repository for this revision to rS FreeBSD src repository - subversion.

Simplify the inclusion of the r-gpio padconf.

sys/arm/allwinner/a10_gpio.c
117 ↗(On Diff #15456)

This compat string is duplicated on line 111

This revision is now accepted and ready to land.Apr 22 2016, 9:43 AM
This revision was automatically updated to reflect the committed changes.