Skip to contentSkip to conversation

Support for XPedite5370 and misc GPIO

PATCH Superseded Peter Tyser 1 participant 4 messages Nov 26, 2008

Subsystems (3)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v3 cover Support for XPedite5370 and misc GPIO

Hello,
This patch series adds support for the XPedite5370 SBC. Its an MPC8572-based VPX card with a PMC/XMC site. The XPedite5370 includes a significant number of I2C GPIO devices (5) which are used for board configuration. I added support for 2 new I2C gpio devices in a new drivers/gpio directory. I'm not sure if this is the preferred location/method, so let me know if others have have different preferences. It'd be nice to have a more generic GPIO framework (like Linux's) at some point, but figured this was a step in the right direction by providing a place for generic GPIO devices in drivers/gpio.

Thanks,
Peter

Changes since v1:
- Rebased to u-boot-mpc85xx tree
- Updated NOR flash remapping method
- Added CONFIG_SYS_I2C2_OFFSET define to XPEDITE5370.h
- Removed CONFIG_SYS_EEPROM_PAGE_WRITE_ENABLE from XPEDITE5370.h

Changes since v2:
pca953x.c:
- Use cmd_tbl_t for subcommand parsing
- Made 'info' command dependent on CONFIG_CMD_PCA953X_INFO
- Removed chip command parameters, added 'device' subcommand

ds4510.c:
- Use cmd_tbl_t for subcommand parsing
- Made 'info' command dependent on CONFIG_CMD_DS4510_INFO
- Made memory commands dependent on CONFIG_CMD_DS4510_MEM
- Made 'rst' command dependent on CONFIG_CMD_DS4510_RST
- Removed chip command parameters, added 'device' subcommand
- Fixed multiline comment style
- moved to drivers/misc

xpedite5370:
- Changed alignment by spaces to alignment by tabs
- Fixed gur->devdisr typo for PCIe2
- Fixed some lines over 80 chars
- Fixed multiline comment style
- Cleaned up environment defines

Peter Tyser (3):
Add support for PCA953x I2C gpio devices
Add support for Maxim's DS4510 I2C device
XPedite5370 board support

 MAINTAINERS                         |    3 +
 MAKEALL                             |    1 +
 Makefile                            |    5 +
 README                              |   13 +
 board/xes/common/Makefile           |   56 ++++
 board/xes/common/fsl_8572_clk.c     |   51 +++
 board/xes/common/fsl_85xx_ddr.c     |   93 ++++++
 board/xes/common/fsl_85xx_pci.c     |  265 ++++++++++++++++
 board/xes/xpedite5370/Makefile      |   45 +++
 board/xes/xpedite5370/config.mk     |   35 ++
 board/xes/xpedite5370/ddr.c         |  270 ++++++++++++++++
 board/xes/xpedite5370/law.c         |   54 ++++
 board/xes/xpedite5370/tlb.c         |   94 ++++++
 board/xes/xpedite5370/u-boot.lds    |  145 +++++++++
 board/xes/xpedite5370/xpedite5370.c |  128 ++++++++
 drivers/gpio/Makefile               |   47 +++
 drivers/gpio/pca953x.c              |  218 +++++++++++++
 drivers/misc/Makefile               |    1 +
 drivers/misc/ds4510.c               |  400 ++++++++++++++++++++++++
 include/configs/XPEDITE5370.h       |  590 +++++++++++++++++++++++++++++++++++
 include/gpio/ds4510.h               |   75 +++++
 include/gpio/pca953x.h              |   39 +++
 22 files changed, 2628 insertions(+), 0 deletions(-)
 create mode 100644 board/xes/common/Makefile
 create mode 100644 board/xes/common/fsl_8572_clk.c
 create mode 100644 board/xes/common/fsl_85xx_ddr.c
 create mode 100644 board/xes/common/fsl_85xx_pci.c
 create mode 100644 board/xes/xpedite5370/Makefile
 create mode 100644 board/xes/xpedite5370/config.mk
 create mode 100644 board/xes/xpedite5370/ddr.c
 create mode 100644 board/xes/xpedite5370/law.c
 create mode 100644 board/xes/xpedite5370/tlb.c
 create mode 100644 board/xes/xpedite5370/u-boot.lds
 create mode 100644 board/xes/xpedite5370/xpedite5370.c
 create mode 100644 drivers/gpio/Makefile
 create mode 100644 drivers/gpio/pca953x.c
 create mode 100644 drivers/misc/ds4510.c
 create mode 100644 include/configs/XPEDITE5370.h
 create mode 100644 include/gpio/ds4510.h
 create mode 100644 include/gpio/pca953x.h
#1 lore raw

PATCH v3 1/3 Add support for PCA953x I2C gpio devices

Initial support for NXP's 4 and 8 bit I2C gpio expanders (eg pca9537, pca9557, etc). The CONFIG_PCA953X define enables support for the devices while the CONFIG_CMD_PCA953X define enables the pca953x command. The CONFIG_CMD_PCA953X_INFO define enables an 'info' sub-command which provides summary information for the given pca953x device.

---
 Makefile               |    2 +
 README                 |    9 ++
 drivers/gpio/Makefile  |   47 ++++++++++
 drivers/gpio/pca953x.c |  218 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/gpio/pca953x.h |   39 +++++++++
 5 files changed, 315 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpio/Makefile
 create mode 100644 drivers/gpio/pca953x.c
 create mode 100644 include/gpio/pca953x.h
Makefile +2 -0
index fd521b6..0c5dd61 100644
@@ -221,6 +221,7 @@ LIBS += disk/libdisk.a
 LIBS += drivers/bios_emulator/libatibiosemu.a
 LIBS += drivers/block/libblock.a
 LIBS += drivers/dma/libdma.a
+LIBS += drivers/gpio/libgpio.a
 LIBS += drivers/hwmon/libhwmon.a
 LIBS += drivers/i2c/libi2c.a
 LIBS += drivers/input/libinput.a
@@ -396,6 +397,7 @@ TAG_SUBDIRS += disk
 TAG_SUBDIRS += common
 TAG_SUBDIRS += drivers/bios_emulator
 TAG_SUBDIRS += drivers/block
+TAG_SUBDIRS += drivers/gpio
 TAG_SUBDIRS += drivers/hwmon
 TAG_SUBDIRS += drivers/i2c
 TAG_SUBDIRS += drivers/input
README +9 -0
index 9455fa7..bca8061 100644
@@ -603,6 +603,8 @@ The following options need to be configured:
 		CONFIG_CMD_MII		* MII utility commands
 		CONFIG_CMD_NAND		* NAND support
 		CONFIG_CMD_NET		  bootp, tftpboot, rarpboot
+		CONFIG_CMD_PCA953X	* PCA953x I2C gpio commands
+		CONFIG_CMD_PCA953X_INFO	* PCA953x I2C gpio info command
 		CONFIG_CMD_PCI		* pciinfo
 		CONFIG_CMD_PCMCIA		* PCMCIA support
 		CONFIG_CMD_PING		* send ICMP ECHO_REQUEST to network
@@ -680,6 +682,13 @@ The following options need to be configured:
 		Note that if the RTC uses I2C, then the I2C interface
 		must also be configured. See I2C Support, below.
 
+- GPIO Support:
+		CONFIG_PCA953X		- use NXP's PCA953X series I2C GPIO
+		CONFIG_PCA953X_INFO	- enable pca953x info command
+
+		Note that if the GPIO device uses I2C, then the I2C interface
+		must also be configured. See I2C Support, below.
+
 - Timestamp Support:
 
 		When CONFIG_TIMESTAMP is selected, the timestamp
drivers/gpio/Makefile new file +47 -0

47 lines not on this page · raw message

drivers/gpio/pca953x.c new file +218 -0

218 lines not on this page · raw message

include/gpio/pca953x.h new file +39 -0
new file mode 100644
index 0000000..6c2b58c
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2008 Extreme Engineering Solutions, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * Version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __PCA953X_H_
+#define __PCA953X_H_
+
+#define PCA953X_IN		0x00
+#define PCA953X_OUT		0x01
+#define PCA953X_POL		0x02
+#define PCA953X_CONF		0x03
+
+#define PCA953X_OUT_LOW		0
+#define PCA953X_OUT_HIGH	1
+#define PCA953X_POL_NORMAL	0
+#define PCA953X_POL_INVERT	1
+#define PCA953X_DIR_OUT		0
+#define PCA953X_DIR_IN		1
+
+int pca953x_set_val(u8 chip, uint mask, uint data);
+int pca953x_set_pol(u8 chip, uint mask, uint data);
+int pca953x_set_dir(u8 chip, uint mask, uint data);
+int pca953x_get_val(u8 chip);
+
+#endif /* __PCA953X_H_ */
Signature · 1 line
1.6.0.2.GIT
#2 lore raw

PATCH v3 2/3 Add support for Maxim's DS4510 I2C device

Initial support for the DS4510, a CPU supervisor with integrated EEPROM, SRAM, and 4 programmable non-volatile GPIO pins. The CONFIG_DS4510 define enables support for the device while the CONFIG_CMD_DS4510 define enables the ds4510 command. The additional CONFIG_DS4510_INFO, CONFIG_DS4510_MEM, and CONFIG_DS4510_RST defines add additional sub-commands to the ds4510 command when defined.

---
 README                |    4 +
 drivers/misc/Makefile |    1 +
 drivers/misc/ds4510.c |  400 +++++++++++++++++++++++++++++++++++++++++++++++++
 include/gpio/ds4510.h |   75 +++++++++
 4 files changed, 480 insertions(+), 0 deletions(-)
 create mode 100644 drivers/misc/ds4510.c
 create mode 100644 include/gpio/ds4510.h
README +4 -0
index bca8061..cea057d 100644
@@ -574,6 +574,10 @@ The following options need to be configured:
 		CONFIG_CMD_DHCP		* DHCP support
 		CONFIG_CMD_DIAG		* Diagnostics
 		CONFIG_CMD_DOC		* Disk-On-Chip Support
+		CONFIG_CMD_DS4510	* ds4510 I2C gpio commands
+		CONFIG_CMD_DS4510_INFO	* ds4510 I2C info command
+		CONFIG_CMD_DS4510_MEM	* ds4510 I2C eeprom/sram commansd
+		CONFIG_CMD_DS4510_RST	* ds4510 I2C rst command
 		CONFIG_CMD_DTT		* Digital Therm and Thermostat
 		CONFIG_CMD_ECHO		  echo arguments
 		CONFIG_CMD_EEPROM	* EEPROM read/write support
drivers/misc/Makefile +1 -0
index 01e0f39..ea2bf87 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB	:= $(obj)libmisc.a
 
 COBJS-$(CONFIG_ALI152X) += ali512x.o
+COBJS-$(CONFIG_DS4510)  += ds4510.o
 COBJS-$(CONFIG_FSL_LAW) += fsl_law.o
 COBJS-$(CONFIG_NS87308) += ns87308.o
 COBJS-$(CONFIG_STATUS_LED) += status_led.o
drivers/misc/ds4510.c new file +400 -0

400 lines not on this page · raw message

include/gpio/ds4510.h new file +75 -0

75 lines not on this page · raw message

Signature · 1 line
1.6.0.2.GIT
#3 lore raw

PATCH v3 3/3 XPedite5370 board support

Initial support for Extreme Engineering Solutions XPedite5370 - a MPC8572-based 3U VPX single board computer with a PMC/XMC site.

---
 MAINTAINERS                         |    3 +
 MAKEALL                             |    1 +
 Makefile                            |    3 +
 board/xes/common/Makefile           |   56 ++++
 board/xes/common/fsl_8572_clk.c     |   51 +++
 board/xes/common/fsl_85xx_ddr.c     |   93 ++++++
 board/xes/common/fsl_85xx_pci.c     |  265 ++++++++++++++++
 board/xes/xpedite5370/Makefile      |   45 +++
 board/xes/xpedite5370/config.mk     |   35 ++
 board/xes/xpedite5370/ddr.c         |  270 ++++++++++++++++
 board/xes/xpedite5370/law.c         |   54 ++++
 board/xes/xpedite5370/tlb.c         |   94 ++++++
 board/xes/xpedite5370/u-boot.lds    |  145 +++++++++
 board/xes/xpedite5370/xpedite5370.c |  128 ++++++++
 include/configs/XPEDITE5370.h       |  590 +++++++++++++++++++++++++++++++++++
 15 files changed, 1833 insertions(+), 0 deletions(-)
 create mode 100644 board/xes/common/Makefile
 create mode 100644 board/xes/common/fsl_8572_clk.c
 create mode 100644 board/xes/common/fsl_85xx_ddr.c
 create mode 100644 board/xes/common/fsl_85xx_pci.c
 create mode 100644 board/xes/xpedite5370/Makefile
 create mode 100644 board/xes/xpedite5370/config.mk
 create mode 100644 board/xes/xpedite5370/ddr.c
 create mode 100644 board/xes/xpedite5370/law.c
 create mode 100644 board/xes/xpedite5370/tlb.c
 create mode 100644 board/xes/xpedite5370/u-boot.lds
 create mode 100644 board/xes/xpedite5370/xpedite5370.c
 create mode 100644 include/configs/XPEDITE5370.h
MAINTAINERS +3 -0
index 127604b..ee98824 100644
@@ -411,6 +411,9 @@ Rune Torgersen <[email protected]>
 
 	MPC8266ADS	MPC8266
 
+Peter Tyser <[email protected]>
+
+	XPEDITE5370	MPC8572
 
 David Updegraff <[email protected]>
 
MAKEALL +1 -0
index dbed268..1328514 100755
@@ -376,6 +376,7 @@ LIST_85xx="		\
 	TQM8548		\
 	TQM8555		\
 	TQM8560		\
+	XPEDITE5370	\
 "
 
 #########################################################################
Makefile +3 -0
index 0c5dd61..ae3ec22 100644
@@ -2454,6 +2454,9 @@ TQM8560_config:		unconfig
 	echo "#define CONFIG_BOARDNAME \"TQM$${CTYPE}\"">>$(obj)include/config.h;
 	@$(MKCONFIG) -a TQM85xx ppc mpc85xx tqm85xx tqc
 
+XPEDITE5370_config:	unconfig
+	@$(MKCONFIG) $(@:_config=) ppc mpc85xx xpedite5370 xes
+
 #########################################################################
 ## MPC86xx Systems
 #########################################################################
board/xes/common/Makefile new file +56 -0

56 lines not on this page · raw message

board/xes/common/fsl_8572_clk.c new file +51 -0

51 lines not on this page · raw message

board/xes/common/fsl_85xx_ddr.c new file +93 -0

93 lines not on this page · raw message

board/xes/common/fsl_85xx_pci.c new file +265 -0

265 lines not on this page · raw message

board/xes/xpedite5370/Makefile new file +45 -0

45 lines not on this page · raw message

board/xes/xpedite5370/config.mk new file +35 -0
new file mode 100644
index 0000000..39469b2
@@ -0,0 +1,35 @@
+#
+# Copyright 2008 Extreme Engineering Solutions, Inc.
+# Copyright 2007-2008 Freescale Semiconductor, Inc.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+#
+# xpedite5370 board
+#
+ifndef TEXT_BASE
+TEXT_BASE = 0xfff80000
+endif
+
+PLATFORM_RELFLAGS += -mrelocatable
+
+PLATFORM_CPPFLAGS += -DCONFIG_E500=1
+PLATFORM_CPPFLAGS += -DCONFIG_MPC85xx=1
+PLATFORM_CPPFLAGS += -DCONFIG_MPC8572=1
board/xes/xpedite5370/ddr.c new file +270 -0

270 lines not on this page · raw message

board/xes/xpedite5370/law.c new file +54 -0

54 lines not on this page · raw message

board/xes/xpedite5370/tlb.c new file +94 -0

94 lines not on this page · raw message

board/xes/xpedite5370/u-boot.lds new file +145 -0

145 lines not on this page · raw message

board/xes/xpedite5370/xpedite5370.c new file +128 -0

128 lines not on this page · raw message

include/configs/XPEDITE5370.h new file +590 -0

590 lines not on this page · raw message

Signature · 1 line
1.6.0.2.GIT