Skip to contentSkip to conversation

IMX6: Add Gateworks Ventana support

PATCH Superseded Tim Harvey 1 participant 3 messages Feb 5, 2014

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Tim Harvey

author
#0 lore raw

v3 cover IMX6: Add Gateworks Ventana support

Changes in v3:
- update README fixing typo and removing Freescale document link
- use debug() instead of printf()
- be more explicit with hwmon error output and use macro for min/max percent
- use #defines for GSC slave address and registers
- remove extern from function prototype
- moved gpio config into structure for better readability
- use enum for eeprom bit configs and array to map to fdt property alias
- add SATA regardless of cpu type
- add FIT support regardless of flash type
- display PMIC and device id in misc_init_r() instead of pmic driver

Changes in v2:
- rebase on top of u-boot-imx
- use switch..case for model specific init instead of strcmps
- move checkboard to late init allowing i2c_setup to be moved to board_init() eeprom reading to be done after relocation, and move eeprom struct from data segment
- move SPI/I2C init to board_init()
- update README
- remove unnecessary console overwrite function
- fix multiline comment style and eliminate >80 char lines
- eliminate unnecessary loop in board_mmc_init()
- add missing copyright to clocks.cfg
- avoid duplicating cfg files where no changes exist
- added missing SPDX header to ventana_eeprom.h
- use puts() instead of printf() for constant strings
- remove messages regarding /dev/i2c-<n>
- use get_ram_size() for determing ram_size
- cleanup gpio configuration using tables for baseboard pinmux combinations
- remove phy init errata as it doesn't pertain to use case
(it is for 802.3az which IMX6 MAC does not support)
- added pfuze100_pmic driver using PMIC API
- moved GSC code (gsc command and i2c_read/i2c_write wrappers into own file)
- allow user to quiet down some of the data displayed
- remove display support for now - will revisit later
- remove display of boot mode info - may revisit later
- replace bitwise fields in eeprom structure with bit definitions

Tim Harvey (2):
power: add PFUZE100 PMIC driver
ventana: Add Gateworks Ventana family support

 board/gateworks/gw_ventana/Makefile         |   10 +
 board/gateworks/gw_ventana/README           |   55 ++
 board/gateworks/gw_ventana/clocks.cfg       |   42 +
 board/gateworks/gw_ventana/gsc.c            |  129 +++
 board/gateworks/gw_ventana/gsc.h            |   30 +
 board/gateworks/gw_ventana/gw_ventana.c     | 1240 +++++++++++++++++++++++++++
 board/gateworks/gw_ventana/gw_ventana.cfg   |   42 +
 board/gateworks/gw_ventana/ventana_eeprom.h |  106 +++
 boards.cfg                                  |    5 +
 drivers/power/pmic/Makefile                 |    1 +
 drivers/power/pmic/pmic_pfuze100.c          |   33 +
 include/configs/gw_ventana.h                |  415 +++++++++
 include/power/pfuze100_pmic.h               |   96 +++
 13 files changed, 2204 insertions(+)
 create mode 100644 board/gateworks/gw_ventana/Makefile
 create mode 100644 board/gateworks/gw_ventana/README
 create mode 100644 board/gateworks/gw_ventana/clocks.cfg
 create mode 100644 board/gateworks/gw_ventana/gsc.c
 create mode 100644 board/gateworks/gw_ventana/gsc.h
 create mode 100644 board/gateworks/gw_ventana/gw_ventana.c
 create mode 100644 board/gateworks/gw_ventana/gw_ventana.cfg
 create mode 100644 board/gateworks/gw_ventana/ventana_eeprom.h
 create mode 100644 drivers/power/pmic/pmic_pfuze100.c
 create mode 100644 include/configs/gw_ventana.h
 create mode 100644 include/power/pfuze100_pmic.h
Signature · 1 line
1.8.3.2
author
#1 lore raw

PATCH v3 1/2 power: add PFUZE100 PMIC driver

Cc Stefano Babic <sbabic <at> denx.de>

---
Changes in v2:
- remove detect and device_id display from pmic_init()

 drivers/power/pmic/Makefile        |  1 +
 drivers/power/pmic/pmic_pfuze100.c | 33 +++++++++++++
 include/power/pfuze100_pmic.h      | 96 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 130 insertions(+)
 create mode 100644 drivers/power/pmic/pmic_pfuze100.c
 create mode 100644 include/power/pfuze100_pmic.h
drivers/power/pmic/Makefile +1 -0
index 0b45ffa..4129bda 100644
@@ -9,5 +9,6 @@ obj-$(CONFIG_POWER_MAX8998) += pmic_max8998.o
 obj-$(CONFIG_POWER_MAX8997) += pmic_max8997.o
 obj-$(CONFIG_POWER_MUIC_MAX8997) += muic_max8997.o
 obj-$(CONFIG_POWER_MAX77686) += pmic_max77686.o
+obj-$(CONFIG_POWER_PFUZE100) += pmic_pfuze100.o
 obj-$(CONFIG_POWER_TPS65217) += pmic_tps65217.o
 obj-$(CONFIG_POWER_TPS65910) += pmic_tps65910.o
