Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 1 | /* |
Mike Frysinger | 18a407c | 2009-04-24 17:22:40 -0400 | [diff] [blame] | 2 | * config-pre.h - common defines for Blackfin boards in config.h |
Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 3 | * |
Mike Frysinger | 18a407c | 2009-04-24 17:22:40 -0400 | [diff] [blame] | 4 | * Copyright (c) 2007-2009 Analog Devices Inc. |
Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 5 | * |
| 6 | * Licensed under the GPL-2 or later. |
| 7 | */ |
| 8 | |
| 9 | #ifndef __ASM_BLACKFIN_CONFIG_PRE_H__ |
| 10 | #define __ASM_BLACKFIN_CONFIG_PRE_H__ |
| 11 | |
Mike Frysinger | 244d287 | 2008-08-07 13:17:03 -0400 | [diff] [blame] | 12 | /* Bootmode defines -- your config needs to select this via CONFIG_BFIN_BOOT_MODE. |
Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 13 | * Depending on your cpu, some of these may not be valid, check your HRM. |
| 14 | * The actual values here are meaningless as long as they're unique. |
| 15 | */ |
| 16 | #define BFIN_BOOT_BYPASS 1 /* bypass bootrom */ |
| 17 | #define BFIN_BOOT_PARA 2 /* boot ldr out of parallel flash */ |
| 18 | #define BFIN_BOOT_SPI_MASTER 3 /* boot ldr out of serial flash */ |
| 19 | #define BFIN_BOOT_SPI_SLAVE 4 /* boot ldr as spi slave */ |
| 20 | #define BFIN_BOOT_TWI_MASTER 5 /* boot ldr over twi device */ |
| 21 | #define BFIN_BOOT_TWI_SLAVE 6 /* boot ldr over twi slave */ |
| 22 | #define BFIN_BOOT_UART 7 /* boot ldr over uart */ |
| 23 | #define BFIN_BOOT_IDLE 8 /* do nothing, just idle */ |
| 24 | #define BFIN_BOOT_FIFO 9 /* boot ldr out of FIFO */ |
| 25 | #define BFIN_BOOT_MEM 10 /* boot ldr out of memory (warmboot) */ |
| 26 | #define BFIN_BOOT_16HOST_DMA 11 /* boot ldr from 16-bit host dma */ |
| 27 | #define BFIN_BOOT_8HOST_DMA 12 /* boot ldr from 8-bit host dma */ |
Mike Frysinger | 244d287 | 2008-08-07 13:17:03 -0400 | [diff] [blame] | 28 | #define BFIN_BOOT_NAND 13 /* boot ldr from nand flash */ |
Sonic Zhang | a99f03e | 2012-08-16 11:56:14 +0800 | [diff] [blame] | 29 | #define BFIN_BOOT_RSI_MASTER 14 /* boot ldr from rsi */ |
| 30 | #define BFIN_BOOT_LP_SLAVE 15 /* boot ldr from link port */ |
Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 31 | |
Mike Frysinger | 7e1bbd8 | 2009-01-06 06:16:19 -0500 | [diff] [blame] | 32 | #ifndef __ASSEMBLY__ |
| 33 | static inline const char *get_bfin_boot_mode(int bfin_boot) |
| 34 | { |
| 35 | switch (bfin_boot) { |
| 36 | case BFIN_BOOT_BYPASS: return "bypass"; |
| 37 | case BFIN_BOOT_PARA: return "parallel flash"; |
| 38 | case BFIN_BOOT_SPI_MASTER: return "spi flash"; |
| 39 | case BFIN_BOOT_SPI_SLAVE: return "spi slave"; |
| 40 | case BFIN_BOOT_TWI_MASTER: return "i2c flash"; |
| 41 | case BFIN_BOOT_TWI_SLAVE: return "i2c slave"; |
| 42 | case BFIN_BOOT_UART: return "uart"; |
| 43 | case BFIN_BOOT_IDLE: return "idle"; |
| 44 | case BFIN_BOOT_FIFO: return "fifo"; |
| 45 | case BFIN_BOOT_MEM: return "memory"; |
| 46 | case BFIN_BOOT_16HOST_DMA: return "16bit dma"; |
| 47 | case BFIN_BOOT_8HOST_DMA: return "8bit dma"; |
| 48 | case BFIN_BOOT_NAND: return "nand flash"; |
Sonic Zhang | a99f03e | 2012-08-16 11:56:14 +0800 | [diff] [blame] | 49 | case BFIN_BOOT_RSI_MASTER: return "rsi master"; |
| 50 | case BFIN_BOOT_LP_SLAVE: return "link port slave"; |
Mike Frysinger | 7e1bbd8 | 2009-01-06 06:16:19 -0500 | [diff] [blame] | 51 | default: return "INVALID"; |
| 52 | } |
| 53 | } |
| 54 | #endif |
| 55 | |
Mike Frysinger | a48e0ed | 2009-04-24 23:39:41 -0400 | [diff] [blame] | 56 | /* Most bootroms allow for EVT1 redirection */ |
Mike Frysinger | 641b82b | 2009-05-26 02:51:57 -0400 | [diff] [blame] | 57 | #if ((defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__)) \ |
Mike Frysinger | a48e0ed | 2009-04-24 23:39:41 -0400 | [diff] [blame] | 58 | && __SILICON_REVISION__ < 3) || defined(__ADSPBF561__) |
| 59 | # undef CONFIG_BFIN_BOOTROM_USES_EVT1 |
| 60 | #else |
| 61 | # define CONFIG_BFIN_BOOTROM_USES_EVT1 |
| 62 | #endif |
| 63 | |
Mike Frysinger | e138700 | 2009-01-13 11:00:29 -0500 | [diff] [blame] | 64 | /* Define the default SPI CS used when booting out of SPI */ |
| 65 | #if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \ |
| 66 | defined(__ADSPBF538__) || defined(__ADSPBF539__) || defined(__ADSPBF561__) || \ |
| 67 | defined(__ADSPBF51x__) |
| 68 | # define BFIN_BOOT_SPI_SSEL 2 |
| 69 | #else |
| 70 | # define BFIN_BOOT_SPI_SSEL 1 |
| 71 | #endif |
| 72 | |
Mike Frysinger | c43f06d | 2010-09-20 17:54:09 -0400 | [diff] [blame] | 73 | /* Define to get a GPIO CS with the Blackfin SPI controller */ |
| 74 | #define MAX_CTRL_CS 8 |
| 75 | |
Mike Frysinger | 1cc853b | 2009-11-03 15:53:12 -0500 | [diff] [blame] | 76 | /* There is no Blackfin/NetBSD port */ |
| 77 | #undef CONFIG_BOOTM_NETBSD |
| 78 | |
Mike Frysinger | e59bac5 | 2009-11-30 13:51:24 -0500 | [diff] [blame] | 79 | /* We rarely use interrupts, so favor throughput over latency */ |
| 80 | #define CONFIG_BFIN_INS_LOWOVERHEAD |
| 81 | |
Mike Frysinger | 66c4cf4 | 2008-02-04 19:26:55 -0500 | [diff] [blame] | 82 | #endif |