1 1.1 jmcneill /* $NetBSD: omap.h,v 1.1.1.4 2021/11/07 16:49:56 jmcneill Exp $ */ 2 1.1 jmcneill 3 1.1.1.2 jmcneill /* SPDX-License-Identifier: GPL-2.0 */ 4 1.1 jmcneill /* 5 1.1 jmcneill * This header provides constants for OMAP pinctrl bindings. 6 1.1 jmcneill * 7 1.1 jmcneill * Copyright (C) 2009 Nokia 8 1.1 jmcneill * Copyright (C) 2009-2010 Texas Instruments 9 1.1 jmcneill */ 10 1.1 jmcneill 11 1.1 jmcneill #ifndef _DT_BINDINGS_PINCTRL_OMAP_H 12 1.1 jmcneill #define _DT_BINDINGS_PINCTRL_OMAP_H 13 1.1 jmcneill 14 1.1 jmcneill /* 34xx mux mode options for each pin. See TRM for options */ 15 1.1 jmcneill #define MUX_MODE0 0 16 1.1 jmcneill #define MUX_MODE1 1 17 1.1 jmcneill #define MUX_MODE2 2 18 1.1 jmcneill #define MUX_MODE3 3 19 1.1 jmcneill #define MUX_MODE4 4 20 1.1 jmcneill #define MUX_MODE5 5 21 1.1 jmcneill #define MUX_MODE6 6 22 1.1 jmcneill #define MUX_MODE7 7 23 1.1 jmcneill 24 1.1 jmcneill /* 24xx/34xx mux bit defines */ 25 1.1 jmcneill #define PULL_ENA (1 << 3) 26 1.1 jmcneill #define PULL_UP (1 << 4) 27 1.1 jmcneill #define ALTELECTRICALSEL (1 << 5) 28 1.1 jmcneill 29 1.1 jmcneill /* omap3/4/5 specific mux bit defines */ 30 1.1 jmcneill #define INPUT_EN (1 << 8) 31 1.1 jmcneill #define OFF_EN (1 << 9) 32 1.1 jmcneill #define OFFOUT_EN (1 << 10) 33 1.1 jmcneill #define OFFOUT_VAL (1 << 11) 34 1.1 jmcneill #define OFF_PULL_EN (1 << 12) 35 1.1 jmcneill #define OFF_PULL_UP (1 << 13) 36 1.1 jmcneill #define WAKEUP_EN (1 << 14) 37 1.1 jmcneill #define WAKEUP_EVENT (1 << 15) 38 1.1 jmcneill 39 1.1 jmcneill /* Active pin states */ 40 1.1 jmcneill #define PIN_OUTPUT 0 41 1.1 jmcneill #define PIN_OUTPUT_PULLUP (PIN_OUTPUT | PULL_ENA | PULL_UP) 42 1.1 jmcneill #define PIN_OUTPUT_PULLDOWN (PIN_OUTPUT | PULL_ENA) 43 1.1 jmcneill #define PIN_INPUT INPUT_EN 44 1.1 jmcneill #define PIN_INPUT_PULLUP (PULL_ENA | INPUT_EN | PULL_UP) 45 1.1 jmcneill #define PIN_INPUT_PULLDOWN (PULL_ENA | INPUT_EN) 46 1.1 jmcneill 47 1.1 jmcneill /* Off mode states */ 48 1.1 jmcneill #define PIN_OFF_NONE 0 49 1.1 jmcneill #define PIN_OFF_OUTPUT_HIGH (OFF_EN | OFFOUT_EN | OFFOUT_VAL) 50 1.1 jmcneill #define PIN_OFF_OUTPUT_LOW (OFF_EN | OFFOUT_EN) 51 1.1 jmcneill #define PIN_OFF_INPUT_PULLUP (OFF_EN | OFFOUT_EN | OFF_PULL_EN | OFF_PULL_UP) 52 1.1 jmcneill #define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFFOUT_EN | OFF_PULL_EN) 53 1.1 jmcneill #define PIN_OFF_WAKEUPENABLE WAKEUP_EN 54 1.1 jmcneill 55 1.1 jmcneill /* 56 1.1 jmcneill * Macros to allow using the absolute physical address instead of the 57 1.1 jmcneill * padconf registers instead of the offset from padconf base. 58 1.1 jmcneill */ 59 1.1 jmcneill #define OMAP_IOPAD_OFFSET(pa, offset) (((pa) & 0xffff) - (offset)) 60 1.1 jmcneill 61 1.1 jmcneill #define OMAP2420_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0030) (val) 62 1.1 jmcneill #define OMAP2430_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2030) (val) 63 1.1 jmcneill #define OMAP3_CORE1_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2030) (val) 64 1.1 jmcneill #define OMAP3430_CORE2_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x25d8) (val) 65 1.1 jmcneill #define OMAP3630_CORE2_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x25a0) (val) 66 1.1 jmcneill #define OMAP3_WKUP_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2a00) (val) 67 1.1 jmcneill #define DM814X_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) 68 1.1 jmcneill #define DM816X_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) 69 1.1.1.4 jmcneill #define AM33XX_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val) (0) 70 1.1.1.4 jmcneill #define AM33XX_PADCONF(pa, conf, mux) OMAP_IOPAD_OFFSET((pa), 0x0800) (conf) (mux) 71 1.1 jmcneill 72 1.1 jmcneill /* 73 1.1 jmcneill * Macros to allow using the offset from the padconf physical address 74 1.1 jmcneill * instead of the offset from padconf base. 75 1.1 jmcneill */ 76 1.1 jmcneill #define OMAP_PADCONF_OFFSET(offset, base_offset) ((offset) - (base_offset)) 77 1.1 jmcneill 78 1.1 jmcneill #define OMAP4_IOPAD(offset, val) OMAP_PADCONF_OFFSET((offset), 0x0040) (val) 79 1.1 jmcneill #define OMAP5_IOPAD(offset, val) OMAP_PADCONF_OFFSET((offset), 0x0040) (val) 80 1.1 jmcneill 81 1.1 jmcneill /* 82 1.1 jmcneill * Define some commonly used pins configured by the boards. 83 1.1 jmcneill * Note that some boards use alternative pins, so check 84 1.1 jmcneill * the schematics before using these. 85 1.1 jmcneill */ 86 1.1 jmcneill #define OMAP3_UART1_RX 0x152 87 1.1 jmcneill #define OMAP3_UART2_RX 0x14a 88 1.1 jmcneill #define OMAP3_UART3_RX 0x16e 89 1.1 jmcneill #define OMAP4_UART2_RX 0xdc 90 1.1 jmcneill #define OMAP4_UART3_RX 0x104 91 1.1 jmcneill #define OMAP4_UART4_RX 0x11c 92 1.1 jmcneill 93 1.1 jmcneill #endif 94 1.1 jmcneill 95