Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/allwinner different pinset for A31



details:   https://anonhg.NetBSD.org/src/rev/bc174be22825
branches:  trunk
changeset: 333048:bc174be22825
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Oct 15 23:29:46 2014 +0000

description:
different pinset for A31

diffstat:

 sys/arch/arm/allwinner/awin_com.c |  26 +++++++++++++++++++++-----
 1 files changed, 21 insertions(+), 5 deletions(-)

diffs (59 lines):

diff -r a46a9043efeb -r bc174be22825 sys/arch/arm/allwinner/awin_com.c
--- a/sys/arch/arm/allwinner/awin_com.c Wed Oct 15 23:29:24 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_com.c Wed Oct 15 23:29:46 2014 +0000
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: awin_com.c,v 1.5 2014/03/13 23:45:32 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_com.c,v 1.6 2014/10/15 23:29:46 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -77,6 +77,10 @@
        { 'A', AWIN_PIO_PA_UART7_FUNC, AWIN_PIO_PA_UART7_PINS },
 };
 
+static const struct awin_gpio_pinset awin_com_pinsets_a31[] = {
+       { 'H', AWIN_A31_PIO_PH_UART0_FUNC, AWIN_A31_PIO_PH_UART0_PINS },
+};
+
 CFATTACH_DECL_NEW(awin_com, sizeof(struct awin_com_softc),
        awin_com_match, awin_com_attach, NULL, NULL);
 
@@ -89,8 +93,14 @@
        const struct awin_locators * const loc = &aio->aio_loc;
        bus_space_tag_t iot = aio->aio_core_a4x_bst;
        bus_space_handle_t bsh;
-       const struct awin_gpio_pinset * const pinset = loc->loc_port +
-           ((cf->cf_flags & 1) ? awin_com_alt_pinsets : awin_com_pinsets);
+       const struct awin_gpio_pinset *pinset;
+
+       if (awin_chip_id() == AWIN_CHIP_ID_A31) {
+               pinset = awin_com_pinsets_a31;
+       } else {
+               pinset = loc->loc_port + ((cf->cf_flags & 1) ?
+                   awin_com_alt_pinsets : awin_com_pinsets);
+       }
 
        KASSERT(!strcmp(cf->cf_name, loc->loc_name));
        KASSERT(loc->loc_offset >= AWIN_UART0_OFFSET);
@@ -128,10 +138,16 @@
        const struct awin_locators * const loc = &aio->aio_loc;
        bus_space_tag_t iot = aio->aio_core_a4x_bst;
        const bus_addr_t iobase = AWIN_CORE_PBASE + loc->loc_offset;
-       const struct awin_gpio_pinset * const pinset = loc->loc_port +
-           ((cf->cf_flags & 1) ? awin_com_alt_pinsets : awin_com_pinsets);
+       const struct awin_gpio_pinset *pinset;
        bus_space_handle_t ioh;
 
+       if (awin_chip_id() == AWIN_CHIP_ID_A31) {
+               pinset = awin_com_pinsets_a31;
+       } else {
+               pinset = loc->loc_port + ((cf->cf_flags & 1) ?
+                   awin_com_alt_pinsets : awin_com_pinsets);
+       }
+
        awin_com_ports |= __BIT(loc->loc_port);
 
        awin_gpio_pinset_acquire(pinset);



Home | Main Index | Thread Index | Old Index