drivers/power/pmic/pmic_pfuze100.c new file +33 -0
new file mode 100644
index 0000000..3962bb7
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2014 Gateworks Corporation
+ * Tim Harvey <[email protected]>
+ *
+ * SPDX-License-Identifier:      GPL-2.0+
+ */
+
+#include <common.h>
+#include <errno.h>
+#include <i2c.h>
+#include <power/pmic.h>
+#include <power/pfuze100_pmic.h>
+
+int pmic_init(unsigned char bus)
+{
+	static const char name[] = "PFUZE100_PMIC";
+	int ret;
+	struct pmic *p = pmic_alloc();
+
+	if (!p) {
+		printf("%s: POWER allocation error!\n", __func__);
+		return -ENOMEM;
+	}
+
+	p->name = name;
+	p->interface = PMIC_I2C;
+	p->number_of_regs = PMIC_NUM_OF_REGS;
+	p->hw.i2c.addr = CONFIG_POWER_PFUZE100_I2C_ADDR;
+	p->hw.i2c.tx_num = 1;
+	p->bus = bus;
+
+	return 0;
+}
include/power/pfuze100_pmic.h new file +96 -0

96 lines not on this page · raw message

Signature · 1 line
1.8.3.2
author
#2 lore raw

PATCH v3 2/2 ventana: Add Gateworks Ventana family support

In reply to Tim Harvey

Gateworks Ventana is a product family based on the i.MX6. This patch adds support for all boards in the Ventana family. Where possible, data from the boards EEPROM is used to determine various details about the board at runtime.

Cc Stefano Babic <sbabic <at> denx.de>

---

Changes in v3:
- update README fixing typo and removing Freescale document link
- use debug() instead of printf()
- be more explicit with hwmon error output and use macro for min/max percent
- use #defines for GSC slave address and registers
- remove extern from function prototype
- moved gpio config into structure for better readability
- use enum for eeprom bit configs and array to map to fdt property alias
- add SATA regardless of cpu type
- add FIT support regardless of flash type
- display PMIC and device id in misc_init_r() instead of pmic driver

Changes in v2:
- rebase on top of u-boot-imx
- use switch..case for model specific init instead of strcmps
- move checkboard to late init allowing i2c_setup to be moved to board_init() eeprom reading to be done after relocation, and move eeprom struct from data segment
- move SPI/I2C init to board_init()
- update README
- remove unnecessary console overwrite function
- fix multiline comment style and eliminate >80 char lines
- eliminate unnecessary loop in board_mmc_init()
- add missing copyright to clocks.cfg
- avoid duplicating cfg files where no changes exist
- added missing SPDX header to ventana_eeprom.h
- use puts() instead of printf() for constant strings
- remove messages regarding /dev/i2c-<n>
- use get_ram_size() for determing ram_size
- cleanup gpio configuration using tables for baseboard pinmux combinations
- remove phy init errata as it doesn't pertain to use case
(it is for 802.3az which IMX6 MAC does not support)
- added pfuze100_pmic driver using PMIC API
- moved GSC code (gsc command and i2c_read/i2c_write wrappers into own file)
- allow user to quiet down some of the data displayed
- remove display support for now - will revisit later
- remove display of boot mode info - may revisit later
- replace bitwise fields in eeprom structure with bit definitions

 board/gateworks/gw_ventana/Makefile         |   10 +
 board/gateworks/gw_ventana/README           |   55 ++
 board/gateworks/gw_ventana/clocks.cfg       |   42 +
 board/gateworks/gw_ventana/gsc.c            |  129 +++
 board/gateworks/gw_ventana/gsc.h            |   30 +
 board/gateworks/gw_ventana/gw_ventana.c     | 1240 +++++++++++++++++++++++++++
 board/gateworks/gw_ventana/gw_ventana.cfg   |   42 +
 board/gateworks/gw_ventana/ventana_eeprom.h |  106 +++
 boards.cfg                                  |    5 +
 include/configs/gw_ventana.h                |  415 +++++++++
 10 files changed, 2074 insertions(+)
 create mode 100644 board/gateworks/gw_ventana/Makefile
 create mode 100644 board/gateworks/gw_ventana/README
 create mode 100644 board/gateworks/gw_ventana/clocks.cfg
 create mode 100644 board/gateworks/gw_ventana/gsc.c
 create mode 100644 board/gateworks/gw_ventana/gsc.h
 create mode 100644 board/gateworks/gw_ventana/gw_ventana.c
 create mode 100644 board/gateworks/gw_ventana/gw_ventana.cfg
 create mode 100644 board/gateworks/gw_ventana/ventana_eeprom.h
 create mode 100644 include/configs/gw_ventana.h
board/gateworks/gw_ventana/Makefile new file +10 -0
new file mode 100644
index 0000000..e8dab89
@@ -0,0 +1,10 @@
+#
+# Copyright (C) 2012-2013, Guennadi Liakhovetski <[email protected]>
+# (C) Copyright 2012-2013 Freescale Semiconductor, Inc.
+# Copyright (C) 2013, Gateworks Corporation
+#
+# SPDX-License-Identifier:  GPL-2.0+
+#
+
+obj-y  := gw_ventana.o gsc.o
+
board/gateworks/gw_ventana/README new file +55 -0

