Created
July 27, 2016 17:53
-
-
Save adukot/0e1b1e28b2de9c6e4f75a043c911599d to your computer and use it in GitHub Desktop.
LinkIt Smart 7688 NetBSD/evbmips WIP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: sys/arch/evbmips/conf/LINKITSMART | |
=================================================================== | |
RCS file: sys/arch/evbmips/conf/LINKITSMART | |
diff -N sys/arch/evbmips/conf/LINKITSMART | |
--- /dev/null 1 Jan 1970 00:00:00 -0000 | |
+++ sys/arch/evbmips/conf/LINKITSMART 27 Jul 2016 17:19:21 -0000 | |
@@ -0,0 +1,253 @@ | |
+# $NetBSD: ZYXELKX,v 1.6 2015/08/07 14:12:04 maxv Exp $ | |
+ | |
+include "arch/evbmips/conf/std.rasoc" | |
+ | |
+makeoptions COPY_SYMTAB=1 # size for embedded symbol table | |
+ | |
+options RALINK_CONSOLE_EARLY | |
+options MT7620 | |
+options MT7688 | |
+options RALINK_ETH_NUM_SW_PARTITIONS=5 | |
+options CONSPEED=57600 | |
+ | |
+maxusers 8 | |
+ | |
+# Size reduction options | |
+#options VNODE_OP_NOINLINE | |
+#options PIPE_SOCKETPAIR # smaller, but slower pipe(2) | |
+#options SOSEND_NO_LOAN | |
+ | |
+# Standard system options | |
+ | |
+options INSECURE # disable kernel security levels - X needs this | |
+ | |
+options RTC_OFFSET=0 # hardware clock is this many mins. west of GMT | |
+#options NTP # NTP phase/frequency locked loop | |
+ | |
+#options KTRACE # system call tracing via ktrace(1) | |
+ | |
+#options SYSVMSG # System V-like message queues | |
+#options SYSVSEM # System V-like semaphores | |
+#options SYSVSHM # System V-like memory sharing | |
+#options SHMMAXPGS=2048 # 2048 pages is the default | |
+ | |
+#options NMBCLUSTERS=1024 | |
+#options MCLSHIFT=12 # 4k mbuf clusters (increases pool max's to 4k as well) | |
+ | |
+#options USERCONF # userconf(4) support | |
+#options SYSCTL_INCLUDE_DESCR # Include sysctl descriptions in kernel | |
+ | |
+# Diagnostic/debugging support options | |
+options DIAGNOSTIC # expensive kernel consistency checks | |
+#options LOCKDEBUG | |
+#options KSTACK_CHECK_MAGIC | |
+options DEBUG # expensive debugging checks/support | |
+options DDB # in-kernel debugger | |
+options DDB_ONPANIC=1 # see also sysctl(7): `ddb.onpanic' | |
+#options DDB_HISTORY_SIZE=512 # enable history editing in DDB | |
+#options DDB_COMMANDONENTER="w/b 0x90000128 0 ; bt" # disable watchdog & drop history on enter | |
+#options KGDB # remote debugger | |
+#options KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x2f8,KGDB_DEVRATE=9600 | |
+#makeoptions DEBUG="-g2" # compile full symbol table | |
+#makeoptions COPTS="-Os" # Optimise for space. | |
+ | |
+#makeoptions PROF="-p" # build profiling in | |
+#options GPROF | |
+ | |
+# Compatibility options | |
+#options COMPAT_NOMID # NetBSD 0.8, 386BSD, and BSDI | |
+#options COMPAT_09 # NetBSD 0.9, | |
+#options COMPAT_10 # NetBSD 1.0, | |
+#options COMPAT_11 # NetBSD 1.1, | |
+#options COMPAT_12 # NetBSD 1.2 (and 386BSD and BSDI), | |
+#options COMPAT_13 # NetBSD 1.3 (and 386BSD and BSDI), | |
+#options COMPAT_14 # NetBSD 1.4, | |
+#options COMPAT_15 # NetBSD 1.5, | |
+#options COMPAT_16 # NetBSD 1.6, | |
+#options COMPAT_20 # NetBSD 2.0, | |
+#options COMPAT_30 # NetBSD 3.0, | |
+#options COMPAT_40 # NetBSD 4.0, | |
+#options COMPAT_50 # NetBSD 5.0, | |
+#options COMPAT_60 # NetBSD 6.0, and | |
+#options COMPAT_70 # NetBSD 7.0 binary compatibility. | |
+#options COMPAT_43 # 4.3BSD, 386BSD, and BSDI | |
+#options COMPAT_386BSD_MBRPART # recognize old partition ID | |
+#options TCP_COMPAT_42 # 4.2BSD TCP/IP bug compat. Not recommended. | |
+ | |
+#options COMPAT_SVR4 # binary compatibility with SVR4 | |
+#options COMPAT_IBCS2 # binary compatibility with SCO and ISC | |
+#options COMPAT_LINUX # binary compatibility with Linux | |
+#options COMPAT_FREEBSD # binary compatibility with FreeBSD | |
+#options COMPAT_BSDPTY # /dev/[pt]ty?? ptys. | |
+ | |
+# File systems | |
+file-system FFS # UFS | |
+#file-system EXT2FS # second extended file system (linux) | |
+#file-system LFS # log-structured file system | |
+file-system MFS # memory file system | |
+#file-system NFS # Network File System client | |
+#file-system CD9660 # ISO 9660 + Rock Ridge file system | |
+file-system MSDOSFS # MS-DOS file system | |
+#file-system FDESC # /dev/fd | |
+file-system KERNFS # /kern | |
+#file-system NULLFS # loopback file system | |
+#file-system PORTAL # portal filesystem (still experimental) | |
+file-system PROCFS # /proc | |
+#file-system UMAPFS # NULLFS + uid and gid remapping | |
+#file-system UNION # union file system | |
+#file-system SMBFS # experimental - CIFS; also needs nsmb (below) | |
+#file-system PTYFS # /dev/pts/N support | |
+file-system TMPFS # Efficient memory file-system | |
+ | |
+# File system options | |
+#options QUOTA # UFS quotas | |
+#options FFS_EI # FFS Endian Independant support | |
+#options NFSSERVER # Network File System server | |
+options FFS_NO_SNAPSHOT # No FF snapshot support | |
+#options EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags (append and immutable) behave as system flags. | |
+ | |
+# Networking options | |
+#options GATEWAY # packet forwarding | |
+#options INET # IP + ICMP + TCP + UDP | |
+#options MROUTING # IP multicast routing | |
+#options INET6 # IPV6 | |
+#options IPSEC # IP security | |
+#options IPSEC_DEBUG # debug for IP security | |
+#options PIM # Protocol Independent Multicast | |
+#options NETATALK # AppleTalk networking protocols | |
+#options PPP_BSDCOMP # BSD-Compress compression support for PPP | |
+#options PPP_DEFLATE # Deflate compression support for PPP | |
+#options PPP_FILTER # Active filter support for PPP (requires bpf) | |
+#options IPFILTER_LOG # ipmon(8) log support | |
+#options IPFILTER_LOOKUP # ippool(8) support | |
+#options IPFILTER_DEFAULT_BLOCK # block all packets by default | |
+#options TCP_DEBUG # Record last TCP_NDEBUG packets with SO_DEBUG | |
+ | |
+#options ALTQ # Manipulate network interfaces' output queues | |
+#options ALTQ_BLUE # Stochastic Fair Blue | |
+#options ALTQ_CBQ # Class-Based Queueing | |
+#options ALTQ_CDNR # Diffserv Traffic Conditioner | |
+#options ALTQ_FIFOQ # First-In First-Out Queue | |
+#options ALTQ_FLOWVALVE # RED/flow-valve (red-penalty-box) | |
+#options ALTQ_HFSC # Hierarchical Fair Service Curve | |
+#options ALTQ_LOCALQ # Local queueing discipline | |
+#options ALTQ_PRIQ # Priority Queueing | |
+#options ALTQ_RED # Random Early Detection | |
+#options ALTQ_RIO # RED with IN/OUT | |
+#options ALTQ_WFQ # Weighted Fair Queueing | |
+ | |
+# JIT compiler for bpfilter | |
+#options SLJIT | |
+#options BPFJIT | |
+ | |
+# These options enable verbose messages for several subsystems. | |
+# Warning, these may compile large string tables into the kernel! | |
+#options EISAVERBOSE # verbose EISA device autoconfig messages | |
+#options PCIVERBOSE # verbose PCI device autoconfig messages | |
+#options PCI_CONFIG_DUMP # verbosely dump PCI config space | |
+#options PCMCIAVERBOSE # verbose PCMCIA configuration messages | |
+#options SCSIVERBOSE # human readable SCSI error messages | |
+#options USBVERBOSE # verbose USB device autoconfig messages | |
+ | |
+# Options for necessary to use MD | |
+#options MEMORY_DISK_HOOKS | |
+#options MEMORY_DISK_IS_ROOT # force root on memory disk | |
+#options MEMORY_DISK_SERVER=0 # no userspace memory disk support | |
+#options MEMORY_DISK_ROOT_SIZE=8192 # embed the FS into the system for now | |
+#options MEMORY_RBFLAGS=0 # keep the kernel from forcing single user mode | |
+ | |
+# Options for NFS root boot | |
+#options NFS_BOOT_DHCP,NFS_BOOT_BOOTPARAM,NFS_BOOT_BOOTSTATIC | |
+#options NFS_BOOTSTATIC_MYIP="\"192.168.0.1\"" | |
+#options NFS_BOOTSTATIC_GWIP="\"192.168.0.1\"" | |
+#options NFS_BOOTSTATIC_MASK="\"255.255.255.0\"" | |
+#options NFS_BOOTSTATIC_SERVADDR="\"192.168.0.5\"" | |
+#options NFS_BOOTSTATIC_SERVER="\"192.168.0.5:/home/andersen/nfs/mbr1400\"" | |
+ | |
+# Need more mbufs for IPsec VPN | |
+#options NMBCLUSTERS=4096 | |
+ | |
+# rt3052 dev board root on embedded NFS mount disk | |
+config netbsd root on ? type ? | |
+#config netbsd-sd0a root on sd0a type ffs dumps none | |
+#config netbsd-reth0 root on reth0 type nfs dumps none | |
+ | |
+mainbus0 at root | |
+cpu0 at mainbus? | |
+com0 at mainbus? | |
+reth* at mainbus? flags 1 | |
+rwdog0 at mainbus? | |
+options RA_WDOG_DEFAULT_PERIOD=10 | |
+#options RA_WDOG_DEFAULT_MODE=WDOG_MODE_DISARMED | |
+options RA_WDOG_DEFAULT_MODE=WDOG_MODE_KTICKLE | |
+ | |
+# PCI/PCIe support | |
+rpci0 at mainbus? | |
+pci* at rpci? | |
+ | |
+# USB support on rusb0 | |
+ehci* at mainbus? | |
+usb* at ehci? | |
+ | |
+# USB support on rusb0 | |
+ohci* at mainbus? | |
+usb* at ohci? | |
+ | |
+# GPIO support | |
+rgpio0 at mainbus? | |
+gpio* at rgpio? | |
+ | |
+# I2C support | |
+ri2c0 at mainbus? | |
+iic* at ri2c? | |
+ | |
+# NOR Flash | |
+#options NOR_VERBOSE | |
+#cfi0 at mainbus0 | |
+#nor0 at cfi0 | |
+#flash0 at nor0 offset 0x00000000 size 0x00040000 | |
+#flash1 at nor0 offset 0x00040000 size 0x00020000 | |
+#flash2 at nor0 offset 0x00060000 size 0x00020000 | |
+#flash3 at nor0 offset 0x00080000 size 0x00120000 # kernel | |
+#flash4 at nor0 offset 0x001a0000 size 0x006e0000 # filesystem | |
+#flash5 at nor0 offset 0x00880000 size 0x01760000 # upgrade | |
+#flash6 at nor0 offset 0x01fe0000 size 0x00020000 | |
+ | |
+# USB Hubs | |
+uhub* at usb? | |
+uhub* at uhub? port ? | |
+ | |
+# USB Mass Storage | |
+umass* at uhub? port ? | |
+scsibus* at scsi? | |
+sd* at scsibus? target ? lun ? | |
+ | |
+# USB Ethernet adapters | |
+#aue* at uhub? port ? # ADMtek AN986 Pegasus based adapters | |
+#axe* at uhub? port ? # ASIX AX88172 10/100 based adapters | |
+ | |
+# USB Generic driver | |
+ugen* at uhub? port ? | |
+ | |
+# PHY Support | |
+ukphy* at mii? phy ? # generic unknown PHYs | |
+#arphy* at mii? phy ? # Atheros AR8316 switch | |
+ | |
+# Pseudo-Devices | |
+ | |
+# disk/mass storage pseudo-devices | |
+ | |
+# network pseudo-devices | |
+#pseudo-device bpfilter # Berkeley packet filter | |
+#pseudo-device bridge # simple inter-network bridging | |
+#pseudo-device loop # network loopback | |
+#pseudo-device tap # virtual Ethernet | |
+#pseudo-device pf # PF packet filter | |
+#pseudo-device pflog # PF log if | |
+#pseudo-device pppoe # PPPoE protocol | |
+#pseudo-device vlan # 802.1q | |
+ | |
+# miscellaneous pseudo-devices | |
+pseudo-device pty # pseudo-terminals | |
+pseudo-device clockctl # /dev/clockctl - user control of clock subsystem | |
+pseudo-device ksyms # /dev/ksyms - kernel symbols | |
Index: sys/arch/mips/mips/locore.S | |
=================================================================== | |
RCS file: /cvsroot/src/sys/arch/mips/mips/locore.S,v | |
retrieving revision 1.197 | |
diff -u -r1.197 locore.S | |
--- sys/arch/mips/mips/locore.S 11 Jun 2015 07:30:10 -0000 1.197 | |
+++ sys/arch/mips/mips/locore.S 27 Jul 2016 17:19:22 -0000 | |
@@ -70,6 +70,8 @@ | |
#define NOP_L /* nothing */ | |
#endif | |
+#define XPUTC(n) li t3, n; jal xputc; nop | |
+ | |
.set noreorder | |
.globl start | |
@@ -87,6 +89,7 @@ | |
mtc0 v0, MIPS_COP_0_STATUS # Disable interrupts | |
COP0_SYNC | |
#else | |
+ li v0, 0x00000004 | |
mtc0 zero, MIPS_COP_0_STATUS # Disable interrupts | |
COP0_SYNC | |
#endif | |
@@ -135,7 +138,8 @@ | |
#ifdef _LP64 | |
li t0, MIPS_SR_KX | MIPS_SR_UX # turn on XKSEG and XKPHYS | |
#else | |
- li t0, 0 # Disable interrupts and | |
+ li t0, 0x00000004 # Disable interrupts and | |
+ li t0, 0 # Disable interrupts and | |
#endif | |
mtc0 t0, MIPS_COP_0_STATUS # the fp coprocessor | |
COP0_SYNC | |
@@ -191,6 +195,7 @@ | |
mtc0 v0, MIPS_COP_0_STATUS | |
#endif | |
COP0_SYNC | |
+# XPUTC(0x4e) | |
jal _C_LABEL(main) # main(void) | |
nop | |
@@ -340,6 +345,12 @@ | |
#endif /* PARANOID_SPL */ | |
END(cpu_switchto) | |
+xputc: | |
+ lui t4, 0x1000 # UART3@0x10000e00 | |
+ addi t4, t4, 0xe00 # UART3@0x10000e00 | |
+ sb t3, 0(t4) # write UART | |
+ sync | |
+ | |
#ifdef __HAVE_FAST_SOFTINTS | |
/* | |
* void softint_fast_dispatch(struct lwp *l, int s); | |
Index: sys/arch/mips/ralink/ralink_com.c | |
=================================================================== | |
RCS file: /cvsroot/src/sys/arch/mips/ralink/ralink_com.c,v | |
retrieving revision 1.4 | |
diff -u -r1.4 ralink_com.c | |
--- sys/arch/mips/ralink/ralink_com.c 30 Apr 2014 00:51:26 -0000 1.4 | |
+++ sys/arch/mips/ralink/ralink_com.c 27 Jul 2016 17:19:22 -0000 | |
@@ -272,7 +272,11 @@ | |
sc->sc_dev = self; | |
sc->sc_frequency = RA_UART_FREQ; | |
sc->sc_regs.cr_nports = 0x1000; | |
+#if defined(MT7688) | |
+ sc->sc_type = COM_TYPE_NORMAL; | |
+#else | |
sc->sc_type = COM_TYPE_AU1x00; | |
+#endif | |
sc->enabled = 1; | |
ralink_com_initmap(&sc->sc_regs); | |
@@ -288,6 +292,9 @@ | |
regsp->cr_map[COM_REG_RXDATA] = RA_UART_RBR; | |
regsp->cr_map[COM_REG_TXDATA] = RA_UART_TBR; | |
regsp->cr_map[COM_REG_DLBL] = RA_UART_DLL; | |
+#if defined(MT7688) | |
+ regsp->cr_map[COM_REG_DLBH] = RA_UART_DLM; | |
+#endif | |
regsp->cr_map[COM_REG_IER] = RA_UART_IER; | |
regsp->cr_map[COM_REG_IIR] = RA_UART_IIR; | |
regsp->cr_map[COM_REG_FIFO] = RA_UART_FCR; | |
@@ -335,6 +342,12 @@ | |
uart_write(RA_UART_DLL, | |
(RA_UART_FREQ / RA_SERIAL_CLKDIV / RA_BAUDRATE) | |
& 0xffff); | |
+ | |
+#if defined(MT7688) | |
+ uart_write(RA_UART_DLM, | |
+ ((RA_UART_FREQ / RA_SERIAL_CLKDIV / RA_BAUDRATE) & 0xffff) | |
+ >> 8); | |
+#endif | |
uart_write(RA_UART_LCR, | |
UART_LCR_WLS0 | UART_LCR_WLS1); | |
@@ -347,8 +360,12 @@ | |
0, ®s.cr_ioh)) != 0) { | |
return; | |
} | |
- | |
+#if defined(MT7688) | |
+ comcnattach1(®s, RA_BAUDRATE, RA_UART_FREQ, | |
+ COM_TYPE_NORMAL, CONMODE); | |
+#else | |
/* Ralink UART has a 16-bit rate latch (like the AU1x00) */ | |
comcnattach1(®s, RA_BAUDRATE, RA_UART_FREQ, | |
COM_TYPE_AU1x00, CONMODE); | |
+#endif | |
} | |
Index: sys/arch/mips/ralink/ralink_gpio.c | |
=================================================================== | |
RCS file: /cvsroot/src/sys/arch/mips/ralink/ralink_gpio.c,v | |
retrieving revision 1.5 | |
diff -u -r1.5 ralink_gpio.c | |
--- sys/arch/mips/ralink/ralink_gpio.c 12 Mar 2014 22:21:07 -0000 1.5 | |
+++ sys/arch/mips/ralink/ralink_gpio.c 27 Jul 2016 17:19:22 -0000 | |
@@ -437,7 +437,9 @@ | |
{ | |
KASSERTMSG((off & 3) == 0, "%s: unaligned off=%#" PRIxBUSSIZE "\n", | |
__func__, off); | |
+#if 0 | |
bus_space_write_4(sc->sc_memt, sc->sc_gp_memh, off, val); | |
+#endif | |
} | |
/* | |
@@ -511,6 +513,7 @@ | |
} | |
/* Reset some registers */ | |
+#if 0 | |
gp_write(sc, RA_PIO_00_23_INT, 0xffffff); | |
gp_write(sc, RA_PIO_00_23_EDGE_INT, 0xffffff); | |
gp_write(sc, RA_PIO_24_39_INT, 0xffff); | |
@@ -518,6 +521,7 @@ | |
gp_write(sc, RA_PIO_40_51_INT, 0xfff); | |
gp_write(sc, RA_PIO_40_51_EDGE_INT, 0xfff); | |
gp_write(sc, RA_PIO_00_23_POLARITY, 0); | |
+#endif | |
#if defined(SLICKROCK) | |
gp_write(sc, RA_PIO_72_95_INT, 0xffffff); | |
gp_write(sc, RA_PIO_72_95_EDGE_INT, 0xffffff); | |
@@ -665,6 +669,7 @@ | |
static void | |
ra_gpio_pin_init(ra_gpio_softc_t *sc, int pin) | |
{ | |
+#if 0 | |
uint32_t r; | |
sc->sc_pins[pin].pin_caps = 0; | |
@@ -737,6 +742,7 @@ | |
/* polarirty */ | |
RA_GPIO_PIN_INIT(sc, r, pin, ptp, pin_pol); | |
+#endif | |
} | |
/* | |
Index: sys/arch/mips/ralink/ralink_mainbus.c | |
=================================================================== | |
RCS file: /cvsroot/src/sys/arch/mips/ralink/ralink_mainbus.c,v | |
retrieving revision 1.4 | |
diff -u -r1.4 ralink_mainbus.c | |
--- sys/arch/mips/ralink/ralink_mainbus.c 30 Apr 2014 00:52:49 -0000 1.4 | |
+++ sys/arch/mips/ralink/ralink_mainbus.c 27 Jul 2016 17:19:22 -0000 | |
@@ -67,7 +67,7 @@ | |
} critical_devs[] = { | |
{ .name = "cpu0", .required = true }, | |
{ .name = "rwdog0", .required = false }, | |
- { .name = "rgpio0", .required = true }, | |
+ { .name = "rgpio0", .required = false }, | |
{ .name = "ri2c0", .required = false }, | |
{ .name = "com0", .required = false }, | |
}; | |
Index: sys/arch/mips/ralink/ralink_reg.h | |
=================================================================== | |
RCS file: /cvsroot/src/sys/arch/mips/ralink/ralink_reg.h,v | |
retrieving revision 1.7 | |
diff -u -r1.7 ralink_reg.h | |
--- sys/arch/mips/ralink/ralink_reg.h 30 Apr 2014 00:53:31 -0000 1.7 | |
+++ sys/arch/mips/ralink/ralink_reg.h 27 Jul 2016 17:19:22 -0000 | |
@@ -89,7 +89,11 @@ | |
#define RA_I2C_BASE 0x10000900 | |
#define RA_I2S_BASE 0x10000A00 | |
#define RA_SPI_BASE 0x10000B00 | |
-#define RA_UART_LITE_BASE 0x10000C00 | |
+#if defined(MT7688) | |
+#define RA_UART_LITE_BASE 0x10000E00 | |
+#else | |
+#define RA_UART_LITE_BASE 0x10000E00 | |
+#endif | |
#if defined(RT3883) | |
#define RA_PCM_BASE 0x10002000 | |
#define RA_GDMA_BASE 0x10002800 | |
@@ -335,12 +339,21 @@ | |
/* | |
* Interrupt Controller Registers | |
*/ | |
+#if defined(MT7688) | |
+#define RA_INTCTL_IRQ0STAT 0x9c | |
+#define RA_INTCTL_IRQ1STAT 0xa0 | |
+#define RA_INTCTL_TYPE 0x00 | |
+#define RA_INTCTL_RAW 0xa4 | |
+#define RA_INTCTL_ENABLE 0x80 | |
+#define RA_INTCTL_DISABLE 0x78 | |
+#else | |
#define RA_INTCTL_IRQ0STAT 0x00 | |
#define RA_INTCTL_IRQ1STAT 0x04 | |
#define RA_INTCTL_TYPE 0x20 | |
#define RA_INTCTL_RAW 0x30 | |
#define RA_INTCTL_ENABLE 0x34 | |
#define RA_INTCTL_DISABLE 0x38 | |
+#endif | |
#define INT_GLOBAL __BIT(31) | |
@@ -366,6 +379,32 @@ | |
/* | |
* Ralink Linear CPU Interrupt Mapping For Lists | |
*/ | |
+#if defined(MT7688) | |
+#define RA_IRQ_LOW 0 | |
+#define RA_IRQ_HIGH 1 | |
+#define RA_IRQ_PCI 2 | |
+#define RA_IRQ_FENGINE 3 | |
+#define RA_IRQ_WLAN 4 | |
+#define RA_IRQ_TIMER 5 | |
+ | |
+#define RA_IRQ_SYSCTL 1 | |
+#define RA_IRQ_TIMER0 2 | |
+#define RA_IRQ_ILLACC 3 | |
+#define RA_IRQ_PCM 4 | |
+#define RA_IRQ_PIO 6 | |
+#define RA_IRQ_DMA 7 | |
+#define RA_IRQ_I2S 10 | |
+#define RA_IRQ_UARTF 11 | |
+#define RA_IRQ_NAND 14 | |
+#define RA_IRQ_PERF 15 | |
+#define RA_IRQ_ETHSW 17 | |
+#define RA_IRQ_USB 18 | |
+#define RA_IRQ_UARTL 20 | |
+#define RA_IRQ_UART1 21 | |
+#define RA_IRQ_UART2 22 | |
+#define RA_IRQ_WDOG 24 | |
+#define RA_IRQ_MAX 32 | |
+#else | |
#define RA_IRQ_LOW 0 | |
#define RA_IRQ_HIGH 1 | |
#define RA_IRQ_PCI 2 | |
@@ -387,10 +426,46 @@ | |
#define RA_IRQ_ETHSW 18 | |
#define RA_IRQ_USB 19 | |
#define RA_IRQ_MAX 20 | |
+#endif | |
/* | |
* General Purpose I/O | |
*/ | |
+#if defined(MT7688) | |
+#define RA_PIO_CTRL_0 0x00 | |
+#define RA_PIO_CTRL_1 0x04 | |
+#define RA_PIO_CTRL_2 0x08 | |
+#define RA_PIO_POL_0 0x10 | |
+#define RA_PIO_POL_1 0x14 | |
+#define RA_PIO_POL_2 0x18 | |
+#define RA_PIO_DATA_0 0x20 | |
+#define RA_PIO_DATA_1 0x24 | |
+#define RA_PIO_DATA_2 0x28 | |
+#define RA_PIO_DSET_0 0x30 | |
+#define RA_PIO_DSET_1 0x34 | |
+#define RA_PIO_DSET_2 0x38 | |
+#define RA_PIO_DCLR_0 0x40 | |
+#define RA_PIO_DCLR_1 0x44 | |
+#define RA_PIO_DCLR_2 0x48 | |
+#define RA_PIO_REDGE_0 0x50 | |
+#define RA_PIO_REDGE_1 0x54 | |
+#define RA_PIO_REDGE_2 0x58 | |
+#define RA_PIO_FEDGE_0 0x60 | |
+#define RA_PIO_FEDGE_1 0x64 | |
+#define RA_PIO_FEDGE_2 0x68 | |
+#define RA_PIO_HLVL_0 0x70 | |
+#define RA_PIO_HLVL_1 0x74 | |
+#define RA_PIO_HLVL_2 0x78 | |
+#define RA_PIO_LLVL_0 0x80 | |
+#define RA_PIO_LLVL_1 0x84 | |
+#define RA_PIO_LLVL_2 0x88 | |
+#define RA_PIO_STAT_0 0x90 | |
+#define RA_PIO_STAT_1 0x94 | |
+#define RA_PIO_STAT_2 0x98 | |
+#define RA_PIO_EDGE_0 0xA0 | |
+#define RA_PIO_EDGE_1 0xA4 | |
+#define RA_PIO_EDGE_2 0xA8 | |
+#else | |
#define RA_PIO_00_23_INT 0x00 | |
#define RA_PIO_00_23_EDGE_INT 0x04 | |
#define RA_PIO_00_23_INT_RISE_EN 0x08 | |
@@ -431,12 +506,25 @@ | |
#define RA_PIO_72_95_SET_BIT 0xa4 | |
#define RA_PIO_72_95_CLR_BIT 0xa8 | |
#define RA_PIO_72_95_TGL_BIT 0xac | |
- | |
+#endif | |
/* | |
* UART registers | |
*/ | |
+#if defined(MT7688) | |
+#define RA_UART_RBR 0x00 | |
+#define RA_UART_TBR 0x00 | |
+#define RA_UART_IER 0x04 | |
+#define RA_UART_IIR 0x08 | |
+#define RA_UART_FCR 0x08 | |
+#define RA_UART_LCR 0x0c | |
+#define RA_UART_MCR 0x10 | |
+#define RA_UART_LSR 0x14 | |
+#define RA_UART_MSR 0x18 | |
+#define RA_UART_DLL 0x00 | |
+#define RA_UART_DLM 0x04 | |
+#else | |
#define RA_UART_RBR 0x00 | |
#define RA_UART_TBR 0x04 | |
#define RA_UART_IER 0x08 | |
@@ -447,7 +535,7 @@ | |
#define RA_UART_LSR 0x1C | |
#define RA_UART_MSR 0x20 | |
#define RA_UART_DLL 0x28 | |
- | |
+#endif | |
#define UART_IER_ELSI __BIT(2) | |
/* Receiver Line Status Interrupt Enable */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment