Wolfgang Denk | 9d40799 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 1 | /* -------------------------------------------------------------------- */ |
| 2 | /* RPX Boards from Embedded Planet */ |
| 3 | /* -------------------------------------------------------------------- */ |
| 4 | #include <common.h> |
Wolfgang Denk | 966083e | 2006-07-21 15:24:56 +0200 | [diff] [blame] | 5 | #ifdef CONFIG_8xx |
Wolfgang Denk | 9d40799 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 6 | #include <mpc8xx.h> |
Wolfgang Denk | 966083e | 2006-07-21 15:24:56 +0200 | [diff] [blame] | 7 | #endif |
Wolfgang Denk | 9d40799 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 8 | #include <pcmcia.h> |
| 9 | |
| 10 | #undef CONFIG_PCMCIA |
| 11 | |
Jon Loeliger | cb51c0b | 2007-07-09 17:39:42 -0500 | [diff] [blame] | 12 | #if defined(CONFIG_CMD_PCMCIA) |
Wolfgang Denk | 9d40799 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 13 | #define CONFIG_PCMCIA |
| 14 | #endif |
| 15 | |
Jon Loeliger | cb51c0b | 2007-07-09 17:39:42 -0500 | [diff] [blame] | 16 | #if defined(CONFIG_CMD_IDE) && defined(CONFIG_IDE_8xx_PCCARD) |
Wolfgang Denk | 9d40799 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 17 | #define CONFIG_PCMCIA |
| 18 | #endif |
| 19 | |
| 20 | #if defined(CONFIG_PCMCIA) \ |
Masahiro Yamada | 4fb3925 | 2014-04-04 15:25:06 +0900 | [diff] [blame] | 21 | && defined(CONFIG_RPXLITE) |
Wolfgang Denk | 9d40799 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 22 | |
| 23 | #define PCMCIA_BOARD_MSG "RPX CLASSIC or RPX LITE" |
| 24 | |
| 25 | int pcmcia_voltage_set(int slot, int vcc, int vpp) |
| 26 | { |
| 27 | u_long reg = 0; |
| 28 | |
| 29 | switch(vcc) { |
| 30 | case 0: break; |
| 31 | case 33: reg |= BCSR1_PCVCTL4; break; |
| 32 | case 50: reg |= BCSR1_PCVCTL5; break; |
| 33 | default: return 1; |
| 34 | } |
| 35 | |
| 36 | switch(vpp) { |
| 37 | case 0: break; |
| 38 | case 33: |
| 39 | case 50: |
| 40 | if(vcc == vpp) |
| 41 | reg |= BCSR1_PCVCTL6; |
| 42 | else |
| 43 | return 1; |
| 44 | break; |
| 45 | case 120: |
| 46 | reg |= BCSR1_PCVCTL7; |
| 47 | default: return 1; |
| 48 | } |
| 49 | |
| 50 | /* first, turn off all power */ |
| 51 | *((uint *)RPX_CSR_ADDR) &= ~(BCSR1_PCVCTL4 | BCSR1_PCVCTL5 |
| 52 | | BCSR1_PCVCTL6 | BCSR1_PCVCTL7); |
| 53 | |
| 54 | /* enable new powersettings */ |
| 55 | *((uint *)RPX_CSR_ADDR) |= reg; |
| 56 | |
| 57 | return 0; |
| 58 | } |
| 59 | |
| 60 | int pcmcia_hardware_enable (int slot) |
| 61 | { |
| 62 | return 0; /* No hardware to enable */ |
| 63 | } |
| 64 | |
Jon Loeliger | cb51c0b | 2007-07-09 17:39:42 -0500 | [diff] [blame] | 65 | #if defined(CONFIG_CMD_PCMCIA) |
Wolfgang Denk | 9d40799 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 66 | static int pcmcia_hardware_disable(int slot) |
| 67 | { |
| 68 | return 0; /* No hardware to disable */ |
| 69 | } |
Jon Loeliger | cb51c0b | 2007-07-09 17:39:42 -0500 | [diff] [blame] | 70 | #endif |
Wolfgang Denk | 9d40799 | 2006-07-10 23:07:28 +0200 | [diff] [blame] | 71 | |
| 72 | |
Masahiro Yamada | 4fb3925 | 2014-04-04 15:25:06 +0900 | [diff] [blame] | 73 | #endif /* CONFIG_PCMCIA && CONFIG_RPXLITE */ |