From patchwork Thu Nov 13 07:30:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Jiang X-Patchwork-Id: 409888 X-Patchwork-Delegate: hs@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C9CA11400AB for ; Wed, 12 Nov 2014 19:08:39 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 652704B5F5; Wed, 12 Nov 2014 09:08:38 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xpkB8ARzTNcD; Wed, 12 Nov 2014 09:08:38 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E56504B6EE; Wed, 12 Nov 2014 09:08:37 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BD2FC4B839 for ; Wed, 12 Nov 2014 09:08:33 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id koc0kdEcuSqF for ; Wed, 12 Nov 2014 09:08:33 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0095.outbound.protection.outlook.com [207.46.100.95]) by theia.denx.de (Postfix) with ESMTPS id B9BF24B836 for ; Wed, 12 Nov 2014 09:08:29 +0100 (CET) Received: from BN3PR0301CA0073.namprd03.prod.outlook.com (25.160.152.169) by BY2PR03MB1013.namprd03.prod.outlook.com (10.242.238.23) with Microsoft SMTP Server (TLS) id 15.1.11.14; Wed, 12 Nov 2014 07:34:24 +0000 Received: from BY2FFO11FD046.protection.gbl (2a01:111:f400:7c0c::181) by BN3PR0301CA0073.outlook.office365.com (2a01:111:e400:401e::41) with Microsoft SMTP Server (TLS) id 15.1.16.15 via Frontend Transport; Wed, 12 Nov 2014 07:34:23 +0000 Received: from nwd2mta2.analog.com (137.71.25.57) by BY2FFO11FD046.mail.protection.outlook.com (10.1.15.170) with Microsoft SMTP Server (TLS) id 15.1.6.13 via Frontend Transport; Wed, 12 Nov 2014 07:34:22 +0000 Received: from NWD2HUBCAS9.ad.analog.com (nwd2hubcas9.ad.analog.com [10.64.72.142]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id sACATA9u014565 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 12 Nov 2014 05:29:10 -0500 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS9.ad.analog.com (10.64.72.142) with Microsoft SMTP Server id 14.3.210.2; Wed, 12 Nov 2014 02:33:22 -0500 Received: from linux.site ([10.99.22.20]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id sAC7XKif029984; Wed, 12 Nov 2014 02:33:21 -0500 Received: from localhost.localdomain (unknown [10.99.24.124]) by linux.site (Postfix) with ESMTP id 273E73AEBE2E; Tue, 11 Nov 2014 16:34:33 -0700 (MST) From: Scott Jiang To: Date: Thu, 13 Nov 2014 15:30:55 +0800 Message-ID: <1415863855-26993-3-git-send-email-scott.jiang.linux@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1415863855-26993-1-git-send-email-scott.jiang.linux@gmail.com> References: <1415863855-26993-1-git-send-email-scott.jiang.linux@gmail.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 130602512633903950; (52f37747-95c3-483a-bd05-08d153b03fac); () X-Forefront-Antispam-Report: CIP:137.71.25.57; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(62966003)(77156002)(50226001)(76176999)(105596002)(76482003)(4396001)(31966008)(2351001)(50986999)(83322999)(99396003)(120916001)(106466001)(87572001)(82202001)(229853001)(81442002)(73972006)(20776003)(102836001)(47776003)(107046002)(36756003)(95666004)(87936001)(104166001)(64706001)(55446002)(50466002)(46102003)(87286001)(49486002)(48376002)(61266001)(73392002)(93916002)(88136002)(92566001)(110136001)(19580395003)(6806004)(19580405001)(44976005)(89996001)(92726001)(86362001)(33646002)(21056001)(575784001)(49496007); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR03MB1013; H:nwd2mta2.analog.com; FPR:; MLV:sfv; PTR:nwd2mail11.analog.com; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB1013; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA: BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB1013; X-Forefront-PRVS: 03932714EB Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 137.71.25.57 as permitted sender) Authentication-Results: spf=softfail (sender IP is 137.71.25.57) smtp.mailfrom=scott.jiang.linux@gmail.com; X-Exchange-Antispam-Report-CFA: BCL:0; PCL:0; RULEID:(402001)(401002)(400003); SRVR:BY2PR03MB1013; Cc: adi-u-boot-devel@lists.sourceforge.net Subject: [U-Boot] [PATCH 3/3 v2] blackfin: convert to use CONFIG_SYS_I2C framework X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Scott Jiang --- drivers/i2c/adi_i2c.c | 202 +++++++++++------------------------ include/configs/bct-brettl2.h | 2 +- include/configs/bf518f-ezbrd.h | 2 +- include/configs/bf526-ezbrd.h | 2 +- include/configs/bf527-ad7160-eval.h | 2 +- include/configs/bf527-ezkit.h | 2 +- include/configs/bf527-sdp.h | 2 +- include/configs/bf537-minotaur.h | 2 +- include/configs/bf537-pnav.h | 2 +- include/configs/bf537-srv1.h | 2 +- include/configs/bf537-stamp.h | 2 +- include/configs/bf538f-ezkit.h | 2 +- include/configs/bf548-ezkit.h | 2 +- include/configs/bf609-ezkit.h | 2 +- include/configs/bfin_adi_common.h | 4 +- include/configs/br4.h | 2 +- include/configs/cm-bf527.h | 2 +- include/configs/cm-bf537e.h | 2 +- include/configs/cm-bf537u.h | 2 +- include/configs/cm-bf548.h | 2 +- include/configs/pr1.h | 2 +- include/configs/tcm-bf518.h | 2 +- include/configs/tcm-bf537.h | 2 +- 23 files changed, 83 insertions(+), 165 deletions(-) diff --git a/drivers/i2c/adi_i2c.c b/drivers/i2c/adi_i2c.c index 71077c5..20495b1 100644 --- a/drivers/i2c/adi_i2c.c +++ b/drivers/i2c/adi_i2c.c @@ -13,6 +13,8 @@ #include #include +static struct twi_regs *i2c_get_base(struct i2c_adapter *adap); + /* Every register is 32bit aligned, but only 16bits in size */ #define ureg(name) u16 name; u16 __pad_##name; struct twi_regs { @@ -36,25 +38,12 @@ struct twi_regs { }; #undef ureg -/* U-Boot I2C framework allows only one active device at a time. */ #ifdef TWI_CLKDIV #define TWI0_CLKDIV TWI_CLKDIV -#endif -static struct twi_regs *twi = (void *)TWI0_CLKDIV; - -#ifdef DEBUG -# define dmemset(s, c, n) memset(s, c, n) -#else -# define dmemset(s, c, n) -#endif -#define debugi(fmt, args...) \ - debug( \ - "MSTAT:0x%03x FSTAT:0x%x ISTAT:0x%02x\t%-20s:%-3i: " fmt "\n", \ - twi->master_stat, twi->fifo_stat, twi->int_stat, \ - __func__, __LINE__, ## args) - -#ifdef CONFIG_TWICLK_KHZ -# error do not define CONFIG_TWICLK_KHZ ... use CONFIG_SYS_I2C_SPEED +# ifdef CONFIG_SYS_MAX_I2C_BUS +# undef CONFIG_SYS_MAX_I2C_BUS +# endif +#define CONFIG_SYS_MAX_I2C_BUS 1 #endif /* @@ -70,7 +59,7 @@ static struct twi_regs *twi = (void *)TWI0_CLKDIV; #define SYS_I2C_DUTY I2C_SPEED_TO_DUTY(CONFIG_SYS_I2C_SPEED) /* Note: duty is inverse of speed, so the comparisons below are correct */ #if SYS_I2C_DUTY < I2C_DUTY_MAX || SYS_I2C_DUTY > I2C_DUTY_MIN -# error "The Blackfin I2C hardware can only operate 20KHz - 400KHz" +# error "The I2C hardware can only operate 20KHz - 400KHz" #endif /* All transfers are described by this data structure */ @@ -92,7 +81,7 @@ struct i2c_msg { * wait_for_completion - manage the actual i2c transfer * @msg: the i2c msg */ -static int wait_for_completion(struct i2c_msg *msg) +static int wait_for_completion(struct twi_regs *twi, struct i2c_msg *msg) { u16 int_stat, ctl; ulong timebase = get_timer(0); @@ -101,7 +90,6 @@ static int wait_for_completion(struct i2c_msg *msg) int_stat = readw(&twi->int_stat); if (int_stat & XMTSERV) { - debugi("processing XMTSERV"); writew(XMTSERV, &twi->int_stat); if (msg->alen) { writew(*(msg->abuf++), &twi->xmt_data8); @@ -119,7 +107,6 @@ static int wait_for_completion(struct i2c_msg *msg) } } if (int_stat & RCVSERV) { - debugi("processing RCVSERV"); writew(RCVSERV, &twi->int_stat); if (msg->len) { *(msg->buf++) = readw(&twi->rcv_data8); @@ -130,12 +117,10 @@ static int wait_for_completion(struct i2c_msg *msg) } } if (int_stat & MERR) { - debugi("processing MERR"); writew(MERR, &twi->int_stat); return msg->len; } if (int_stat & MCOMP) { - debugi("processing MCOMP"); writew(MCOMP, &twi->int_stat); if (msg->flags & I2C_M_COMBO && msg->len) { ctl = readw(&twi->master_ctl); @@ -155,16 +140,10 @@ static int wait_for_completion(struct i2c_msg *msg) return msg->len; } -/** - * i2c_transfer - setup an i2c transfer - * @return: 0 if things worked, non-0 if things failed - * - * Here we just get the i2c stuff all prepped and ready, and then tail off - * into wait_for_completion() for all the bits to go. - */ -static int i2c_transfer(uchar chip, uint addr, int alen, uchar *buffer, - int len, u8 flags) +static int i2c_transfer(struct i2c_adapter *adap, uint8_t chip, uint addr, + int alen, uint8_t *buffer, int len, uint8_t flags) { + struct twi_regs *twi = i2c_get_base(adap); int ret; u16 ctl; uchar addr_buffer[] = { @@ -180,12 +159,6 @@ static int i2c_transfer(uchar chip, uint addr, int alen, uchar *buffer, .alen = alen, }; - dmemset(buffer, 0xff, len); - debugi("chip=0x%x addr=0x%02x alen=%i buf[0]=0x%02x len=%i ", - chip, addr, alen, buffer[0], len); - debugi("flags=0x%02x[%s] ", flags, - (flags & I2C_M_READ ? "rd" : "wr")); - /* wait for things to settle */ while (readw(&twi->master_stat) & BUSBUSY) if (ctrlc()) @@ -201,11 +174,9 @@ static int i2c_transfer(uchar chip, uint addr, int alen, uchar *buffer, /* prime the pump */ if (msg.alen) { len = (msg.flags & I2C_M_COMBO) ? msg.alen : msg.alen + len; - debugi("first byte=0x%02x", *msg.abuf); writew(*(msg.abuf++), &twi->xmt_data8); --msg.alen; } else if (!(msg.flags & I2C_M_READ) && msg.len) { - debugi("first byte=0x%02x", *msg.buf); writew(*(msg.buf++), &twi->xmt_data8); --msg.len; } @@ -222,8 +193,7 @@ static int i2c_transfer(uchar chip, uint addr, int alen, uchar *buffer, writew(ctl, &twi->master_ctl); /* process the rest */ - ret = wait_for_completion(&msg); - debugi("ret=%d", ret); + ret = wait_for_completion(twi, &msg); if (ret) { ctl = readw(&twi->master_ctl) & ~MEN; @@ -237,12 +207,9 @@ static int i2c_transfer(uchar chip, uint addr, int alen, uchar *buffer, return ret; } -/** - * i2c_set_bus_speed - set i2c bus speed - * @speed: bus speed (in HZ) - */ -int i2c_set_bus_speed(unsigned int speed) +static uint adi_i2c_setspeed(struct i2c_adapter *adap, uint speed) { + struct twi_regs *twi = i2c_get_base(adap); u16 clkdiv = I2C_SPEED_TO_DUTY(speed); /* Set TWI interface clock */ @@ -257,28 +224,10 @@ int i2c_set_bus_speed(unsigned int speed) return 0; } -/** - * i2c_get_bus_speed - get i2c bus speed - * @speed: bus speed (in HZ) - */ -unsigned int i2c_get_bus_speed(void) -{ - u16 clkdiv = readw(&twi->clkdiv) & 0xff; - /* 10 MHz / (2 * CLKDIV) -> 5 MHz / CLKDIV */ - return 5000000 / clkdiv; -} - -/** - * i2c_init - initialize the i2c bus - * @speed: bus speed (in HZ) - * @slaveaddr: address of device in slave mode (0 - not slave) - * - * Slave mode isn't actually implemented. It'll stay that way until - * we get a real request for it. - */ -void i2c_init(int speed, int slaveaddr) +static void adi_i2c_init(struct i2c_adapter *adap, int speed, int slaveaddr) { - uint8_t prescale = ((get_i2c_clk() / 1000 / 1000 + 5) / 10) & 0x7F; + struct twi_regs *twi = i2c_get_base(adap); + u16 prescale = ((get_i2c_clk() / 1000 / 1000 + 5) / 10) & 0x7F; /* Set TWI internal clock as 10MHz */ writew(prescale, &twi->control); @@ -288,100 +237,69 @@ void i2c_init(int speed, int slaveaddr) /* Enable it */ writew(TWI_ENA | prescale, &twi->control); - - debugi("CONTROL:0x%04x CLKDIV:0x%04x", readw(&twi->control), - readw(&twi->clkdiv)); - -#if CONFIG_SYS_I2C_SLAVE -# error I2C slave support not tested/supported -#endif } -/** - * i2c_probe - test if a chip exists at a given i2c address - * @chip: i2c chip addr to search for - * @return: 0 if found, non-0 if not found - */ -int i2c_probe(uchar chip) +static int adi_i2c_read(struct i2c_adapter *adap, uint8_t chip, + uint addr, int alen, uint8_t *buffer, int len) { - u8 byte; - return i2c_read(chip, 0, 0, &byte, 1); + return i2c_transfer(adap, chip, addr, alen, buffer, + len, alen ? I2C_M_COMBO : I2C_M_READ); } -/** - * i2c_read - read data from an i2c device - * @chip: i2c chip addr - * @addr: memory (register) address in the chip - * @alen: byte size of address - * @buffer: buffer to store data read from chip - * @len: how many bytes to read - * @return: 0 on success, non-0 on failure - */ -int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len) +static int adi_i2c_write(struct i2c_adapter *adap, uint8_t chip, + uint addr, int alen, uint8_t *buffer, int len) { - return i2c_transfer(chip, addr, alen, buffer, - len, (alen ? I2C_M_COMBO : I2C_M_READ)); + return i2c_transfer(adap, chip, addr, alen, buffer, len, 0); } -/** - * i2c_write - write data to an i2c device - * @chip: i2c chip addr - * @addr: memory (register) address in the chip - * @alen: byte size of address - * @buffer: buffer holding data to write to chip - * @len: how many bytes to write - * @return: 0 on success, non-0 on failure - */ -int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len) +static int adi_i2c_probe(struct i2c_adapter *adap, uint8_t chip) { - return i2c_transfer(chip, addr, alen, buffer, len, 0); + u8 byte; + return adi_i2c_read(adap, chip, 0, 0, &byte, 1); } -/** - * i2c_set_bus_num - change active I2C bus - * @bus: bus index, zero based - * @returns: 0 on success, non-0 on failure - */ -int i2c_set_bus_num(unsigned int bus) +static struct twi_regs *i2c_get_base(struct i2c_adapter *adap) { - switch (bus) { -#if CONFIG_SYS_MAX_I2C_BUS > 0 - case 0: - twi = (void *)TWI0_CLKDIV; - return 0; + switch (adap->hwadapnr) { +#if CONFIG_SYS_MAX_I2C_BUS > 2 + case 2: + return (struct twi_regs *)TWI2_CLKDIV; #endif #if CONFIG_SYS_MAX_I2C_BUS > 1 case 1: - twi = (void *)TWI1_CLKDIV; - return 0; -#endif -#if CONFIG_SYS_MAX_I2C_BUS > 2 - case 2: - twi = (void *)TWI2_CLKDIV; - return 0; + return (struct twi_regs *)TWI1_CLKDIV; #endif - default: return -1; + case 0: + return (struct twi_regs *)TWI0_CLKDIV; + + default: + printf("wrong hwadapnr: %d\n", adap->hwadapnr); } + + return NULL; } -/** - * i2c_get_bus_num - returns index of active I2C bus - */ -unsigned int i2c_get_bus_num(void) -{ - switch ((unsigned long)twi) { -#if CONFIG_SYS_MAX_I2C_BUS > 0 - case TWI0_CLKDIV: - return 0; -#endif +U_BOOT_I2C_ADAP_COMPLETE(adi_i2c0, adi_i2c_init, adi_i2c_probe, + adi_i2c_read, adi_i2c_write, + adi_i2c_setspeed, + CONFIG_SYS_I2C_SPEED, + 0, + 0) + #if CONFIG_SYS_MAX_I2C_BUS > 1 - case TWI1_CLKDIV: - return 1; +U_BOOT_I2C_ADAP_COMPLETE(adi_i2c1, adi_i2c_init, adi_i2c_probe, + adi_i2c_read, adi_i2c_write, + adi_i2c_setspeed, + CONFIG_SYS_I2C_SPEED, + 0, + 1) #endif + #if CONFIG_SYS_MAX_I2C_BUS > 2 - case TWI2_CLKDIV: - return 2; +U_BOOT_I2C_ADAP_COMPLETE(adi_i2c2, adi_i2c_init, adi_i2c_probe, + adi_i2c_read, adi_i2c_write, + adi_i2c_setspeed, + CONFIG_SYS_I2C_SPEED, + 0, + 2) #endif - default: return -1; - } -} diff --git a/include/configs/bct-brettl2.h b/include/configs/bct-brettl2.h index f0b74d8..39982ef 100644 --- a/include/configs/bct-brettl2.h +++ b/include/configs/bct-brettl2.h @@ -122,8 +122,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/bf518f-ezbrd.h b/include/configs/bf518f-ezbrd.h index 4df51b9..50e85ca 100644 --- a/include/configs/bf518f-ezbrd.h +++ b/include/configs/bf518f-ezbrd.h @@ -134,8 +134,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/bf526-ezbrd.h b/include/configs/bf526-ezbrd.h index 55bfbbe..7fc882a 100644 --- a/include/configs/bf526-ezbrd.h +++ b/include/configs/bf526-ezbrd.h @@ -131,8 +131,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/bf527-ad7160-eval.h b/include/configs/bf527-ad7160-eval.h index 589c7a5..c2958e8 100644 --- a/include/configs/bf527-ad7160-eval.h +++ b/include/configs/bf527-ad7160-eval.h @@ -119,8 +119,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/bf527-ezkit.h b/include/configs/bf527-ezkit.h index 0e68952..79e440a 100644 --- a/include/configs/bf527-ezkit.h +++ b/include/configs/bf527-ezkit.h @@ -134,8 +134,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/bf527-sdp.h b/include/configs/bf527-sdp.h index a3ad7ae..b374ab5 100644 --- a/include/configs/bf527-sdp.h +++ b/include/configs/bf527-sdp.h @@ -103,8 +103,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/bf537-minotaur.h b/include/configs/bf537-minotaur.h index d94c2df..6df89af 100644 --- a/include/configs/bf537-minotaur.h +++ b/include/configs/bf537-minotaur.h @@ -121,8 +121,8 @@ /* * I2C settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 #define CONFIG_SYS_I2C_SPEED 50000 #define CONFIG_SYS_I2C_SLAVE 0 diff --git a/include/configs/bf537-pnav.h b/include/configs/bf537-pnav.h index 6c9a907..4f2b2cb 100644 --- a/include/configs/bf537-pnav.h +++ b/include/configs/bf537-pnav.h @@ -142,8 +142,8 @@ /* * I2C settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/bf537-srv1.h b/include/configs/bf537-srv1.h index a6ceffa..d01d88f 100644 --- a/include/configs/bf537-srv1.h +++ b/include/configs/bf537-srv1.h @@ -120,8 +120,8 @@ /* * I2C settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 #define CONFIG_SYS_I2C_SPEED 50000 #define CONFIG_SYS_I2C_SLAVE 0 diff --git a/include/configs/bf537-stamp.h b/include/configs/bf537-stamp.h index 7ab644f..7b5a5a7 100644 --- a/include/configs/bf537-stamp.h +++ b/include/configs/bf537-stamp.h @@ -128,8 +128,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/bf538f-ezkit.h b/include/configs/bf538f-ezkit.h index 743e193..e60558e 100644 --- a/include/configs/bf538f-ezkit.h +++ b/include/configs/bf538f-ezkit.h @@ -126,8 +126,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/bf548-ezkit.h b/include/configs/bf548-ezkit.h index 6b29d08..e71e6d3 100644 --- a/include/configs/bf548-ezkit.h +++ b/include/configs/bf548-ezkit.h @@ -134,8 +134,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/bf609-ezkit.h b/include/configs/bf609-ezkit.h index f02e155..878009f 100644 --- a/include/configs/bf609-ezkit.h +++ b/include/configs/bf609-ezkit.h @@ -81,8 +81,8 @@ #define CONFIG_PHYLIB /* i2c Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C /* * Flash Settings diff --git a/include/configs/bfin_adi_common.h b/include/configs/bfin_adi_common.h index ea9acf6..d75fc7b 100644 --- a/include/configs/bfin_adi_common.h +++ b/include/configs/bfin_adi_common.h @@ -72,7 +72,7 @@ # ifdef CONFIG_SPI_FLASH # define CONFIG_CMD_SF # endif -# if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C_SOFT) +# if defined(CONFIG_SYS_I2C) || defined(CONFIG_SYS_I2C_SOFT) # define CONFIG_CMD_I2C # define CONFIG_SOFT_I2C_READ_REPEATED_START # endif @@ -300,7 +300,7 @@ /* * I2C Settings */ -#if defined(CONFIG_HARD_I2C) || defined(CONFIG_SYS_I2C_SOFT) +#if defined(CONFIG_SYS_I2C) || defined(CONFIG_SYS_I2C_SOFT) # ifndef CONFIG_SYS_I2C_SPEED # define CONFIG_SYS_I2C_SPEED 50000 # endif diff --git a/include/configs/br4.h b/include/configs/br4.h index 13e939f..48cf184 100644 --- a/include/configs/br4.h +++ b/include/configs/br4.h @@ -102,8 +102,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C /* diff --git a/include/configs/cm-bf527.h b/include/configs/cm-bf527.h index 3668903..643c837 100644 --- a/include/configs/cm-bf527.h +++ b/include/configs/cm-bf527.h @@ -113,8 +113,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/cm-bf537e.h b/include/configs/cm-bf537e.h index 85f5341..e059568 100644 --- a/include/configs/cm-bf537e.h +++ b/include/configs/cm-bf537e.h @@ -122,8 +122,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/cm-bf537u.h b/include/configs/cm-bf537u.h index 5dffd1b..1f26457 100644 --- a/include/configs/cm-bf537u.h +++ b/include/configs/cm-bf537u.h @@ -120,8 +120,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/cm-bf548.h b/include/configs/cm-bf548.h index 13ea067..72eafc5 100644 --- a/include/configs/cm-bf548.h +++ b/include/configs/cm-bf548.h @@ -104,8 +104,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/pr1.h b/include/configs/pr1.h index eb18d6d..13fb675 100644 --- a/include/configs/pr1.h +++ b/include/configs/pr1.h @@ -102,8 +102,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C /* diff --git a/include/configs/tcm-bf518.h b/include/configs/tcm-bf518.h index e9bff83..e96a742 100644 --- a/include/configs/tcm-bf518.h +++ b/include/configs/tcm-bf518.h @@ -103,8 +103,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /* diff --git a/include/configs/tcm-bf537.h b/include/configs/tcm-bf537.h index caf8847..42129fb 100644 --- a/include/configs/tcm-bf537.h +++ b/include/configs/tcm-bf537.h @@ -122,8 +122,8 @@ /* * I2C Settings */ +#define CONFIG_SYS_I2C #define CONFIG_SYS_I2C_ADI -#define CONFIG_HARD_I2C 1 /*