wdenk | 9c53f40 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 1 | /* |
Andy Fleming | f08233c | 2007-08-14 01:34:21 -0500 | [diff] [blame] | 2 | * Copyright 2004, 2007 Freescale Semiconductor. |
wdenk | 9c53f40 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 3 | * Copyright(c) 2003 Motorola Inc. |
wdenk | 9c53f40 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __MPC85xx_H__ |
| 7 | #define __MPC85xx_H__ |
| 8 | |
Tom Rini | dec7ea0 | 2024-05-20 13:35:03 -0600 | [diff] [blame] | 9 | #include <config.h> |
wdenk | 9c53f40 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 10 | #if defined(CONFIG_E500) |
| 11 | #include <e500.h> |
| 12 | #endif |
| 13 | |
wdenk | 13eb221 | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 14 | /* |
| 15 | * SCCR - System Clock Control Register, 9-8 |
wdenk | 9c53f40 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 16 | */ |
wdenk | 13eb221 | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 17 | #define SCCR_CLPD 0x00000004 /* CPM Low Power Disable */ |
| 18 | #define SCCR_DFBRG_MSK 0x00000003 /* Division by BRGCLK Mask */ |
wdenk | 9c53f40 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 19 | #define SCCR_DFBRG_SHIFT 0 |
| 20 | |
wdenk | 13eb221 | 2004-07-09 23:27:13 +0000 | [diff] [blame] | 21 | #define SCCR_DFBRG00 0x00000000 /* BRGCLK division by 4 */ |
| 22 | #define SCCR_DFBRG01 0x00000001 /* BRGCLK div by 16 (normal) */ |
| 23 | #define SCCR_DFBRG10 0x00000002 /* BRGCLK division by 64 */ |
| 24 | #define SCCR_DFBRG11 0x00000003 /* BRGCLK division by 256 */ |
wdenk | 9c53f40 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 25 | |
Timur Tabi | d8f341c | 2011-08-04 18:03:41 -0500 | [diff] [blame] | 26 | /* |
| 27 | * Define default values for some CCSR macros to make header files cleaner* |
| 28 | * |
| 29 | * To completely disable CCSR relocation in a board header file, define |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 30 | * CONFIG_SPL_SYS_CCSR_DO_NOT_RELOCATE. This will force CFG_SYS_CCSRBAR_PHYS |
| 31 | * to a value that is the same as CFG_SYS_CCSRBAR. |
Timur Tabi | d8f341c | 2011-08-04 18:03:41 -0500 | [diff] [blame] | 32 | */ |
| 33 | |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 34 | #ifdef CFG_SYS_CCSRBAR_PHYS |
| 35 | #error "Do not define CFG_SYS_CCSRBAR_PHYS directly. Use \ |
| 36 | CFG_SYS_CCSRBAR_PHYS_LOW and/or CFG_SYS_CCSRBAR_PHYS_HIGH instead." |
Timur Tabi | d8f341c | 2011-08-04 18:03:41 -0500 | [diff] [blame] | 37 | #endif |
| 38 | |
Tom Rini | 17845c5 | 2022-05-21 11:26:27 -0400 | [diff] [blame] | 39 | #if CONFIG_IS_ENABLED(SYS_CCSR_DO_NOT_RELOCATE) |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 40 | #undef CFG_SYS_CCSRBAR_PHYS_HIGH |
| 41 | #undef CFG_SYS_CCSRBAR_PHYS_LOW |
| 42 | #define CFG_SYS_CCSRBAR_PHYS_HIGH 0 |
Timur Tabi | d8f341c | 2011-08-04 18:03:41 -0500 | [diff] [blame] | 43 | #endif |
| 44 | |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 45 | #ifndef CFG_SYS_CCSRBAR |
| 46 | #define CFG_SYS_CCSRBAR CONFIG_SYS_CCSRBAR_DEFAULT |
Timur Tabi | d8f341c | 2011-08-04 18:03:41 -0500 | [diff] [blame] | 47 | #endif |
| 48 | |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 49 | #ifndef CFG_SYS_CCSRBAR_PHYS_HIGH |
Timur Tabi | d8f341c | 2011-08-04 18:03:41 -0500 | [diff] [blame] | 50 | #ifdef CONFIG_PHYS_64BIT |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 51 | #define CFG_SYS_CCSRBAR_PHYS_HIGH 0xf |
Timur Tabi | d8f341c | 2011-08-04 18:03:41 -0500 | [diff] [blame] | 52 | #else |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 53 | #define CFG_SYS_CCSRBAR_PHYS_HIGH 0 |
Timur Tabi | d8f341c | 2011-08-04 18:03:41 -0500 | [diff] [blame] | 54 | #endif |
| 55 | #endif |
| 56 | |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 57 | #ifndef CFG_SYS_CCSRBAR_PHYS_LOW |
| 58 | #define CFG_SYS_CCSRBAR_PHYS_LOW CONFIG_SYS_CCSRBAR_DEFAULT |
Timur Tabi | d8f341c | 2011-08-04 18:03:41 -0500 | [diff] [blame] | 59 | #endif |
| 60 | |
Tom Rini | 6a5dccc | 2022-11-16 13:10:41 -0500 | [diff] [blame] | 61 | #define CFG_SYS_CCSRBAR_PHYS ((CFG_SYS_CCSRBAR_PHYS_HIGH * 1ull) << 32 | \ |
| 62 | CFG_SYS_CCSRBAR_PHYS_LOW) |
Timur Tabi | d8f341c | 2011-08-04 18:03:41 -0500 | [diff] [blame] | 63 | |
wdenk | 9c53f40 | 2003-10-15 23:53:47 +0000 | [diff] [blame] | 64 | #endif /* __MPC85xx_H__ */ |