mirror of https://github.com/ipxe/ipxe.git
added endianness to natsemi.
parent
0c324caecf
commit
c6d0ef3478
|
@ -96,18 +96,13 @@ static void spi_bit_transfer ( struct spi_bit_basher *spibit,
|
||||||
|
|
||||||
DBG ( "Transferring %d bits in mode %x\n", len, bus->mode );
|
DBG ( "Transferring %d bits in mode %x\n", len, bus->mode );
|
||||||
|
|
||||||
<<<<<<< HEAD:src/drivers/bitbash/spi_bit.c
|
|
||||||
for ( step = 0 ; step < ( len * 2 ) ; step++ ) {
|
for ( step = 0 ; step < ( len * 2 ) ; step++ ) {
|
||||||
/* Calculate byte offset and byte mask */
|
/* Calculate byte offset and byte mask */
|
||||||
bit_offset = ( ( endianness == SPI_BIT_BIG_ENDIAN ) ?
|
bit_offset = ( ( endianness == SPI_BIT_BIG_ENDIAN ) ?
|
||||||
( len - ( step / 2 ) - 1 ) : ( step / 2 ) );
|
( len - ( step / 2 ) - 1 ) : ( step / 2 ) );
|
||||||
byte_offset = ( bit_offset / 8 );
|
byte_offset = ( bit_offset / 8 );
|
||||||
byte_mask = ( 1 << ( bit_offset % 8 ) );
|
byte_mask = ( 1 << ( bit_offset % 8 ) );
|
||||||
=======
|
|
||||||
>>>>>>> debugging natsemi.c:src/drivers/bitbash/spi_bit.c
|
|
||||||
<<<<<<< HEAD:src/drivers/bitbash/spi_bit.c
|
|
||||||
=======
|
|
||||||
>>>>>>> debugging natsemi.c:src/drivers/bitbash/spi_bit.c
|
|
||||||
/* Shift data in or out */
|
/* Shift data in or out */
|
||||||
if ( sclk == cpha ) {
|
if ( sclk == cpha ) {
|
||||||
const uint8_t *byte;
|
const uint8_t *byte;
|
||||||
|
|
|
@ -221,6 +221,7 @@ static struct nvo_fragment nat_nvo_fragments[] = {
|
||||||
// Initialise three-wire bus
|
// Initialise three-wire bus
|
||||||
nat->spibit.basher.op = &nat_basher_ops;
|
nat->spibit.basher.op = &nat_basher_ops;
|
||||||
nat->spibit.bus.mode = SPI_MODE_THREEWIRE;
|
nat->spibit.bus.mode = SPI_MODE_THREEWIRE;
|
||||||
|
nat->spibit.endianness = SPI_BIT_LITTLE_ENDIAN;
|
||||||
init_spi_bit_basher ( &nat->spibit );
|
init_spi_bit_basher ( &nat->spibit );
|
||||||
|
|
||||||
DBG ( "EEPROM is an AT93C46\n" );
|
DBG ( "EEPROM is an AT93C46\n" );
|
||||||
|
|
Loading…
Reference in New Issue