Root/
| 1 | /* |
| 2 | * include/ubb/regbase.h - Jz4740 minimum register definitions for UBB |
| 3 | * |
| 4 | * Written 2011-2012, 2014 by Werner Almesberger |
| 5 | * Copyright 2011-2012, 2014 Werner Almesberger |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | */ |
| 12 | |
| 13 | #ifndef UBB_REGBASE_H |
| 14 | #define UBB_REGBASE_H |
| 15 | |
| 16 | #include <stdint.h> |
| 17 | |
| 18 | |
| 19 | #define UBB_SOC_BASE 0x10000000 |
| 20 | #define UBB_REG_WINDOW 0x4000000 |
| 21 | |
| 22 | #define REG(n) (*(volatile uint32_t *) (ubb_mem+(n))) |
| 23 | |
| 24 | #define REG_PADDR(r) ((unsigned long) ((void *) &(r)-ubb_mem+UBB_SOC_BASE)) |
| 25 | |
| 26 | |
| 27 | extern volatile void *ubb_mem; |
| 28 | |
| 29 | |
| 30 | #define _GPIO(n) REG(0x0010000+(n)) |
| 31 | |
| 32 | #define PDPIN _GPIO(0x300) /* port D pin level */ |
| 33 | #define PDDAT _GPIO(0x310) /* port D data set */ |
| 34 | #define PDDATS _GPIO(0x314) /* port D data set */ |
| 35 | #define PDDATC _GPIO(0x318) /* port D data clear */ |
| 36 | #define PDPULL _GPIO(0x330) /* port D pull disable */ |
| 37 | #define PDPULLS _GPIO(0x334) /* port D pull disable set */ |
| 38 | #define PDPULLC _GPIO(0x338) /* port D pull disable clear */ |
| 39 | #define PDFUN _GPIO(0x340) /* port D function */ |
| 40 | #define PDFUNS _GPIO(0x344) /* port D function set */ |
| 41 | #define PDFUNC _GPIO(0x348) /* port D function clear */ |
| 42 | #define PDSEL _GPIO(0x350) /* port D select */ |
| 43 | #define PDSELS _GPIO(0x354) /* port D select set */ |
| 44 | #define PDSELC _GPIO(0x358) /* port D select clear */ |
| 45 | #define PDDIR _GPIO(0x360) /* port D direction */ |
| 46 | #define PDDIRS _GPIO(0x364) /* port D direction set */ |
| 47 | #define PDDIRC _GPIO(0x368) /* port D direction clear */ |
| 48 | #define PDTRG _GPIO(0x370) /* port D trigger */ |
| 49 | #define PDTRGS _GPIO(0x374) /* port D trigger set */ |
| 50 | #define PDTRGC _GPIO(0x378) /* port D trigger clear */ |
| 51 | |
| 52 | #endif /* !UBB_REGBASE_H */ |
| 53 |
Branches:
master