55 lines not on this page · raw message

board/gateworks/gw_ventana/clocks.cfg new file +42 -0

42 lines not on this page · raw message

board/gateworks/gw_ventana/gsc.c new file +129 -0

129 lines not on this page · raw message

board/gateworks/gw_ventana/gsc.h new file +30 -0
new file mode 100644
index 0000000..5467209
@@ -0,0 +1,30 @@
+#ifndef __ASSEMBLY__
+
+/* i2c slave addresses */
+#define GSC_HWMON_ADDR		0x29
+#define GSC_EEPROM_ADDR		0x51
+
+/*
+ * Hardware Monitor
+ */
+#define GSC_HWMON_TEMP		0x00
+#define GSC_HWMON_VIN		0x02
+#define GSC_HWMON_VDD_3P3	0x05
+#define GSC_HWMON_VBATT		0x08
+#define GSC_HWMON_VDD_5P0	0x0b
+#define GSC_HWMON_VDD_CORE	0x0e
+#define GSC_HWMON_VDD_HIGH	0x14
+#define GSC_HWMON_VDD_DDR	0x17
+#define GSC_HWMON_VDD_SOC	0x11
+#define GSC_HWMON_VDD_1P8	0x1d
+#define GSC_HWMON_VDD_2P5	0x23
+#define GSC_HWMON_VDD_1P0	0x20
+
+/*
+ * I2C transactions to the GSC are done via these functions which
+ * perform retries in the case of a busy GSC NAK'ing the transaction
+ */
+int gsc_i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len);
+int gsc_i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len);
+#endif
+
board/gateworks/gw_ventana/gw_ventana.c new file +1240 -0

1,240 lines not on this page · raw message

board/gateworks/gw_ventana/gw_ventana.cfg new file +42 -0

42 lines not on this page · raw message

board/gateworks/gw_ventana/ventana_eeprom.h new file +106 -0

106 lines not on this page · raw message

boards.cfg +5 -0
index a8336cc..5f94558 100644
@@ -308,6 +308,11 @@ Active  arm         armv7          mx6         freescale       mx6qsabreauto
 Active  arm         armv7          mx6         freescale       mx6sabresd          mx6dlsabresd                         mx6sabresd:IMX_CONFIG=board/boundary/nitrogen6x/nitrogen6dl.cfg,MX6DL                                                             Fabio Estevam <[email protected]>
 Active  arm         armv7          mx6         freescale       mx6sabresd          mx6qsabresd                          mx6sabresd:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q                                                           Fabio Estevam <[email protected]>
 Active  arm         armv7          mx6         freescale       mx6slevk            mx6slevk                             mx6slevk:IMX_CONFIG=board/freescale/mx6slevk/imximage.cfg,MX6SL                                                                   Fabio Estevam <[email protected]>
+Active  arm         armv7          mx6         gateworks       gw_ventana          gwventanadl                          gw_ventana:IMX_CONFIG=board/gateworks/gw_ventana/gw_ventana.cfg,MX6DL,DDR_MB=512                                                  Tim Harvey <[email protected]>
+Active  arm         armv7          mx6         gateworks       gw_ventana          gwventanadl1g                        gw_ventana:IMX_CONFIG=board/gateworks/gw_ventana/gw_ventana.cfg,MX6DL,DDR_MB=1024                                                 Tim Harvey <[email protected]>
+Active  arm         armv7          mx6         gateworks       gw_ventana          gwventanaq                           gw_ventana:IMX_CONFIG=board/gateworks/gw_ventana/gw_ventana.cfg,MX6Q,DDR_MB=512                                                   Tim Harvey <[email protected]>
+Active  arm         armv7          mx6         gateworks       gw_ventana          gwventanaq1g                         gw_ventana:IMX_CONFIG=board/gateworks/gw_ventana/gw_ventana.cfg,MX6Q,DDR_MB=1024                                                  Tim Harvey <[email protected]>
+Active  arm         armv7          mx6         gateworks       gw_ventana          gwventanaq1gspi                      gw_ventana:IMX_CONFIG=board/gateworks/gw_ventana/gw_ventana.cfg,MX6Q,DDR_MB=1024,SPI_FLASH                                        Tim Harvey <[email protected]>
 Active  arm         armv7          mx6         barco           titanium            titanium                             titanium:IMX_CONFIG=board/barco/titanium/imximage.cfg                                                                         Stefan Roese <[email protected]>
 Active  arm         armv7          mx6         solidrun        hummingboard        hummingboard_solo                           hummingboard:IMX_CONFIG=board/solidrun/hummingboard/solo.cfg,MX6S,DDR_MB=512        Jon Nettleton <[email protected]>
 Active  arm         armv7          omap3       -               overo               omap3_overo                          -                                                                                                                                 Steve Sakoman <[email protected]>
include/configs/gw_ventana.h new file +415 -0

415 lines not on this page · raw message

Signature · 1 line
1.8.3.2