aboutsummaryrefslogtreecommitdiff
path: root/src/include/ipxe/spi_bit.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2010-04-19 20:16:01 +0100
committerMichael Brown <mcb30@ipxe.org>2010-04-19 23:43:39 +0100
commit8406115834d38bb743e01f35bfd36e835532415e (patch)
treeee1e3106e2cdc645d911ba5643f8414b21fc4c3e /src/include/ipxe/spi_bit.h
parent2a36703af228bd10d50a31daec96072fe3a992a3 (diff)
downloadipxe-8406115834d38bb743e01f35bfd36e835532415e.zip
ipxe-8406115834d38bb743e01f35bfd36e835532415e.tar.gz
ipxe-8406115834d38bb743e01f35bfd36e835532415e.tar.bz2
[build] Rename gPXE to iPXE
Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/spi_bit.h')
-rw-r--r--src/include/ipxe/spi_bit.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/include/ipxe/spi_bit.h b/src/include/ipxe/spi_bit.h
new file mode 100644
index 0000000..9cfa7b8
--- /dev/null
+++ b/src/include/ipxe/spi_bit.h
@@ -0,0 +1,63 @@
+#ifndef _IPXE_SPI_BIT_H
+#define _IPXE_SPI_BIT_H
+
+/** @file
+ *
+ * SPI bit-bashing interface
+ *
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER );
+
+#include <ipxe/spi.h>
+#include <ipxe/bitbash.h>
+
+/** A bit-bashing SPI bus */
+struct spi_bit_basher {
+ /** SPI bus */
+ struct spi_bus bus;
+ /** Bit-bashing interface */
+ struct bit_basher basher;
+ /** Endianness of data
+ *
+ * SPI commands and addresses are always big-endian (i.e. MSB
+ * transmitted first on the wire), but some cards
+ * (e.g. natsemi) choose to regard the data stored in the
+ * EEPROM as little-endian (i.e. LSB transmitted first on the
+ * wire).
+ */
+ int endianness;
+};
+
+/** Bit indices used for SPI bit-bashing interface */
+enum {
+ /** Serial clock */
+ SPI_BIT_SCLK = 0,
+ /** Master Out Slave In */
+ SPI_BIT_MOSI,
+ /** Master In Slave Out */
+ SPI_BIT_MISO,
+ /** Slave 0 select */
+ SPI_BIT_SS0,
+};
+
+/**
+ * Determine bit index for a particular slave
+ *
+ * @v slave Slave number
+ * @ret index Bit index (i.e. SPI_BIT_SSN, where N=slave)
+ */
+#define SPI_BIT_SS( slave ) ( SPI_BIT_SS0 + (slave) )
+
+/** Delay between SCLK transitions */
+#define SPI_BIT_UDELAY 1
+
+/** SPI bit basher treats data as big-endian */
+#define SPI_BIT_BIG_ENDIAN 0
+
+/** SPI bit basher treats data as little-endian */
+#define SPI_BIT_LITTLE_ENDIAN 1
+
+extern void init_spi_bit_basher ( struct spi_bit_basher *spibit );
+
+#endif /* _IPXE_SPI_BIT_H */