From: Renaud Barbier <renaud.barbier@ge.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/3] ppc: p2020rdb i2c support
Date: Wed, 22 Aug 2012 16:08:53 +0100 [thread overview]
Message-ID: <1345648133-31721-4-git-send-email-renaud.barbier@ge.com> (raw)
In-Reply-To: <1345648133-31721-1-git-send-email-renaud.barbier@ge.com>
Support for both i2c busses on the p2020rdb board is added and the
configuration file is updated to add the I2C driver and commands.
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
---
arch/ppc/boards/freescale-p2020rdb/p2020rdb.c | 20 +++++++++++++++++++-
arch/ppc/configs/p2020rdb_defconfig | 3 +++
2 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c b/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c
index 734fef9..f9bc946 100644
--- a/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c
+++ b/arch/ppc/boards/freescale-p2020rdb/p2020rdb.c
@@ -29,6 +29,7 @@
#include <partition.h>
#include <memory.h>
#include <asm/cache.h>
+#include <asm/fsl_i2c.h>
#include <asm/fsl_ddr_sdram.h>
#include <asm/fsl_law.h>
#include <mach/mpc85xx.h>
@@ -62,6 +63,19 @@
#define SYSCLK_50 50000000
#define SYSCLK_100 100000000
+/* I2C busses. */
+static struct fsl_i2c_plat i2c1plat = {
+ .bus_num = 0,
+ .slaveaddr = 0x7f,
+ .speed = 400000,
+};
+
+static struct fsl_i2c_plat i2c2plat = {
+ .bus_num = 1,
+ .slaveaddr = 0x7f,
+ .speed = 400000,
+};
+
/* Ethernet. Use eTSEC3 */
static struct gfar_info_struct gfar_info[] = {
{
@@ -71,11 +85,15 @@ static struct gfar_info_struct gfar_info[] = {
},
};
-
static int devices_init(void)
{
add_cfi_flash_device(DEVICE_ID_DYNAMIC, CFG_FLASH_BASE, 16 << 20, 0);
+ add_generic_device("fsl_i2c", DEVICE_ID_DYNAMIC, NULL, I2C1_BASE_ADDR,
+ 0x100, IORESOURCE_MEM, &i2c1plat);
+ add_generic_device("fsl_i2c", DEVICE_ID_DYNAMIC, NULL, I2C2_BASE_ADDR,
+ 0x100, IORESOURCE_MEM, &i2c2plat);
+
/* eTSEC3 */
fsl_eth_init(3, &gfar_info[0]);
diff --git a/arch/ppc/configs/p2020rdb_defconfig b/arch/ppc/configs/p2020rdb_defconfig
index d025a40..4a1a61f 100644
--- a/arch/ppc/configs/p2020rdb_defconfig
+++ b/arch/ppc/configs/p2020rdb_defconfig
@@ -27,3 +27,6 @@ CONFIG_NET_PING=y
CONFIG_NET_TFTP=y
CONFIG_PING=y
CONFIG_TFTP=y
+CONFIG_I2C=y
+CONFIG_I2C_FSL=y
+CONFIG_CMD_I2C=y
--
1.7.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2012-08-22 15:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 15:08 [PATCH 0/3] Freescale I2C driver Renaud Barbier
2012-08-22 15:08 ` [PATCH 1/3] mpc85xx: i2c frequency Renaud Barbier
2012-08-22 15:08 ` [PATCH 2/3] Freescale I2C driver Renaud Barbier
2012-08-28 9:19 ` Sascha Hauer
2012-08-29 13:59 ` Renaud Barbier
2012-08-29 14:01 ` Sascha Hauer
2012-08-22 15:08 ` Renaud Barbier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1345648133-31721-4-git-send-email-renaud.barbier@ge.com \
--to=renaud.barbier@ge.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox