Module Name: src Committed By: skrll Date: Sat Nov 28 14:38:50 UTC 2020
Modified Files: src/sys/arch/arm/imx: files.imx23 imx23_pinctrl.c imx23_pinctrlvar.h imx23_usb.c src/sys/arch/evbarm/conf: IMX23_OLINUXINO Log Message: Fix build by renaming the pinctrl driver To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/imx/files.imx23 cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/imx/imx23_pinctrl.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/imx/imx23_pinctrlvar.h cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/imx/imx23_usb.c cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/IMX23_OLINUXINO Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/imx/files.imx23 diff -u src/sys/arch/arm/imx/files.imx23:1.5 src/sys/arch/arm/imx/files.imx23:1.6 --- src/sys/arch/arm/imx/files.imx23:1.5 Thu Nov 26 12:56:34 2020 +++ src/sys/arch/arm/imx/files.imx23 Sat Nov 28 14:38:50 2020 @@ -1,4 +1,4 @@ -# $Id: files.imx23,v 1.5 2020/11/26 12:56:34 skrll Exp $ +# $Id: files.imx23,v 1.6 2020/11/28 14:38:50 skrll Exp $ # # Freescale i.MX23 applications processor configuration info. # @@ -67,9 +67,9 @@ attach digctl at apbh file arch/arm/imx/imx23_digctl.c digctl # PIN Control -device pinctrl: gpiobus -attach pinctrl at apbh -file arch/arm/imx/imx23_pinctrl.c pinctrl +device imxpctl: gpiobus +attach imxpctl at apbh with imx23_pinctrl +file arch/arm/imx/imx23_pinctrl.c imx23_pinctrl # Clock Control device clkctrl Index: src/sys/arch/arm/imx/imx23_pinctrl.c diff -u src/sys/arch/arm/imx/imx23_pinctrl.c:1.3 src/sys/arch/arm/imx/imx23_pinctrl.c:1.4 --- src/sys/arch/arm/imx/imx23_pinctrl.c:1.3 Thu Nov 26 12:56:34 2020 +++ src/sys/arch/arm/imx/imx23_pinctrl.c Sat Nov 28 14:38:50 2020 @@ -1,4 +1,4 @@ -/* $Id: imx23_pinctrl.c,v 1.3 2020/11/26 12:56:34 skrll Exp $ */ +/* $Id: imx23_pinctrl.c,v 1.4 2020/11/28 14:38:50 skrll Exp $ */ /* * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -45,37 +45,37 @@ #define GPIO_PINS 96 -typedef struct pinctrl_softc { +typedef struct imx23_pinctrl_softc { device_t sc_dev; bus_space_tag_t sc_iot; bus_space_handle_t sc_hdl; struct gpio_chipset_tag gc; gpio_pin_t pins[GPIO_PINS]; -} *pinctrl_softc_t; +} *imx23_pinctrl_softc_t; -static int pinctrl_match(device_t, cfdata_t, void *); -static void pinctrl_attach(device_t, device_t, void *); -static int pinctrl_activate(device_t, enum devact); +static int imx23_pinctrl_match(device_t, cfdata_t, void *); +static void imx23_pinctrl_attach(device_t, device_t, void *); +static int imx23_pinctrl_activate(device_t, enum devact); #if notyet -static void pinctrl_reset(struct pinctrl_softc *); +static void imx23_pinctrl_reset(struct imx23_pinctrl_softc *); #endif -static void pinctrl_init(struct pinctrl_softc *); +static void imx23_pinctrl_init(struct imx23_pinctrl_softc *); -static int pinctrl_gp_gc_open(void *, device_t); -static void pinctrl_gp_gc_close(void *, device_t); -static int pinctrl_gp_pin_read(void *, int); -static void pinctrl_gp_pin_write(void *, int, int); -static void pinctrl_gp_pin_ctl(void *, int, int); - -static pinctrl_softc_t _sc = NULL; - -CFATTACH_DECL3_NEW(pinctrl, - sizeof(struct pinctrl_softc), - pinctrl_match, - pinctrl_attach, +static int imx23_pinctrl_gp_gc_open(void *, device_t); +static void imx23_pinctrl_gp_gc_close(void *, device_t); +static int imx23_pinctrl_gp_pin_read(void *, int); +static void imx23_pinctrl_gp_pin_write(void *, int, int); +static void imx23_pinctrl_gp_pin_ctl(void *, int, int); + +static imx23_pinctrl_softc_t _sc = NULL; + +CFATTACH_DECL3_NEW(imx23_pinctrl, + sizeof(struct imx23_pinctrl_softc), + imx23_pinctrl_match, + imx23_pinctrl_attach, NULL, - pinctrl_activate, + imx23_pinctrl_activate, NULL, NULL, 0 @@ -366,7 +366,7 @@ const static int pin_caps[GPIO_PINS] = { #define PINCTRL_SOFT_RST_LOOP 455 /* At least 1 us ... */ static int -pinctrl_match(device_t parent, cfdata_t match, void *aux) +imx23_pinctrl_match(device_t parent, cfdata_t match, void *aux) { struct apb_attach_args *aa = aux; @@ -378,32 +378,31 @@ pinctrl_match(device_t parent, cfdata_t } static void -pinctrl_attach(device_t parent, device_t self, void *aux) +imx23_pinctrl_attach(device_t parent, device_t self, void *aux) { - struct pinctrl_softc *sc = device_private(self); + struct imx23_pinctrl_softc *sc = device_private(self); struct apb_attach_args *aa = aux; - static int pinctrl_attached = 0; + static int imx23_pinctrl_attached = 0; sc->sc_dev = self; sc->sc_iot = aa->aa_iot; - if (pinctrl_attached) { + if (imx23_pinctrl_attached) { aprint_error_dev(sc->sc_dev, "already attached\n"); return; } if (bus_space_map(sc->sc_iot, aa->aa_addr, aa->aa_size, 0, - &sc->sc_hdl)) - { + &sc->sc_hdl)) { aprint_error_dev(sc->sc_dev, "Unable to map bus space\n"); return; } #if notyet - pinctrl_reset(sc); + imx23_pinctrl_reset(sc); #endif - pinctrl_init(sc); + imx23_pinctrl_init(sc); aprint_normal(": PIN MUX & GPIO\n"); @@ -413,14 +412,14 @@ pinctrl_attach(device_t parent, device_t sc->pins[i].pin_caps = pin_caps[i]; } - pinctrl_attached = 1; + imx23_pinctrl_attached = 1; sc->gc.gp_cookie = sc; - sc->gc.gp_gc_open = pinctrl_gp_gc_open; - sc->gc.gp_gc_close = pinctrl_gp_gc_close; - sc->gc.gp_pin_read = pinctrl_gp_pin_read; - sc->gc.gp_pin_write = pinctrl_gp_pin_write; - sc->gc.gp_pin_ctl = pinctrl_gp_pin_ctl; + sc->gc.gp_gc_open = imx23_pinctrl_gp_gc_open; + sc->gc.gp_gc_close = imx23_pinctrl_gp_gc_close; + sc->gc.gp_pin_read = imx23_pinctrl_gp_pin_read; + sc->gc.gp_pin_write = imx23_pinctrl_gp_pin_write; + sc->gc.gp_pin_ctl = imx23_pinctrl_gp_pin_ctl; struct gpiobus_attach_args gpiobus_aa; gpiobus_aa.gba_gc = &sc->gc; @@ -433,14 +432,14 @@ pinctrl_attach(device_t parent, device_t } static int -pinctrl_activate(device_t self, enum devact act) +imx23_pinctrl_activate(device_t self, enum devact act) { return EOPNOTSUPP; } static void -pinctrl_init(struct pinctrl_softc *sc) +imx23_pinctrl_init(struct imx23_pinctrl_softc *sc) { _sc = sc; return; @@ -451,7 +450,7 @@ pinctrl_init(struct pinctrl_softc *sc) * Inspired by i.MX23 RM "39.3.10 Correct Way to Soft Reset a Block" */ static void -pinctrl_reset(struct pinctrl_softc *sc) +imx23_pinctrl_reset(struct imx23_pinctrl_softc *sc) { unsigned int loop; @@ -499,39 +498,39 @@ pinctrl_reset(struct pinctrl_softc *sc) * MAXI boards. We configure this pin to logic 1. */ void -pinctrl_en_usb(void) +imx23_pinctrl_en_usb(void) { - struct pinctrl_softc *sc = _sc; + struct imx23_pinctrl_softc *sc = _sc; if (sc == NULL) { - aprint_error("pinctrl is not initialized"); + aprint_error("imx23_pinctrl is not initialized"); return; } - pinctrl_gp_pin_ctl(sc, 17, GPIO_PIN_OUTPUT); + imx23_pinctrl_gp_pin_ctl(sc, 17, GPIO_PIN_OUTPUT); delay(1000); - pinctrl_gp_pin_write(sc, 17, 1); + imx23_pinctrl_gp_pin_write(sc, 17, 1); return; } static int -pinctrl_gp_gc_open(void *cookie, device_t dev) +imx23_pinctrl_gp_gc_open(void *cookie, device_t dev) { return 0; } static void -pinctrl_gp_gc_close(void *cookie, device_t dev) +imx23_pinctrl_gp_gc_close(void *cookie, device_t dev) { return; } static int -pinctrl_gp_pin_read(void *cookie, int pin) +imx23_pinctrl_gp_pin_read(void *cookie, int pin) { int value; - pinctrl_softc_t sc = (pinctrl_softc_t) cookie; + imx23_pinctrl_softc_t sc = (imx23_pinctrl_softc_t) cookie; if (PINCTRL_RD(sc, PIN2DIN_REG(pin)) & PIN2DIN_MASK(pin)) value = 1; @@ -542,9 +541,9 @@ pinctrl_gp_pin_read(void *cookie, int pi } static void -pinctrl_gp_pin_write(void *cookie, int pin, int value) +imx23_pinctrl_gp_pin_write(void *cookie, int pin, int value) { - pinctrl_softc_t sc = (pinctrl_softc_t) cookie; + imx23_pinctrl_softc_t sc = (imx23_pinctrl_softc_t) cookie; if (value) PINCTRL_WR(sc, PIN2DOUT_SET_REG(pin), PIN2DOUT_MASK(pin)); @@ -558,9 +557,9 @@ pinctrl_gp_pin_write(void *cookie, int p * Configure pin as requested in flags. */ static void -pinctrl_gp_pin_ctl(void *cookie, int pin, int flags) +imx23_pinctrl_gp_pin_ctl(void *cookie, int pin, int flags) { - pinctrl_softc_t sc = (pinctrl_softc_t) cookie; + imx23_pinctrl_softc_t sc = (imx23_pinctrl_softc_t) cookie; uint32_t tmpr; /* Enable GPIO pin. */ Index: src/sys/arch/arm/imx/imx23_pinctrlvar.h diff -u src/sys/arch/arm/imx/imx23_pinctrlvar.h:1.1 src/sys/arch/arm/imx/imx23_pinctrlvar.h:1.2 --- src/sys/arch/arm/imx/imx23_pinctrlvar.h:1.1 Mon Oct 7 17:36:40 2013 +++ src/sys/arch/arm/imx/imx23_pinctrlvar.h Sat Nov 28 14:38:50 2020 @@ -1,4 +1,4 @@ -/* $Id: imx23_pinctrlvar.h,v 1.1 2013/10/07 17:36:40 matt Exp $ */ +/* $Id: imx23_pinctrlvar.h,v 1.2 2020/11/28 14:38:50 skrll Exp $ */ /* * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -32,6 +32,6 @@ #ifndef _ARM_IMX_IMX23_PINCTRLVAR_H_ #define _ARM_IMX_IMX23_PINCTRLVAR_H_ -void pinctrl_en_usb(void); +void imx23_pinctrl_en_usb(void); #endif /* !_ARM_IMX_IMX23_PINCTRLVAR_H_ */ Index: src/sys/arch/arm/imx/imx23_usb.c diff -u src/sys/arch/arm/imx/imx23_usb.c:1.2 src/sys/arch/arm/imx/imx23_usb.c:1.3 --- src/sys/arch/arm/imx/imx23_usb.c:1.2 Wed Jul 24 11:20:55 2019 +++ src/sys/arch/arm/imx/imx23_usb.c Sat Nov 28 14:38:50 2020 @@ -1,4 +1,4 @@ -/* $Id: imx23_usb.c,v 1.2 2019/07/24 11:20:55 hkenken Exp $ */ +/* $Id: imx23_usb.c,v 1.3 2020/11/28 14:38:50 skrll Exp $ */ /* * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -113,7 +113,7 @@ imx23_usb_attach(device_t parent, device clkctrl_en_usb(); /* Enable external USB chip. */ - pinctrl_en_usb(); + imx23_pinctrl_en_usb(); /* USB clock on. */ digctl_usb_clkgate(0); Index: src/sys/arch/evbarm/conf/IMX23_OLINUXINO diff -u src/sys/arch/evbarm/conf/IMX23_OLINUXINO:1.18 src/sys/arch/evbarm/conf/IMX23_OLINUXINO:1.19 --- src/sys/arch/evbarm/conf/IMX23_OLINUXINO:1.18 Wed Feb 6 11:58:30 2019 +++ src/sys/arch/evbarm/conf/IMX23_OLINUXINO Sat Nov 28 14:38:50 2020 @@ -1,4 +1,4 @@ -# $Id: IMX23_OLINUXINO,v 1.18 2019/02/06 11:58:30 rin Exp $ +# $Id: IMX23_OLINUXINO,v 1.19 2020/11/28 14:38:50 skrll Exp $ # # IMX23_OLINUXINO -- Olimex i.MX23 OLinuXino kernel configuration file. # @@ -39,8 +39,8 @@ ld* at sdmmc? digctl0 at apbh? addr 0x8001C000 size 0x2000 irq -1 # PIN control -pinctrl0 at apbh? addr 0x80018000 size 0x2000 irq -1 -gpio* at pinctrl? +imxpctl0 at apbh? addr 0x80018000 size 0x2000 irq -1 +gpio* at imxpctl? # APBX bus apbx0 at mainbus? base 0x80040000 size 0x40000