/* * include/ubb/regbase.h - Jz4740 minimum register definitions for UBB * * Written 2011-2012, 2014 by Werner Almesberger * Copyright 2011-2012, 2014 Werner Almesberger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #ifndef UBB_REGBASE_H #define UBB_REGBASE_H #include #define UBB_SOC_BASE 0x10000000 #define UBB_REG_WINDOW 0x4000000 #define REG(n) (*(volatile uint32_t *) (ubb_mem+(n))) #define REG_PADDR(r) ((unsigned long) ((void *) &(r)-ubb_mem+UBB_SOC_BASE)) extern volatile void *ubb_mem; #define _GPIO(n) REG(0x0010000+(n)) #define PDPIN _GPIO(0x300) /* port D pin level */ #define PDDAT _GPIO(0x310) /* port D data set */ #define PDDATS _GPIO(0x314) /* port D data set */ #define PDDATC _GPIO(0x318) /* port D data clear */ #define PDPULL _GPIO(0x330) /* port D pull disable */ #define PDPULLS _GPIO(0x334) /* port D pull disable set */ #define PDPULLC _GPIO(0x338) /* port D pull disable clear */ #define PDFUN _GPIO(0x340) /* port D function */ #define PDFUNS _GPIO(0x344) /* port D function set */ #define PDFUNC _GPIO(0x348) /* port D function clear */ #define PDSEL _GPIO(0x350) /* port D select */ #define PDSELS _GPIO(0x354) /* port D select set */ #define PDSELC _GPIO(0x358) /* port D select clear */ #define PDDIR _GPIO(0x360) /* port D direction */ #define PDDIRS _GPIO(0x364) /* port D direction set */ #define PDDIRC _GPIO(0x368) /* port D direction clear */ #define PDTRG _GPIO(0x370) /* port D trigger */ #define PDTRGS _GPIO(0x374) /* port D trigger set */ #define PDTRGC _GPIO(0x378) /* port D trigger clear */ #endif /* !UBB_REGBASE_H */