|
|
|
@ -20,6 +20,10 @@
|
|
|
|
|
*
|
|
|
|
|
* Written by Marcel Telka <marcel@telka.sk>, 2002.
|
|
|
|
|
*
|
|
|
|
|
* Documentation:
|
|
|
|
|
* [1] Intel Corporation, "Intel PXA250 and PXA210 Application Processors
|
|
|
|
|
* Developer's Manual", February 2002, Order Number: 278522-001
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
@ -70,7 +74,7 @@ pxa250_bus_read_start( parts *ps, uint32_t adr )
|
|
|
|
|
{
|
|
|
|
|
part *p = ps->parts[0];
|
|
|
|
|
|
|
|
|
|
/* see Figure 6-13 in PXA doc */
|
|
|
|
|
/* see Figure 6-13 in [1] */
|
|
|
|
|
part_set_signal( p, "nCS[0]", 1, 0 );
|
|
|
|
|
part_set_signal( p, "DQM[0]", 1, 0 );
|
|
|
|
|
part_set_signal( p, "DQM[1]", 1, 0 );
|
|
|
|
@ -92,7 +96,7 @@ pxa250_bus_read_next( parts *ps, uint32_t adr )
|
|
|
|
|
{
|
|
|
|
|
part *p = ps->parts[0];
|
|
|
|
|
|
|
|
|
|
/* see Figure 6-13 in PXA doc */
|
|
|
|
|
/* see Figure 6-13 in [1] */
|
|
|
|
|
setup_address( p, adr );
|
|
|
|
|
parts_shift_data_registers( ps );
|
|
|
|
|
|
|
|
|
@ -115,7 +119,7 @@ pxa250_bus_read_end( parts *ps )
|
|
|
|
|
{
|
|
|
|
|
part *p = ps->parts[0];
|
|
|
|
|
|
|
|
|
|
/* see Figure 6-13 in PXA doc */
|
|
|
|
|
/* see Figure 6-13 in [1] */
|
|
|
|
|
part_set_signal( p, "nCS[0]", 1, 1 );
|
|
|
|
|
part_set_signal( p, "nOE", 1, 1 );
|
|
|
|
|
part_set_signal( p, "nSDCAS", 1, 1 );
|
|
|
|
@ -146,7 +150,7 @@ pxa250_bus_read( parts *ps, uint32_t adr )
|
|
|
|
|
void
|
|
|
|
|
pxa250_bus_write( parts *ps, uint32_t adr, uint32_t data )
|
|
|
|
|
{
|
|
|
|
|
/* see Figure 6-17 in PXA doc */
|
|
|
|
|
/* see Figure 6-17 in [1] */
|
|
|
|
|
part *p = ps->parts[0];
|
|
|
|
|
|
|
|
|
|
part_set_signal( p, "nCS[0]", 1, 0 );
|
|
|
|
@ -170,7 +174,38 @@ pxa250_bus_write( parts *ps, uint32_t adr, uint32_t data )
|
|
|
|
|
parts_shift_data_registers( ps );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
pxa250_bus_width( parts *ps )
|
|
|
|
|
{
|
|
|
|
|
part *p = ps->parts[0];
|
|
|
|
|
uint8_t boot_sel = (part_get_signal( p, "BOOT_SEL[2]" ) << 2)
|
|
|
|
|
| (part_get_signal( p, "BOOT_SEL[1]" ) << 1)
|
|
|
|
|
| part_get_signal( p, "BOOT_SEL[0]" );
|
|
|
|
|
|
|
|
|
|
/* see Table 6-36. in [1] */
|
|
|
|
|
switch (boot_sel) {
|
|
|
|
|
case 0:
|
|
|
|
|
printf( "BOOT_SEL: Asynchronous 32-bit ROM\n" );
|
|
|
|
|
return 32;
|
|
|
|
|
case 1:
|
|
|
|
|
printf( "BOOT_SEL: Asynchronous 16-bit ROM\n" );
|
|
|
|
|
return 16;
|
|
|
|
|
case 2:
|
|
|
|
|
case 3:
|
|
|
|
|
case 4:
|
|
|
|
|
case 5:
|
|
|
|
|
case 6:
|
|
|
|
|
case 7:
|
|
|
|
|
printf( "TODO - BOOT_SEL\n" );
|
|
|
|
|
return 0;
|
|
|
|
|
default:
|
|
|
|
|
printf( "BUG in code, file %s, line %d.\n", __FILE__, __LINE__ );
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bus_driver_t pxa250_bus_driver = {
|
|
|
|
|
pxa250_bus_width,
|
|
|
|
|
pxa250_bus_read_start,
|
|
|
|
|
pxa250_bus_read_next,
|
|
|
|
|
pxa250_bus_read_end,
|
|
|
|
|