Ticket #368: ide_pc386_mbx8xx.diff
File ide_pc386_mbx8xx.diff, 68.5 KB (added by thomas.doerfler, on 12/03/06 at 13:31:12) |
---|
-
c/src/lib/libbsp/i386/pc386/ChangeLog
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/i386/pc386/ChangeLog rtems-4.6.0pre1-ide/c/src/lib/libbsp/i386/pc386/ChangeLog
old new 1 2003-02-27 Thomas Doerfler <Thomas.Doerfler@imd-systems.de> 2 3 * ide/*: added BSP support for libchip standard ide driver 4 1 5 2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 6 3 7 * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). -
c/src/lib/libbsp/i386/pc386/Makefile.am
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/i386/pc386/Makefile.am rtems-4.6.0pre1-ide/c/src/lib/libbsp/i386/pc386/Makefile.am
old new 7 7 # wrapup is the one that actually builds and installs the library 8 8 # from the individual .rel files built in other directories 9 9 SUBDIRS = . include tools start startup clock console timer ne2000 wd8003 \ 10 3c509 wrapup10 3c509 ide wrapup 11 11 12 12 include $(top_srcdir)/../../bsp.am 13 13 -
c/src/lib/libbsp/i386/pc386/configure.ac
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/i386/pc386/configure.ac rtems-4.6.0pre1-ide/c/src/lib/libbsp/i386/pc386/configure.ac
old new 38 38 3c509/Makefile 39 39 ne2000/Makefile 40 40 wd8003/Makefile 41 ide/Makefile 41 42 wrapup/Makefile]) 42 43 AC_OUTPUT -
c/src/lib/libbsp/i386/pc386/console/console.c
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/i386/pc386/console/console.c rtems-4.6.0pre1-ide/c/src/lib/libbsp/i386/pc386/console/console.c
old new 61 61 * to same serial device it does not work that great 62 62 */ 63 63 64 #if 0 /* IMD hack */ 64 65 int BSPConsolePort = BSP_CONSOLE_PORT_CONSOLE; 65 66 int BSPPrintkPort = BSP_CONSOLE_PORT_CONSOLE; 67 #else 68 int BSPConsolePort = BSP_UART_COM1; 69 int BSPPrintkPort = BSP_UART_COM1; 70 #endif 66 71 67 72 /* int BSPConsolePort = BSP_UART_COM2; */ 68 73 int BSPBaseBaud = 115200; -
c/src/lib/libbsp/i386/pc386/ide/Makefile.am
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/i386/pc386/ide/Makefile.am rtems-4.6.0pre1-ide/c/src/lib/libbsp/i386/pc386/ide/Makefile.am
old new 1 ## 2 ## Makefile.am,v 1.5 2002/08/11 06:59:03 ralf Exp 3 ## 4 5 6 PGM = 7 8 C_FILES = idecfg.c ide.c 9 C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT)) 10 11 OBJS = $(C_O_FILES) 12 13 include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg 14 include $(top_srcdir)/../../../../../../automake/compile.am 15 include $(top_srcdir)/../../../../../../automake/lib.am 16 17 # 18 # (OPTIONAL) Add local stuff here using += 19 # 20 21 $(PGM): $(OBJS) 22 $(make-rel) 23 24 # the .rel file built here will be put into libbsp.a by ../wrapup/Makefile 25 26 all-local: $(ARCH) $(OBJS) $(PGM) 27 28 .PRECIOUS: $(PGM) 29 30 EXTRA_DIST = idecfg.c 31 32 include $(top_srcdir)/../../../../../../automake/local.am -
c/src/lib/libbsp/i386/pc386/ide/ide.c
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/i386/pc386/ide/ide.c rtems-4.6.0pre1-ide/c/src/lib/libbsp/i386/pc386/ide/ide.c
old new 1 /*===============================================================*\ 2 | Project: RTEMS PC386 IDE harddisc driver | 3 +-----------------------------------------------------------------+ 4 | File: ide.c | 5 +-----------------------------------------------------------------+ 6 | Copyright (c) 2003 IMD | 7 | Ingenieurbuero fuer Microcomputertechnik Th. Doerfler | 8 | <Thomas.Doerfler@imd-systems.de> | 9 | all rights reserved | 10 +-----------------------------------------------------------------+ 11 | this file contains the BSP layer for IDE access below the | 12 | libchip IDE harddisc driver | 13 | based on a board specific driver from | 14 | Eugeny S. Mints, Oktet | 15 | | 16 | The license and distribution terms for this file may be | 17 | found in the file LICENSE in this distribution or at | 18 | http://www.OARcorp.com/rtems/license.html. | 19 | | 20 +-----------------------------------------------------------------+ 21 | date history ID | 22 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 23 | 01.14.03 creation doe | 24 \*===============================================================*/ 25 26 #include <rtems.h> 27 #include <bsp.h> 28 #include <libchip/ide_ctrl.h> 29 #include <libchip/ide_ctrl_cfg.h> 30 #include <libchip/ide_ctrl_io.h> 31 32 /* #define DEBUG_OUT */ 33 /* 34 * support functions for IDE harddisk IF 35 */ 36 /*=========================================================================*\ 37 | Function: | 38 \*-------------------------------------------------------------------------*/ 39 boolean pc386_ide_probe 40 ( 41 /*-------------------------------------------------------------------------*\ 42 | Purpose: | 43 | This function should probe, whether a IDE disk is available | 44 +---------------------------------------------------------------------------+ 45 | Input Parameters: | 46 \*-------------------------------------------------------------------------*/ 47 int minor 48 ) 49 /*-------------------------------------------------------------------------*\ 50 | Return Value: | 51 | TRUE, when flash disk available | 52 \*=========================================================================*/ 53 { 54 boolean ide_card_plugged = TRUE; /* assume: we have a disk here */ 55 56 return ide_card_plugged; 57 } 58 59 /*=========================================================================*\ 60 | Function: | 61 \*-------------------------------------------------------------------------*/ 62 void pc386_ide_initialize 63 ( 64 /*-------------------------------------------------------------------------*\ 65 | Purpose: | 66 | initialize IDE access | 67 +---------------------------------------------------------------------------+ 68 | Input Parameters: | 69 \*-------------------------------------------------------------------------*/ 70 int minor /* controller minor number */ 71 ) 72 /*-------------------------------------------------------------------------*\ 73 | Return Value: | 74 | <none> | 75 \*=========================================================================*/ 76 { 77 /* 78 * FIXME: enable interrupts, if needed 79 */ 80 } 81 82 /*=========================================================================*\ 83 | Function: | 84 \*-------------------------------------------------------------------------*/ 85 void pc386_ide_read_reg 86 ( 87 /*-------------------------------------------------------------------------*\ 88 | Purpose: | 89 | read a IDE controller register | 90 +---------------------------------------------------------------------------+ 91 | Input Parameters: | 92 \*-------------------------------------------------------------------------*/ 93 int minor, /* controller minor number */ 94 int reg, /* register index to access */ 95 unsigned16 *value /* ptr to return value location */ 96 ) 97 /*-------------------------------------------------------------------------*\ 98 | Return Value: | 99 | <none> | 100 \*=========================================================================*/ 101 { 102 unsigned32 port = IDE_Controller_Table[minor].port1; 103 unsigned8 bval1,bval2; 104 105 if (reg == IDE_REGISTER_DATA_WORD) { 106 inport_byte(port+reg, bval1); 107 inport_byte(port+reg+1, bval2); 108 *value = bval1 + (bval2 << 8); 109 } 110 else { 111 inport_byte(port+reg, bval1); 112 *value = bval1; 113 } 114 #ifdef DEBUG_OUT 115 printk("pc386_ide_read_reg (0x%x)=0x%x\r\n",reg,*value & 0xff); 116 #endif 117 } 118 119 /*=========================================================================*\ 120 | Function: | 121 \*-------------------------------------------------------------------------*/ 122 void pc386_ide_write_reg 123 ( 124 /*-------------------------------------------------------------------------*\ 125 | Purpose: | 126 | write a IDE controller register | 127 +---------------------------------------------------------------------------+ 128 | Input Parameters: | 129 \*-------------------------------------------------------------------------*/ 130 int minor, /* controller minor number */ 131 int reg, /* register index to access */ 132 unsigned16 value /* value to write */ 133 ) 134 /*-------------------------------------------------------------------------*\ 135 | Return Value: | 136 | <none> | 137 \*=========================================================================*/ 138 { 139 unsigned32 port = IDE_Controller_Table[minor].port1; 140 141 #ifdef DEBUG_OUT 142 printk("pc386_ide_write_reg(0x%x,0x%x)\r\n",reg,value & 0xff); 143 #endif 144 if (reg == IDE_REGISTER_DATA_WORD) { 145 outport_word(port+reg,value); 146 } 147 else { 148 outport_byte(port+reg,value); 149 } 150 } 151 152 /*=========================================================================*\ 153 | Function: | 154 \*-------------------------------------------------------------------------*/ 155 void pc386_ide_read_block 156 ( 157 /*-------------------------------------------------------------------------*\ 158 | Purpose: | 159 | read a IDE controller data block | 160 +---------------------------------------------------------------------------+ 161 | Input Parameters: | 162 \*-------------------------------------------------------------------------*/ 163 int minor, 164 unsigned16 block_size, 165 blkdev_sg_buffer *bufs, 166 rtems_unsigned32 *cbuf, 167 rtems_unsigned32 *pos 168 ) 169 /*-------------------------------------------------------------------------*\ 170 | Return Value: | 171 | <none> | 172 \*=========================================================================*/ 173 { 174 unsigned32 port = IDE_Controller_Table[minor].port1; 175 unsigned16 cnt = 0; 176 unsigned32 llength = bufs[(*cbuf)].length; 177 unsigned8 status_val; 178 unsigned16 *lbuf = (unsigned16 *) 179 ((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos)); 180 181 inport_byte(port+IDE_REGISTER_STATUS,status_val); 182 while ((status_val & IDE_REGISTER_STATUS_DRQ) && 183 (cnt < block_size)) { 184 inport_word(port+IDE_REGISTER_DATA,*lbuf); 185 186 #ifdef DEBUG_OUT 187 printk("0x%x ",*lbuf); 188 #endif 189 lbuf++; 190 cnt += sizeof(*lbuf); 191 (*pos) += sizeof(*lbuf); 192 if ((*pos) == llength) { 193 (*pos) = 0; 194 (*cbuf)++; 195 lbuf = bufs[(*cbuf)].buffer; 196 llength = bufs[(*cbuf)].length; 197 } 198 inport_byte(port+IDE_REGISTER_STATUS,status_val); 199 } 200 #ifdef DEBUG_OUT 201 printk("pc386_ide_read_block()\r\n"); 202 #endif 203 } 204 205 /*=========================================================================*\ 206 | Function: | 207 \*-------------------------------------------------------------------------*/ 208 void pc386_ide_write_block 209 ( 210 /*-------------------------------------------------------------------------*\ 211 | Purpose: | 212 | write a IDE controller data block | 213 +---------------------------------------------------------------------------+ 214 | Input Parameters: | 215 \*-------------------------------------------------------------------------*/ 216 int minor, 217 unsigned16 block_size, 218 blkdev_sg_buffer *bufs, 219 rtems_unsigned32 *cbuf, 220 rtems_unsigned32 *pos 221 ) 222 /*-------------------------------------------------------------------------*\ 223 | Return Value: | 224 | <none> | 225 \*=========================================================================*/ 226 { 227 unsigned32 port = IDE_Controller_Table[minor].port1; 228 unsigned16 cnt = 0; 229 unsigned32 llength = bufs[(*cbuf)].length; 230 unsigned8 status_val; 231 unsigned16 *lbuf = (unsigned16 *) 232 ((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos)); 233 234 #ifdef DEBUG_OUT 235 printk("pc386_ide_write_block()\r\n"); 236 #endif 237 inport_byte(port+IDE_REGISTER_STATUS,status_val); 238 while ((status_val & IDE_REGISTER_STATUS_DRQ) && 239 (cnt < block_size)) { 240 #ifdef DEBUG_OUT 241 printk("0x%x ",*lbuf); 242 #endif 243 outport_word(port+IDE_REGISTER_DATA,*lbuf); 244 lbuf++; 245 cnt += sizeof(*lbuf); 246 (*pos) += sizeof(*lbuf); 247 if ((*pos) == llength) { 248 (*pos) = 0; 249 (*cbuf)++; 250 lbuf = bufs[(*cbuf)].buffer; 251 llength = bufs[(*cbuf)].length; 252 } 253 inport_byte(port+IDE_REGISTER_STATUS,status_val); 254 } 255 } 256 257 /*=========================================================================*\ 258 | Function: | 259 \*-------------------------------------------------------------------------*/ 260 int pc386_ide_control 261 ( 262 /*-------------------------------------------------------------------------*\ 263 | Purpose: | 264 | control interface for controller | 265 +---------------------------------------------------------------------------+ 266 | Input Parameters: | 267 \*-------------------------------------------------------------------------*/ 268 int minor, /* controller minor number */ 269 unsigned32 cmd, /* command to send */ 270 void * arg /* optional argument */ 271 ) 272 /*-------------------------------------------------------------------------*\ 273 | Return Value: | 274 | <none> | 275 \*=========================================================================*/ 276 { 277 return 0; 278 } 279 280 /*=========================================================================*\ 281 | Function: | 282 \*-------------------------------------------------------------------------*/ 283 rtems_status_code pc386_ide_config_io_speed 284 ( 285 /*-------------------------------------------------------------------------*\ 286 | Purpose: | 287 | set up transfer speed, if possible | 288 +---------------------------------------------------------------------------+ 289 | Input Parameters: | 290 \*-------------------------------------------------------------------------*/ 291 int minor, /* controller minor number */ 292 unsigned8 modes_avail /* optional argument */ 293 ) 294 /*-------------------------------------------------------------------------*\ 295 | Return Value: | 296 | rtems_status_code | 297 \*=========================================================================*/ 298 { 299 return RTEMS_SUCCESSFUL; 300 } 301 302 /* 303 * The following table configures the functions used for IDE drivers 304 * in this BSP. 305 */ 306 307 ide_ctrl_fns_t pc386_ide_ctrl_fns = { 308 pc386_ide_probe, 309 pc386_ide_initialize, 310 pc386_ide_control, 311 pc386_ide_read_reg, 312 pc386_ide_write_reg, 313 pc386_ide_read_block, 314 pc386_ide_write_block, 315 pc386_ide_config_io_speed 316 }; 317 -
c/src/lib/libbsp/i386/pc386/ide/idecfg.c
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/i386/pc386/ide/idecfg.c rtems-4.6.0pre1-ide/c/src/lib/libbsp/i386/pc386/ide/idecfg.c
old new 1 /*===============================================================*\ 2 | Project: RTEMS PC386 IDE harddisc driver tables | 3 +-----------------------------------------------------------------+ 4 | File: idecfg.c | 5 +-----------------------------------------------------------------+ 6 | Copyright (c) 2003 IMD | 7 | Ingenieurbuero fuer Microcomputertechnik Th. Doerfler | 8 | <Thomas.Doerfler@imd-systems.de> | 9 | all rights reserved | 10 +-----------------------------------------------------------------+ 11 | this file contains the table of functions for the BSP layer | 12 | for IDE access below the libchip IDE harddisc driver | 13 | | 14 +-----------------------------------------------------------------+ 15 | date history ID | 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 17 | 01.14.03 creation doe | 18 \*===============================================================*/ 19 20 #include <rtems.h> 21 #include <bsp.h> 22 #include <libchip/ide_ctrl.h> 23 #include <libchip/ide_ctrl_cfg.h> 24 #include <libchip/ide_ctrl_io.h> 25 26 27 /* 28 * The following table configures the functions used for IDE drivers 29 * in this BSP. 30 */ 31 32 /* 33 * The following table configures the IDE drivers used in this BSP. 34 */ 35 extern ide_ctrl_fns_t pc386_ide_ctrl_fns; 36 37 /* IDE controllers Table */ 38 ide_controller_bsp_table_t IDE_Controller_Table[] = { 39 {"/dev/ide", 40 IDE_STD, /* standard IDE controller */ 41 &pc386_ide_ctrl_fns, 42 NULL, /* probe for IDE standard registers */ 43 FALSE, /* not (yet) initialized */ 44 0x1f0, /* base I/O address for first IDE controller */ 45 FALSE,0, /* not (yet) interrupt driven */ 46 NULL 47 } 48 }; 49 50 /* Number of rows in IDE_Controller_Table */ 51 unsigned long IDE_Controller_Count = 52 sizeof(IDE_Controller_Table)/sizeof(IDE_Controller_Table[0]); 53 54 -
c/src/lib/libbsp/i386/pc386/include/bsp.h
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/i386/pc386/include/bsp.h rtems-4.6.0pre1-ide/c/src/lib/libbsp/i386/pc386/include/bsp.h
old new 212 212 #define BSP_CONSOLE_PORT_COM1 (BSP_UART_COM1) 213 213 #define BSP_CONSOLE_PORT_COM2 (BSP_UART_COM2) 214 214 215 /* 216 * indicate, that BSP has IDE driver 217 */ 218 #define RTEMS_BSP_HAS_IDE_DRIVER 219 215 220 /* GDB stub stuff */ 216 221 void i386_stub_glue_init(int uart); 217 222 void i386_stub_glue_init_breakin(void); -
c/src/lib/libbsp/i386/pc386/startup/ldsegs.S
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S rtems-4.6.0pre1-ide/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S
old new 216 216 /*---------------------------------------------------------------------------+ 217 217 | IDT itself 218 218 +---------------------------------------------------------------------------*/ 219 BEGIN_DATA 219 220 .p2align 4 220 221 221 222 PUBLIC(Interrupt_descriptor_table) … … 223 224 .rept 256 224 225 .word 0,0,0,0 225 226 .endr 226 227 END_DATA 228 227 229 /*---------------------------------------------------------------------------+ 228 230 | Descriptor of IDT 229 231 +--------------------------------------------------------------------------*/ 232 BEGIN_CODE 233 .p2align 4 230 234 SYM(idtdesc): 231 235 .word (256*8 - 1) 232 236 .long SYM (Interrupt_descriptor_table) -
c/src/lib/libbsp/i386/pc386/wrapup/Makefile.am
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.am rtems-4.6.0pre1-ide/c/src/lib/libbsp/i386/pc386/wrapup/Makefile.am
old new 8 8 NETWORK = ne2000 wd8003 3c509 9 9 endif 10 10 11 BSP_FILES = startup clock console timer $(NETWORK) 11 BSP_FILES = startup clock console timer $(NETWORK) ide 12 12 13 13 # bummer; have to use $foreach since % pattern subst rules only replace 1x 14 14 OBJS = $(foreach piece, $(BSP_FILES), $(wildcard ../$(piece)/$(ARCH)/*.$(OBJEXT))) \ -
c/src/lib/libbsp/powerpc/mbx8xx/ChangeLog
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/powerpc/mbx8xx/ChangeLog rtems-4.6.0pre1-ide/c/src/lib/libbsp/powerpc/mbx8xx/ChangeLog
old new 1 2003-02-27 Thomas Doerfler <Thomas.Doerfler@imd-systems.de> 2 3 * ide/*: added BSP support for libchip standard ide driver 4 1 5 2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 6 3 7 * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). -
c/src/lib/libbsp/powerpc/mbx8xx/Makefile.am
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/powerpc/mbx8xx/Makefile.am rtems-4.6.0pre1-ide/c/src/lib/libbsp/powerpc/mbx8xx/Makefile.am
old new 6 6 7 7 # wrapup is the one that actually builds and installs the library 8 8 # from the individual .rel files built in other directories 9 SUBDIRS = include clock console irq network startup vectors \10 @exceptions@ wrapup 9 SUBDIRS = include clock console irq network ide startup vectors \ 10 @exceptions@ wrapup 11 11 12 12 include $(top_srcdir)/../../bsp.am 13 13 -
c/src/lib/libbsp/powerpc/mbx8xx/configure.ac
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/powerpc/mbx8xx/configure.ac rtems-4.6.0pre1-ide/c/src/lib/libbsp/powerpc/mbx8xx/configure.ac
old new 123 123 console/Makefile 124 124 include/Makefile 125 125 irq/Makefile 126 ide/Makefile 126 127 network/Makefile 127 128 startup/Makefile 128 129 vectors/Makefile -
c/src/lib/libbsp/powerpc/mbx8xx/ide/Makefile.am
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/powerpc/mbx8xx/ide/Makefile.am rtems-4.6.0pre1-ide/c/src/lib/libbsp/powerpc/mbx8xx/ide/Makefile.am
old new 1 ## 2 ## Makefile.am,v 1.5 2002/08/11 06:59:03 ralf Exp 3 ## 4 5 6 PGM = # $(ARCH)/console.rel 7 8 C_FILES = idecfg.c pcmcia_ide.c 9 C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT)) 10 11 OBJS = $(C_O_FILES) 12 13 include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg 14 include $(top_srcdir)/../../../../../../automake/compile.am 15 include $(top_srcdir)/../../../../../../automake/lib.am 16 17 # 18 # (OPTIONAL) Add local stuff here using += 19 # 20 21 $(PGM): $(OBJS) 22 $(make-rel) 23 24 # the .rel file built here will be put into libbsp.a by ../wrapup/Makefile 25 26 all-local: $(ARCH) $(OBJS) $(PGM) 27 28 .PRECIOUS: $(PGM) 29 30 EXTRA_DIST = idecfg.c 31 32 include $(top_srcdir)/../../../../../../automake/local.am -
c/src/lib/libbsp/powerpc/mbx8xx/ide/idecfg.c
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/powerpc/mbx8xx/ide/idecfg.c rtems-4.6.0pre1-ide/c/src/lib/libbsp/powerpc/mbx8xx/ide/idecfg.c
old new 1 /*===============================================================*\ 2 | Project: RTEMS MBX8xx IDE harddisc driver tables | 3 +-----------------------------------------------------------------+ 4 | File: idecfg.c | 5 +-----------------------------------------------------------------+ 6 | Copyright (c) 2003 IMD | 7 | Ingenieurbuero fuer Microcomputertechnik Th. Doerfler | 8 | <Thomas.Doerfler@imd-systems.de> | 9 | all rights reserved | 10 +-----------------------------------------------------------------+ 11 | this file contains the table of functions for the BSP layer | 12 | for IDE access below the libchip IDE harddisc driver | 13 | | 14 +-----------------------------------------------------------------+ 15 | date history ID | 16 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 17 | 01.14.03 creation doe | 18 \*===============================================================*/ 19 20 #include <rtems.h> 21 #include <bsp.h> 22 #include <bsp/mbx.h> 23 #include <mpc8xx.h> 24 #include <libchip/ide_ctrl.h> 25 #include <libchip/ide_ctrl_cfg.h> 26 #include <libchip/ide_ctrl_io.h> 27 28 29 /* 30 * The following table configures the IDE driver used in this BSP. 31 */ 32 extern ide_ctrl_fns_t mbx8xx_pcmciaide_ctrl_fns; 33 34 /* IDE controllers Table */ 35 ide_controller_bsp_table_t IDE_Controller_Table[] = { 36 {"/dev/idepcmcia", 37 IDE_STD, /* PCMCIA Flash cards emulate standard IDE controller */ 38 &mbx8xx_pcmciaide_ctrl_fns, 39 NULL, /* no BSP dependent probe needed */ 40 FALSE, /* not (yet) initialized */ 41 PCMCIA_MEM_ADDR, /* access address for register set */ 42 FALSE,0, /* not (yet) interrupt driven */ 43 NULL 44 } 45 }; 46 47 /* Number of rows in IDE_Controller_Table */ 48 unsigned long IDE_Controller_Count = 49 sizeof(IDE_Controller_Table)/sizeof(IDE_Controller_Table[0]); 50 51 -
c/src/lib/libbsp/powerpc/mbx8xx/ide/pcmcia_ide.c
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/powerpc/mbx8xx/ide/pcmcia_ide.c rtems-4.6.0pre1-ide/c/src/lib/libbsp/powerpc/mbx8xx/ide/pcmcia_ide.c
old new 1 /*===============================================================*\ 2 | Project: RTEMS MBX8xx PCMCIA IDE harddisc driver | 3 +-----------------------------------------------------------------+ 4 | File: pcmcia_ide.c | 5 +-----------------------------------------------------------------+ 6 | Copyright (c) 2003 IMD | 7 | Ingenieurbuero fuer Microcomputertechnik Th. Doerfler | 8 | <Thomas.Doerfler@imd-systems.de> | 9 | all rights reserved | 10 +-----------------------------------------------------------------+ 11 | this file contains the BSP layer for PCMCIA IDE access below the| 12 | libchip IDE harddisc driver | 13 | based on a board specific driver from | 14 | Eugeny S. Mints, Oktet | 15 | | 16 | The license and distribution terms for this file may be | 17 | found in the file LICENSE in this distribution or at | 18 | http://www.OARcorp.com/rtems/license.html. | 19 | | 20 +-----------------------------------------------------------------+ 21 | date history ID | 22 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 23 | 01.14.03 creation doe | 24 \*===============================================================*/ 25 26 #include <rtems.h> 27 #include <bsp.h> 28 #include <bsp/mbx.h> 29 #include <mpc8xx.h> 30 #include <libchip/ide_ctrl.h> 31 #include <libchip/ide_ctrl_cfg.h> 32 #include <libchip/ide_ctrl_io.h> 33 34 /* #define DATAREG_16BIT */ /* 16 bit mode not yet working */ 35 /* #define DEBUG_OUT */ 36 /* 37 * support functions for PCMCIA IDE IF 38 */ 39 /*=========================================================================*\ 40 | Function: | 41 \*-------------------------------------------------------------------------*/ 42 boolean mbx8xx_pcmciaide_probe 43 ( 44 /*-------------------------------------------------------------------------*\ 45 | Purpose: | 46 | This function should probe, whether a PCMCIA flash disk is available | 47 +---------------------------------------------------------------------------+ 48 | Input Parameters: | 49 \*-------------------------------------------------------------------------*/ 50 int minor 51 ) 52 /*-------------------------------------------------------------------------*\ 53 | Return Value: | 54 | TRUE, when flash disk available | 55 \*=========================================================================*/ 56 { 57 boolean ide_card_plugged = TRUE; /* assume: we have a card plugged in */ 58 59 /* 60 * check, that the CD# pins are low -> a PCMCIA card is plugged in 61 */ 62 if ((m8xx.pipr 63 & (M8xx_PCMCIA_PIPR_CACD1 | M8xx_PCMCIA_PIPR_CACD2)) != 0x00) { 64 ide_card_plugged = FALSE; 65 } 66 /* 67 * set supply voltage to 3.3V 68 * FIXME: this should be depending on state of VS1/2 pins 69 * FIXME: there should be a shadow variable for the BSP for CSR2 access 70 */ 71 *((volatile unsigned8 *)MBX_CSR2) = 0xb0; 72 /* 73 * check card information service whether card is a ATA like disk 74 * -> scan for tuple of type 0x21 with content 0x04 0xXX (fixed disk) 75 * -> scan for tuple of type 0x22 with content 0x01 0x01 76 */ 77 if (ide_card_plugged) { 78 #define CIS_BYTE(pos) (((unsigned8 *)PCMCIA_ATTRB_ADDR)[(pos)*2]) 79 int cis_pos = 0; 80 boolean fixed_disk_tuple_found = FALSE; 81 boolean ata_disk_tuple_found = FALSE; 82 83 while ((cis_pos < 256) && 84 (CIS_BYTE(cis_pos) != 0xff) && 85 (!fixed_disk_tuple_found || !ata_disk_tuple_found)) { 86 /* 87 * check for neede tuples 88 */ 89 if ((CIS_BYTE(cis_pos ) == 0x21) && 90 (CIS_BYTE(cis_pos+2) == 0x04)) { 91 fixed_disk_tuple_found = TRUE; 92 } 93 else if ((CIS_BYTE(cis_pos ) == 0x22) && 94 (CIS_BYTE(cis_pos+2) == 0x01) && 95 (CIS_BYTE(cis_pos+3) == 0x01)) { 96 ata_disk_tuple_found = TRUE; 97 } 98 /* 99 * advance using the length field 100 */ 101 cis_pos += CIS_BYTE(cis_pos+1)+2; 102 } 103 ide_card_plugged = fixed_disk_tuple_found && ata_disk_tuple_found; 104 } 105 return ide_card_plugged; 106 } 107 108 /*=========================================================================*\ 109 | Function: | 110 \*-------------------------------------------------------------------------*/ 111 void mbx8xx_pcmciaide_initialize 112 ( 113 /*-------------------------------------------------------------------------*\ 114 | Purpose: | 115 | initialize PCMCIA IDE flash card access | 116 +---------------------------------------------------------------------------+ 117 | Input Parameters: | 118 \*-------------------------------------------------------------------------*/ 119 int minor /* controller minor number */ 120 ) 121 /*-------------------------------------------------------------------------*\ 122 | Return Value: | 123 | <none> | 124 \*=========================================================================*/ 125 { 126 /* 127 * FIXME: enable interrupts, if needed 128 */ 129 /* 130 * FIXME: set programming voltage as requested 131 */ 132 } 133 134 /*=========================================================================*\ 135 | Function: | 136 \*-------------------------------------------------------------------------*/ 137 void mbx8xx_pcmciaide_read_reg 138 ( 139 /*-------------------------------------------------------------------------*\ 140 | Purpose: | 141 | read a PCMCIA IDE controller register | 142 +---------------------------------------------------------------------------+ 143 | Input Parameters: | 144 \*-------------------------------------------------------------------------*/ 145 int minor, /* controller minor number */ 146 int reg, /* register index to access */ 147 unsigned16 *value /* ptr to return value location */ 148 ) 149 /*-------------------------------------------------------------------------*\ 150 | Return Value: | 151 | <none> | 152 \*=========================================================================*/ 153 { 154 unsigned32 port = IDE_Controller_Table[minor].port1; 155 156 if (reg == IDE_REGISTER_DATA_WORD) { 157 #ifdef DATAREG_16BIT 158 *value = *(volatile unsigned16 *)(port+reg); 159 #else 160 *value = ((*(volatile unsigned8 *)(port+reg) << 8) + 161 (*(volatile unsigned8 *)(port+reg+1) )); 162 #endif 163 } 164 else { 165 *value = *(volatile unsigned8 *)(port+reg); 166 } 167 #ifdef DEBUG_OUT 168 printk("mbx8xx_pcmciaide_read_reg(0x%x)=0x%x\r\n",reg,*value & 0xff); 169 #endif 170 } 171 172 /*=========================================================================*\ 173 | Function: | 174 \*-------------------------------------------------------------------------*/ 175 void mbx8xx_pcmciaide_write_reg 176 ( 177 /*-------------------------------------------------------------------------*\ 178 | Purpose: | 179 | write a PCMCIA IDE controller register | 180 +---------------------------------------------------------------------------+ 181 | Input Parameters: | 182 \*-------------------------------------------------------------------------*/ 183 int minor, /* controller minor number */ 184 int reg, /* register index to access */ 185 unsigned16 value /* value to write */ 186 ) 187 /*-------------------------------------------------------------------------*\ 188 | Return Value: | 189 | <none> | 190 \*=========================================================================*/ 191 { 192 unsigned32 port = IDE_Controller_Table[minor].port1; 193 194 #ifdef DEBUG_OUT 195 printk("mbx8xx_pcmciaide_write_reg(0x%x,0x%x)\r\n",reg,value & 0xff); 196 #endif 197 if (reg == IDE_REGISTER_DATA_WORD) { 198 #ifdef DATAREG_16BIT 199 *(volatile unsigned16 *)(port+reg) = value; 200 #else 201 *(volatile unsigned8 *)(port+reg) = value >> 8; 202 *(volatile unsigned8 *)(port+reg+1) = value; 203 #endif 204 } 205 else { 206 *(volatile unsigned8 *)(port+reg)= value; 207 } 208 } 209 210 /*=========================================================================*\ 211 | Function: | 212 \*-------------------------------------------------------------------------*/ 213 void mbx8xx_pcmciaide_read_block 214 ( 215 /*-------------------------------------------------------------------------*\ 216 | Purpose: | 217 | read a PCMCIA IDE controller register | 218 +---------------------------------------------------------------------------+ 219 | Input Parameters: | 220 \*-------------------------------------------------------------------------*/ 221 int minor, 222 unsigned16 block_size, 223 blkdev_sg_buffer *bufs, 224 rtems_unsigned32 *cbuf, 225 rtems_unsigned32 *pos 226 ) 227 /*-------------------------------------------------------------------------*\ 228 | Return Value: | 229 | <none> | 230 \*=========================================================================*/ 231 { 232 unsigned32 port = IDE_Controller_Table[minor].port1; 233 unsigned16 cnt = 0; 234 #ifdef DEBUG_OUT 235 printk("mbx8xx_pcmciaide_read_block()\r\n"); 236 #endif 237 #ifdef DATAREG_16BIT 238 unsigned16 *lbuf = (unsigned16 *) 239 ((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos)); 240 #else 241 unsigned8 *lbuf = (unsigned8 *) 242 ((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos)); 243 #endif 244 unsigned32 llength = bufs[(*cbuf)].length; 245 246 while (((*(volatile unsigned8 *)(port+IDE_REGISTER_STATUS)) 247 & IDE_REGISTER_STATUS_DRQ) && 248 (cnt < block_size)) { 249 #ifdef DATAREG_16BIT 250 *lbuf++ = *(volatile unsigned16 *)(port+8); /* 16 bit data port */ 251 cnt += 2; 252 (*pos) += 2; 253 #else 254 *lbuf++ = *(volatile unsigned8 *)(port+IDE_REGISTER_DATA); 255 cnt += 1; 256 (*pos) += 1; 257 #endif 258 if ((*pos) == llength) { 259 (*pos) = 0; 260 (*cbuf)++; 261 lbuf = bufs[(*cbuf)].buffer; 262 llength = bufs[(*cbuf)].length; 263 } 264 } 265 } 266 267 /*=========================================================================*\ 268 | Function: | 269 \*-------------------------------------------------------------------------*/ 270 void mbx8xx_pcmciaide_write_block 271 ( 272 /*-------------------------------------------------------------------------*\ 273 | Purpose: | 274 | write a PCMCIA IDE controller register | 275 +---------------------------------------------------------------------------+ 276 | Input Parameters: | 277 \*-------------------------------------------------------------------------*/ 278 int minor, 279 unsigned16 block_size, 280 blkdev_sg_buffer *bufs, 281 rtems_unsigned32 *cbuf, 282 rtems_unsigned32 *pos 283 ) 284 /*-------------------------------------------------------------------------*\ 285 | Return Value: | 286 | <none> | 287 \*=========================================================================*/ 288 { 289 unsigned32 port = IDE_Controller_Table[minor].port1; 290 unsigned16 cnt = 0; 291 292 #ifdef DEBUG_OUT 293 printk("mbx8xx_pcmciaide_write_block()\r\n"); 294 #endif 295 #ifdef DATA_REG_16BIT 296 unsigned16 *lbuf = (unsigned16 *) 297 ((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos)); 298 #else 299 unsigned8 *lbuf = (unsigned8 *) 300 ((unsigned8 *)(bufs[(*cbuf)].buffer) + (*pos)); 301 #endif 302 unsigned32 llength = bufs[(*cbuf)].length; 303 304 while (((*(volatile unsigned8 *)(port+IDE_REGISTER_STATUS)) 305 & IDE_REGISTER_STATUS_DRQ) && 306 (cnt < block_size)) { 307 #ifdef DATAREG_16BIT 308 *(volatile unsigned16 *)(port+8) = *lbuf++; /* 16 bit data port */ 309 cnt += 2; 310 (*pos) += 2; 311 #else 312 *(volatile unsigned8 *)(port+IDE_REGISTER_DATA) = *lbuf++; 313 cnt += 1; 314 (*pos) += 1; 315 #endif 316 if ((*pos) == llength) { 317 (*pos) = 0; 318 (*cbuf)++; 319 lbuf = bufs[(*cbuf)].buffer; 320 llength = bufs[(*cbuf)].length; 321 } 322 } 323 } 324 325 /*=========================================================================*\ 326 | Function: | 327 \*-------------------------------------------------------------------------*/ 328 int mbx8xx_pcmciaide_control 329 ( 330 /*-------------------------------------------------------------------------*\ 331 | Purpose: | 332 | control interface for controller | 333 +---------------------------------------------------------------------------+ 334 | Input Parameters: | 335 \*-------------------------------------------------------------------------*/ 336 int minor, /* controller minor number */ 337 unsigned32 cmd, /* command to send */ 338 void * arg /* optional argument */ 339 ) 340 /*-------------------------------------------------------------------------*\ 341 | Return Value: | 342 | <none> | 343 \*=========================================================================*/ 344 { 345 return 0; 346 } 347 348 /*=========================================================================*\ 349 | Function: | 350 \*-------------------------------------------------------------------------*/ 351 rtems_status_code mbx8xx_pcmciaide_config_io_speed 352 ( 353 /*-------------------------------------------------------------------------*\ 354 | Purpose: | 355 | set up transfer speed, if possible | 356 +---------------------------------------------------------------------------+ 357 | Input Parameters: | 358 \*-------------------------------------------------------------------------*/ 359 int minor, /* controller minor number */ 360 unsigned8 modes_avail /* optional argument */ 361 ) 362 /*-------------------------------------------------------------------------*\ 363 | Return Value: | 364 | rtems_status_code | 365 \*=========================================================================*/ 366 { 367 return RTEMS_SUCCESSFUL; 368 } 369 370 /* 371 * The following table configures the functions used for IDE drivers 372 * in this BSP. 373 */ 374 375 ide_ctrl_fns_t mbx8xx_pcmciaide_ctrl_fns = { 376 mbx8xx_pcmciaide_probe, 377 mbx8xx_pcmciaide_initialize, 378 mbx8xx_pcmciaide_control, 379 mbx8xx_pcmciaide_read_reg, 380 mbx8xx_pcmciaide_write_reg, 381 mbx8xx_pcmciaide_read_block, 382 mbx8xx_pcmciaide_write_block, 383 mbx8xx_pcmciaide_config_io_speed 384 }; 385 -
c/src/lib/libbsp/powerpc/mbx8xx/include/bsp.h
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/powerpc/mbx8xx/include/bsp.h rtems-4.6.0pre1-ide/c/src/lib/libbsp/powerpc/mbx8xx/include/bsp.h
old new 113 113 */ 114 114 115 115 /* 116 * indicate, that BSP has IDE driver 117 */ 118 #define RTEMS_BSP_HAS_IDE_DRIVER 119 120 /* 116 121 * How many libio files we want 117 122 */ 118 123 -
c/src/lib/libbsp/powerpc/mbx8xx/include/mbx.h
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/powerpc/mbx8xx/include/mbx.h rtems-4.6.0pre1-ide/c/src/lib/libbsp/powerpc/mbx8xx/include/mbx.h
old new 59 59 #define IMAP_SIZE ((unsigned int)(64 * 1024)) 60 60 #define PCI_CSR_ADDR ((unsigned int)0xfa210000) 61 61 #define PCI_CSR_SIZE ((unsigned int)(64 * 1024)) 62 63 #define MBX_CSR2 (MBX_CSR_ADDR+1) 62 64 #endif -
c/src/lib/libbsp/powerpc/mbx8xx/startup/imbx8xx.c
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/powerpc/mbx8xx/startup/imbx8xx.c rtems-4.6.0pre1-ide/c/src/lib/libbsp/powerpc/mbx8xx/startup/imbx8xx.c
old new 11 11 */ 12 12 13 13 #include <bsp.h> 14 #include <bsp/mbx.h> 14 15 15 16 /* 16 17 * EPPCBug rev 1.1 is stupid. It clears the interrupt mask register … … 156 157 register unsigned32 r1, i; 157 158 extern unsigned32 simask_copy; 158 159 159 /*160 * Get the SIU interrupt mask.161 */162 simask_copy = m8xx.simask;163 164 160 /* 165 161 * Initialize the Debug Enable Register (DER) to an appropriate 166 162 * value for EPPCBug debugging. … … 213 209 r1 = 0xFA200000; 214 210 _mtspr( M8xx_IMMR, r1 ); 215 211 212 /* 213 * Get the SIU interrupt mask. 214 * imd: accessing m8xx.* should not occure before setting up the immr ! 215 */ 216 simask_copy = m8xx.simask; 217 216 218 /* 217 219 * Initialize the SIU Module Configuration Register (SIUMCR) 218 220 * m8xx.siumcr = 0x00602900, the default MBX and firmware value. … … 274 276 m8xx.plprck = M8xx_UNLOCK_KEY; /* unlock PLPRCR */ 275 277 #if ( defined(mbx821_001) || defined(mbx821_001b) || defined(mbx860_001b) ) 276 278 m8xx.plprcr = 0x5F500000; 277 #elif ( defined(mbx860_005b) ) 279 #elif ( defined(mbx860_005b) || \ 280 defined(mbx860_002b) || \ 281 defined(mbx860_003b) || \ 282 defined(mbx860_004b) || \ 283 defined(mbx860_006b) || \ 284 defined(mbx821_002b) || \ 285 defined(mbx821_003b) || \ 286 defined(mbx821_004b) || \ 287 defined(mbx821_005b) || \ 288 defined(mbx821_006b) ) 278 289 /* Set the multiplication factor to 0 and clear the timer interrupt status*/ 279 290 m8xx.plprcr = 0x00005000; 280 291 #elif ( defined(mbx860_001) || \ … … 282 293 defined(mbx860_003) || \ 283 294 defined(mbx860_004) || \ 284 295 defined(mbx860_005) || \ 285 defined(mbx860_002b) || \286 defined(mbx860_003b) || \287 defined(mbx860_004b) || \288 defined(mbx860_006b) || \289 296 defined(mbx821_002) || \ 290 297 defined(mbx821_003) || \ 291 298 defined(mbx821_004) || \ 292 defined(mbx821_005) || \ 293 defined(mbx821_002b) || \ 294 defined(mbx821_003b) || \ 295 defined(mbx821_004b) || \ 296 defined(mbx821_005b) || \ 297 defined(mbx821_006b) ) 299 defined(mbx821_005)) 298 300 m8xx.plprcr = 0x4C400000; 299 301 #else 300 302 #error "MBX board not defined" … … 582 584 #endif 583 585 m8xx.memc[7]._br = M8xx_BR_BA(0xFC000000) | M8xx_BR_AT(0) | M8xx_BR_PS8 | 584 586 M8xx_BR_MS_GPCM | M8xx_MEMC_BR_V; 587 /* 588 * PCMCIA initialization 589 */ 590 /* 591 * PCMCIA region 0: common memory 592 */ 593 m8xx.pbr0 = PCMCIA_MEM_ADDR; 594 m8xx.por0 = (M8xx_PCMCIA_POR_BSIZE_64MB 595 | M8xx_PCMCIA_POR_PSHT(15) | M8xx_PCMCIA_POR_PSST(15) 596 | M8xx_PCMCIA_POR_PSL(32) 597 | M8xx_PCMCIA_POR_PPS_16 | M8xx_PCMCIA_POR_PRS_MEM 598 |M8xx_PCMCIA_POR_PSLOT_A | M8xx_PCMCIA_POR_VALID); 599 /* 600 * PCMCIA region 1: dma memory 601 */ 602 m8xx.pbr1 = PCMCIA_DMA_ADDR; 603 m8xx.por1 = (M8xx_PCMCIA_POR_BSIZE_64MB 604 | M8xx_PCMCIA_POR_PSHT(15) | M8xx_PCMCIA_POR_PSST(15) 605 | M8xx_PCMCIA_POR_PSL(32) 606 | M8xx_PCMCIA_POR_PPS_16 | M8xx_PCMCIA_POR_PRS_DMA 607 |M8xx_PCMCIA_POR_PSLOT_A | M8xx_PCMCIA_POR_VALID); 608 /* 609 * PCMCIA region 2: attribute memory 610 */ 611 m8xx.pbr2 = PCMCIA_ATTRB_ADDR; 612 m8xx.por2 = (M8xx_PCMCIA_POR_BSIZE_64MB 613 | M8xx_PCMCIA_POR_PSHT(15) | M8xx_PCMCIA_POR_PSST(15) 614 | M8xx_PCMCIA_POR_PSL(32) 615 | M8xx_PCMCIA_POR_PPS_16 | M8xx_PCMCIA_POR_PRS_ATT 616 |M8xx_PCMCIA_POR_PSLOT_A | M8xx_PCMCIA_POR_VALID); 617 /* 618 * PCMCIA region 3: I/O access 619 */ 620 m8xx.pbr3 = PCMCIA_IO_ADDR; 621 m8xx.por3 = (M8xx_PCMCIA_POR_BSIZE_64MB 622 | M8xx_PCMCIA_POR_PSHT(15) | M8xx_PCMCIA_POR_PSST(15) 623 | M8xx_PCMCIA_POR_PSL(32) 624 | M8xx_PCMCIA_POR_PPS_16 | M8xx_PCMCIA_POR_PRS_IO 625 |M8xx_PCMCIA_POR_PSLOT_A | M8xx_PCMCIA_POR_VALID); 626 627 /* 628 * PCMCIA interface general control reg 629 */ 630 m8xx.pgcra = 0; /* no special options set */ 631 /* 632 * PCMCIA interface enable reg 633 */ 634 m8xx.per =0; /* no interrupts enabled now */ 585 635 } -
c/src/lib/libbsp/powerpc/mbx8xx/startup/mmutlbtab.c
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/powerpc/mbx8xx/startup/mmutlbtab.c rtems-4.6.0pre1-ide/c/src/lib/libbsp/powerpc/mbx8xx/startup/mmutlbtab.c
old new 12 12 13 13 #include <bsp.h> 14 14 #include <mpc8xx/mmu.h> 15 15 #include <bsp/mbx.h> 16 16 /* 17 17 * This MMU_TLB_table is used to statically initialize the Table Lookaside 18 18 * Buffers in the MMU of the MBX8xx board. … … 166 166 * R/W,X for all, no ASID comparison, cache-inhibited. 167 167 * EPN TWC RPN 168 168 */ 169 { 0xFA210200, 0x11, 0xFA2109F7 } /* QSPAN - PS=4K */ 169 { 0xFA210200, 0x11, 0xFA2109F7 }, /* QSPAN - PS=4K */ 170 /* 171 * 172 * PCMCIA Spaces: Start address 0xE0000000, 256M? 173 * For each space (MEM/DMA/ATTRIB/IO) only the first 8MB are mapped 174 * ASID=0x0, APG=0x0, guarded memory, 175 * R/W,X for all, no ASID comparison, cache-inhibited. 176 * EPN TWC 177 * RPN 178 */ 179 { (PCMCIA_MEM_ADDR & 0xfffff000) | 0x200, 0x1D, 180 (PCMCIA_MEM_ADDR & 0xfffff000) | 0x9F7 },/* PCMCIA Memory - PS=8M */ 181 182 { (PCMCIA_DMA_ADDR & 0xfffff000) | 0x200, 0x1D, 183 (PCMCIA_DMA_ADDR & 0xfffff000) | 0x9F7 },/* PCMCIA DMA - PS=8M */ 184 185 { (PCMCIA_ATTRB_ADDR & 0xfffff000) | 0x200, 0x1D, 186 (PCMCIA_ATTRB_ADDR & 0xfffff000) | 0x9F7 },/* PCMCIA ATTRIB-PS=8M*/ 187 188 { (PCMCIA_IO_ADDR & 0xfffff000) | 0x200, 0x1D, 189 (PCMCIA_IO_ADDR & 0xfffff000) | 0x9F7 } /* PCMCIA I/O - PS=8M */ 170 190 }; 171 191 172 192 /* -
c/src/lib/libbsp/powerpc/mbx8xx/wrapup/Makefile.am
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libbsp/powerpc/mbx8xx/wrapup/Makefile.am rtems-4.6.0pre1-ide/c/src/lib/libbsp/powerpc/mbx8xx/wrapup/Makefile.am
old new 7 7 NETWORKING = network 8 8 endif 9 9 10 BSP_PIECES = clock irq startup console vectors $(NETWORKING)10 BSP_PIECES = clock irq ide startup console vectors $(NETWORKING) 11 11 # pieces to pick up out of libcpu/ppc 12 12 # CPU_PIECES = mpc8xx/clock mpc8xx/console-generic mpc8xx/cpm \ 13 13 # mpc8xx/mmu mpc8xx/timer mpc8xx/vectors -
c/src/lib/libcpu/ChangeLog
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libcpu/ChangeLog rtems-4.6.0pre1-ide/c/src/lib/libcpu/ChangeLog
old new 1 2003-02-27 Thomas Doerfler <Thomas.Doerfler@imd-systems.de> 2 3 * libcpu/powerpc/mpc8xx/include/mpc8xx.h: added definitions for 4 PCMCIA port 5 1 6 2003-02-11 Ralf Corsepius <corsepiu@faw.uni-ulm.de> 2 7 3 8 * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). -
c/src/lib/libcpu/powerpc/mpc8xx/include/mpc8xx.h
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/lib/libcpu/powerpc/mpc8xx/include/mpc8xx.h rtems-4.6.0pre1-ide/c/src/lib/libcpu/powerpc/mpc8xx/include/mpc8xx.h
old new 767 767 768 768 /* 769 769 ************************************************************************* 770 * PCMCIA Control Registers 771 ************************************************************************* 772 */ 773 #define M8xx_PCMCIA_POR_BSIZE_1B (0x00 << (31-4)) 774 #define M8xx_PCMCIA_POR_BSIZE_2B (0x01 << (31-4)) 775 #define M8xx_PCMCIA_POR_BSIZE_4B (0x03 << (31-4)) 776 #define M8xx_PCMCIA_POR_BSIZE_8B (0x02 << (31-4)) 777 #define M8xx_PCMCIA_POR_BSIZE_16B (0x06 << (31-4)) 778 #define M8xx_PCMCIA_POR_BSIZE_32B (0x07 << (31-4)) 779 #define M8xx_PCMCIA_POR_BSIZE_64B (0x05 << (31-4)) 780 #define M8xx_PCMCIA_POR_BSIZE_128B (0x04 << (31-4)) 781 #define M8xx_PCMCIA_POR_BSIZE_256B (0x0C << (31-4)) 782 #define M8xx_PCMCIA_POR_BSIZE_512B (0x0D << (31-4)) 783 #define M8xx_PCMCIA_POR_BSIZE_1KB (0x0F << (31-4)) 784 #define M8xx_PCMCIA_POR_BSIZE_2KB (0x0E << (31-4)) 785 #define M8xx_PCMCIA_POR_BSIZE_4KB (0x0A << (31-4)) 786 #define M8xx_PCMCIA_POR_BSIZE_8KB (0x0B << (31-4)) 787 #define M8xx_PCMCIA_POR_BSIZE_16KB (0x09 << (31-4)) 788 #define M8xx_PCMCIA_POR_BSIZE_32KB (0x08 << (31-4)) 789 #define M8xx_PCMCIA_POR_BSIZE_64KB (0x18 << (31-4)) 790 #define M8xx_PCMCIA_POR_BSIZE_128KB (0x19 << (31-4)) 791 #define M8xx_PCMCIA_POR_BSIZE_256KB (0x1B << (31-4)) 792 #define M8xx_PCMCIA_POR_BSIZE_512KB (0x1A << (31-4)) 793 #define M8xx_PCMCIA_POR_BSIZE_1MB (0x1E << (31-4)) 794 #define M8xx_PCMCIA_POR_BSIZE_2MB (0x1F << (31-4)) 795 #define M8xx_PCMCIA_POR_BSIZE_4MB (0x1D << (31-4)) 796 #define M8xx_PCMCIA_POR_BSIZE_8MB (0x1C << (31-4)) 797 #define M8xx_PCMCIA_POR_BSIZE_16MB (0x14 << (31-4)) 798 #define M8xx_PCMCIA_POR_BSIZE_32MB (0x15 << (31-4)) 799 #define M8xx_PCMCIA_POR_BSIZE_64MB (0x17 << (31-4)) 800 801 #define M8xx_PCMCIA_POR_PSHT(x) (((x) & 0x0f) << (31-15)) 802 #define M8xx_PCMCIA_POR_PSST(x) (((x) & 0x0f) << (31-19)) 803 #define M8xx_PCMCIA_POR_PSL(x) (((x) & 0x1f) << (31-24)) 804 #define M8xx_PCMCIA_POR_PPS_8 ((0) << (31-19)) 805 #define M8xx_PCMCIA_POR_PPS_16 ((1) << (31-19)) 806 807 #define M8xx_PCMCIA_POR_PRS_MEM ((0) << (31-28)) 808 #define M8xx_PCMCIA_POR_PRS_ATT ((2) << (31-28)) 809 #define M8xx_PCMCIA_POR_PRS_IO ((3) << (31-28)) 810 #define M8xx_PCMCIA_POR_PRS_DMA ((4) << (31-28)) 811 #define M8xx_PCMCIA_POR_PRS_DML ((5) << (31-28)) 812 813 #define M8xx_PCMCIA_POR_PSLOT_A ((0) << (31-29)) 814 #define M8xx_PCMCIA_POR_PSLOT_B ((1) << (31-29)) 815 816 #define M8xx_PCMCIA_POR_WP ((1) << (31-30)) 817 #define M8xx_PCMCIA_POR_VALID ((1) << (31-31)) 818 819 #define M8xx_PCMCIA_PGCR_CIRQLVL(x) (((x) & 0xff) << (31- 7)) 820 #define M8xx_PCMCIA_PGCR_CSCHLVL(x) (((x) & 0xff) << (31-15)) 821 #define M8xx_PCMCIA_PGCR_CDRQ_OFF ((0) << (31-17)) 822 #define M8xx_PCMCIA_PGCR_CDRQ_IOIS16 ((2) << (31-17)) 823 #define M8xx_PCMCIA_PGCR_CDRQ_SPKR ((3) << (31-17)) 824 #define M8xx_PCMCIA_PGCR_COE ((1) << (31-24)) 825 #define M8xx_PCMCIA_PGCR_CRESET ((1) << (31-25)) 826 827 #define M8xx_PCMCIA_PIPR_CAVS1 ((1) << (31- 0)) 828 #define M8xx_PCMCIA_PIPR_CAVS2 ((1) << (31- 1)) 829 #define M8xx_PCMCIA_PIPR_CAWP ((1) << (31- 2)) 830 #define M8xx_PCMCIA_PIPR_CACD2 ((1) << (31- 3)) 831 #define M8xx_PCMCIA_PIPR_CACD1 ((1) << (31- 4)) 832 #define M8xx_PCMCIA_PIPR_CABVD2 ((1) << (31- 5)) 833 #define M8xx_PCMCIA_PIPR_CABVD1 ((1) << (31- 6)) 834 #define M8xx_PCMCIA_PIPR_CARDY ((1) << (31- 7)) 835 #define M8xx_PCMCIA_PIPR_CBVS1 ((1) << (31-16)) 836 #define M8xx_PCMCIA_PIPR_CBVS2 ((1) << (31-17)) 837 #define M8xx_PCMCIA_PIPR_CBWP ((1) << (31-18)) 838 #define M8xx_PCMCIA_PIPR_CBCD2 ((1) << (31-19)) 839 #define M8xx_PCMCIA_PIPR_CBCD1 ((1) << (31-20)) 840 #define M8xx_PCMCIA_PIPR_CBBVD2 ((1) << (31-21)) 841 #define M8xx_PCMCIA_PIPR_CBBVD1 ((1) << (31-22)) 842 #define M8xx_PCMCIA_PIPR_CBRDY ((1) << (31-23)) 843 844 845 #define M8xx_SYPCR_BMT(x) ((x)<<8) /* Bus monitor timing */ 846 #define M8xx_SYPCR_BME (1<<7) /* Bus monitor enable */ 847 #define M8xx_SYPCR_SWF (1<<3) /* Software watchdog freeze */ 848 #define M8xx_SYPCR_SWE (1<<2) /* Software watchdog enable */ 849 #define M8xx_SYPCR_SWRI (1<<1) /* Watchdog reset/interrupt sel. */ 850 #define M8xx_SYPCR_SWP (1<<0) /* Software watchdog prescale */ 851 852 /* 853 ************************************************************************* 770 854 * Memory Control Registers * 771 855 ************************************************************************* 772 856 */ -
c/src/libchip/ChangeLog
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/libchip/ChangeLog rtems-4.6.0pre1-ide/c/src/libchip/ChangeLog
old new 28 28 29 29 2002-10-31 Joel Sherrill <joel@OARcorp.com> 30 30 31 * ide/Makefile.am: various corrections to get it working 32 33 2002-10-31 Joel Sherrill <joel@OARcorp.com> 34 31 35 * network/dec21140.c: Removed warnings. 32 36 33 37 2002-10-28 Eugeny S. Mints <Eugeny.Mints@oktet.ru> -
c/src/libchip/ide/Makefile.am
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/libchip/ide/Makefile.am rtems-4.6.0pre1-ide/c/src/libchip/ide/Makefile.am
old new 5 5 6 6 include_idedir = $(includedir)/libchip 7 7 8 LIBNAME = libide 9 LIB = $(ARCH)/$(LIBNAME).a 10 11 C_FILES = ide_controller.c 12 C_O_FILES = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT)) 13 14 noinst_HEADERS = 15 8 16 include_ide_HEADERS = ide_ctrl_cfg.h ide_ctrl.h ide_ctrl_io.h 9 17 18 OBJS = $(C_O_FILES) 19 20 include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg 21 include $(top_srcdir)/../../../automake/compile.am 22 include $(top_srcdir)/../../../automake/lib.am 23 10 24 PREINSTALL_FILES = $(PROJECT_INCLUDE)/libchip \ 11 25 $(include_ide_HEADERS:%=$(PROJECT_INCLUDE)/libchip/%) 12 26 … … 15 29 $(PROJECT_INCLUDE)/libchip/%.h: %.h 16 30 $(INSTALL_DATA) $< $@ 17 31 18 all-local: $(PREINSTALL_FILES) 32 $(LIB): $(OBJS) 33 $(make-library) 34 35 all-local: $(ARCH) $(PREINSTALL_FILES) $(LIB) 19 36 20 EXTRA_DIST = 37 EXTRA_DIST = $(C_FILES) 21 38 22 39 include $(top_srcdir)/../../../automake/subdirs.am 23 include $(top_srcdir)/../../../automake/local.am 40 include $(top_srcdir)/../../../automake/local.am 41 No newline at end of file -
c/src/libchip/ide/ide_controller.c
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/libchip/ide/ide_controller.c rtems-4.6.0pre1-ide/c/src/libchip/ide/ide_controller.c
old new 1 /* 2 * ide_controller.c 3 * 4 * This is generic rtems driver for IDE controllers. 5 * 6 * Copyright (C) 2001 OKTET Ltd., St.-Petersburg, Russia 7 * Authors: Alexandra Kossovsky <sasha@oktet.ru> 8 * Eugeny S. Mints <Eugeny.Mints@oktet.ru> 9 * 10 * The license and distribution terms for this file may be 11 * found in the file LICENSE in this distribution or at 12 * http://www.OARcorp.com/rtems/license.html. 13 * 14 * $Id: ide_ctrl.c,v 1.5 2002/10/11 05:53:51 jack Exp $ 15 * 16 */ 17 #include <chain.h> 18 #include <assert.h> 19 #include <rtems/blkdev.h> 20 21 #include <libchip/ide_ctrl_cfg.h> 22 #include <libchip/ide_ctrl_io.h> 23 24 /* 25 * ide_controller_initialize -- 26 * Initializes all configured IDE controllers. Controllers configuration 27 * table is provided by BSP 28 * 29 * PARAMETERS: 30 * major - device major number 31 * minor_arg - device minor number 32 * args - arguments 33 * 34 * RETURNS: 35 * RTEMS_SUCCESSFUL on success, or error code if 36 * error occured 37 */ 38 rtems_device_driver 39 ide_controller_initialize(rtems_device_major_number major, 40 rtems_device_minor_number minor_arg, 41 void *args) 42 { 43 unsigned long minor; 44 rtems_status_code status; 45 46 /* FIXME: may be it should be done on compilation phase */ 47 if (IDE_Controller_Count > IDE_CTRL_MAX_MINOR_NUMBER) 48 rtems_fatal_error_occurred(RTEMS_TOO_MANY); 49 50 for (minor=0; minor < IDE_Controller_Count; minor++) 51 { 52 IDE_Controller_Table[minor].status = IDE_CTRL_NON_INITIALIZED; 53 54 if ((IDE_Controller_Table[minor].probe != NULL && 55 IDE_Controller_Table[minor].probe(minor)) || 56 IDE_Controller_Table[minor].fns->ctrl_probe(minor)) 57 { 58 status = rtems_io_register_name(IDE_Controller_Table[minor].name, 59 major, minor); 60 if (status != RTEMS_SUCCESSFUL) 61 rtems_fatal_error_occurred(status); 62 63 IDE_Controller_Table[minor].fns->ctrl_initialize(minor); 64 65 IDE_Controller_Table[minor].status = IDE_CTRL_INITIALIZED; 66 } 67 } 68 return RTEMS_SUCCESSFUL; 69 } 70 71 /* 72 * ide_controller_read_data_block -- 73 * Read data block via controller's data register 74 * 75 * PARAMETERS: 76 * minor - minor number of controller 77 * block_size - number of bytes to read 78 * bufs - set of buffers to store data 79 * cbuf - number of current buffer from the set 80 * pos - position inside current buffer 'cbuf' 81 * 82 * RETURNS: 83 * NONE 84 */ 85 void 86 ide_controller_read_data_block(rtems_device_minor_number minor, 87 unsigned16 block_size, 88 blkdev_sg_buffer *bufs, 89 rtems_unsigned32 *cbuf, 90 rtems_unsigned32 *pos) 91 { 92 IDE_Controller_Table[minor].fns->ctrl_read_block(minor, block_size, bufs, 93 cbuf, pos); 94 } 95 96 /* 97 * ide_controller_write_data_block -- 98 * Write data block via controller's data register 99 * 100 * PARAMETERS: 101 * minor - minor number of controller 102 * block_size - number of bytes to write 103 * bufs - set of buffers which store data 104 * cbuf - number of current buffer from the set 105 * pos - position inside current buffer 'cbuf' 106 * 107 * RETURNS: 108 * NONE 109 */ 110 void 111 ide_controller_write_data_block(rtems_device_minor_number minor, 112 unsigned16 block_size, 113 blkdev_sg_buffer *bufs, 114 rtems_unsigned32 *cbuf, 115 rtems_unsigned32 *pos) 116 117 { 118 IDE_Controller_Table[minor].fns->ctrl_write_block(minor, block_size, bufs, 119 cbuf, pos); 120 } 121 122 /* 123 * ide_controller_read_register -- 124 * Read controller's register 125 * 126 * PARAMETERS: 127 * minor - minor number of controller 128 * reg - register to read 129 * value - placeholder for result 130 * 131 * RETURNS 132 * NONE 133 */ 134 void 135 ide_controller_read_register(rtems_device_minor_number minor, 136 int reg, 137 unsigned16 *value) 138 { 139 IDE_Controller_Table[minor].fns->ctrl_reg_read(minor, reg, value); 140 } 141 142 /* 143 * ide_controller_write_register -- 144 * Write controller's register 145 * 146 * PARAMETERS: 147 * minor - minor number of controller 148 * reg - register to write 149 * value - value to write 150 * 151 * RETURNS: 152 * NONE 153 */ 154 void 155 ide_controller_write_register(rtems_device_minor_number minor, int reg, 156 unsigned16 value) 157 { 158 IDE_Controller_Table[minor].fns->ctrl_reg_write(minor, reg, value); 159 } 160 161 /* 162 * ide_controller_config_io_speed -- 163 * Set controller's speed of IO operations 164 * 165 * PARAMETERS: 166 * minor - minor number of controller 167 * modes_avaible - speeds available 168 * 169 * RETURNS: 170 * RTEMS_SUCCESSFUL on success, or error code if 171 * error occured 172 */ 173 rtems_status_code 174 ide_controller_config_io_speed(int minor, unsigned8 modes_avaible) 175 { 176 return IDE_Controller_Table[minor].fns->ctrl_config_io_speed( 177 minor, 178 modes_avaible); 179 } -
c/src/libchip/ide/ide_ctrl_cfg.h
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/libchip/ide/ide_ctrl_cfg.h rtems-4.6.0pre1-ide/c/src/libchip/ide/ide_ctrl_cfg.h
old new 26 26 * Avaible drivers for IDE controllers 27 27 */ 28 28 typedef enum { 29 IDE_STD, 29 30 IDE_CUSTOM /* BSP specific driver */ 30 31 } ide_ctrl_devs_t; 31 32 … … 70 71 char *name; /* device name */ 71 72 ide_ctrl_devs_t type; /* chip type */ 72 73 ide_ctrl_fns_t *fns; /* pointer to the set of driver routines */ 73 boolean (*probe)(int minor); /* probe routine */74 boolean (*probe)(int minor); /* general probe routine */ 74 75 unsigned8 status; /* initialized/non initialized. Should be set 75 76 * to zero by static initialization 76 77 */ -
c/src/wrapup/Makefile.am
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/c/src/wrapup/Makefile.am rtems-4.6.0pre1-ide/c/src/wrapup/Makefile.am
old new 25 25 LIBCHIP = \ 26 26 ../libchip/rtc/$(ARCH)/librtcio.a \ 27 27 ../libchip/serial/$(ARCH)/libserialio.a \ 28 ../libchip/ide/$(ARCH)/libide.a \ 28 29 $(wildcard $(PROJECT_RELEASE)/lib/libnetchip$(LIB_VARIANT).a) 29 30 endif 30 31 -
make/custom/mbx821_002.cfg
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/make/custom/mbx821_002.cfg rtems-4.6.0pre1-ide/make/custom/mbx821_002.cfg
old new 1 # 2 # Config file for a PowerPC MPC860-based MBX821-001 card. 3 # 4 5 # 6 # All MBX8xx configurations share the same base file, only a few 7 # parameters differ. 8 # 9 10 RTEMS_MBX_MODEL=mbx821_002 11 8XX_CPU_TYPE=821 12 13 include $(RTEMS_ROOT)/make/custom/mbx8xx.cfg -
make/custom/mbx821_002b.cfg
diff -x '*~' -x Makefile.in -x configure.in -x configure -x autom4te.cache -P -r -u rtems-4.6.0pre1/make/custom/mbx821_002b.cfg rtems-4.6.0pre1-ide/make/custom/mbx821_002b.cfg
old new 1 # 2 # Config file for a PowerPC MPC860-based MBX821-002b card. 3 # 4 5 # 6 # All MBX8xx configurations share the same base file, only a few 7 # parameters differ. 8 # 9 10 RTEMS_MBX_MODEL=mbx821_002b 11 8XX_CPU_TYPE=821 12 13 include $(RTEMS_ROOT)/make/custom/mbx8xx.cfg