From: Holger Brunck <holger.brunck@keymile.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 8/8] arm/km: update mgcoge3un board support
Date: Fri, 13 May 2011 16:12:19 +0200 [thread overview]
Message-ID: <4DCD3C43.7030901@keymile.com> (raw)
In-Reply-To: <F766E4F80769BD478052FB6533FA745D19FAC96475@SC-VEXCH4.marvell.com>
Hi Prafulla,
thanks for reviewing.
On 05/12/2011 01:01 PM, Prafulla Wadaskar wrote:
>
>
>> -----Original Message-----
>> From: Valentin Longchamp [mailto:valentin.longchamp at keymile.com]
>> Sent: Wednesday, May 04, 2011 9:24 PM
>> To: u-boot at lists.denx.de
>> Cc: holger.brunck at keymile.com; Prafulla Wadaskar; Valentin Longchamp;
>> Wolfgang Denk; Detlev Zundel
>> Subject: [PATCH v3 8/8] arm/km: update mgcoge3un board support
>>
>> From: Holger Brunck <holger.brunck@keymile.com>
>
> This line should be removed or moved to cc/ack/test list, it will appear in commit log
>
this is only the indication that the patch is not from Valentin and is common
practice or am I wrong? Patch 5/8 in the serie does exactly the same.
>>
>> We change default settings for egiga on mgcoge3un.
>> The reason we need this is that we have the gig port on mgcoge3un
>> connected using a back-to-back pair of PHYs. There are no magnetics and
>> because of that the port has to be run with a fixd configuration and
>> auto-negotiation must be disabled. In the default mode the egiga driver
>> uses autoneg to determine port speed - which defaults to 1G (we need
>> 100M full duplex).
>>
>> Add wait for the GPIO line connected to mgcoge3ne before
>> starting mgcoge3un. A board specific ethernet present function
>> was added, because on this board ethernet is always present.
>> The BOCO FPGA access was enhanced and changed to use register
>> definitions.
>>
>> Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>> Acked-by: Heiko Schocher <hs@denx.de>
>> cc: Wolfgang Denk <wd@denx.de>
>> cc: Detlev Zundel <dzu@denx.de>
>> cc: Prafulla Wadaskar <prafulla@marvell.com>
>> ---
>> Changes for v2:
>> - split up first large patch series to three independent smaller
>> patch series
>> Changes for v3:
>> - taken Prafulla's comments into account, merged with previous 08/08
>> patch
>>
>> board/keymile/km_arm/km_arm.c | 80 +++++++++++++++++++++++++++++++++-
>> ------
>> include/configs/mgcoge3un.h | 25 +++++++++++++
>> 2 files changed, 91 insertions(+), 14 deletions(-)
>>
>> diff --git a/board/keymile/km_arm/km_arm.c
>> b/board/keymile/km_arm/km_arm.c
>> index 4049a4e..d86acc9 100644
>> --- a/board/keymile/km_arm/km_arm.c
>> +++ b/board/keymile/km_arm/km_arm.c
>> @@ -41,6 +41,16 @@
>>
>> DECLARE_GLOBAL_DATA_PTR;
>>
>> +/*
>> + * BOCO FPGA definitions
>> + */
>> +#define BOCO 0x10
>> +#define REG_CTRL_H 0x02
>> +#define MASK_WRL_UNITRUN 0x01
>> +#define MASK_RBX_PGY_PRESENT 0x40
>> +#define REG_IRQ_CIRQ2 0x2d
>> +#define MASK_RBI_DEFECT_16 0x01
>> +
>> /* Multi-Purpose Pins Functionality configuration */
>> u32 kwmpp_config[] = {
>> MPP0_NF_IO2,
>> @@ -102,43 +112,64 @@ u32 kwmpp_config[] = {
>> 0
>> };
>>
>> +#if defined(CONFIG_MGCOGE3UN)
>> +/*
>> + * Wait for startup OK from mgcoge3ne
>> + */
>> +int startup_allowed(void)
>> +{
>> + unsigned char buf;
>> +
>> + /*
>> + * Read CIRQ16 bit (bit 0)
>> + */
>> + if (i2c_read(BOCO, REG_IRQ_CIRQ2, 1, &buf, 1) != 0)
>> + printf("%s: Error reading Boco\n", __func__);
>> + else
>> + if ((buf & MASK_RBI_DEFECT_16) == MASK_RBI_DEFECT_16)
>> + return 1;
>> + return 0;
>> +}
>> +
>> +/*
>> + * mgcoge3un has always ethernet present. Its connected to the 6061
>> switch
>> + * and provides ICNev and piggy4 connections.
>> + */
>> +int ethernet_present(void)
>> +{
>> + return 1;
>> +}
>> +#else
>> int ethernet_present(void)
>> {
>> uchar buf;
>> int ret = 0;
>>
>> - if (i2c_read(0x10, 2, 1, &buf, 1) != 0) {
>> + if (i2c_read(BOCO, REG_CTRL_H, 1, &buf, 1) != 0) {
>> printf("%s: Error reading Boco\n", __func__);
>> return -1;
>> }
>> - if ((buf & 0x40) == 0x40)
>> + if ((buf & MASK_RBX_PGY_PRESENT) == MASK_RBX_PGY_PRESENT)
>
> You can #if here instead of as done above, it will help to reduce code size and will be more readable.
> I am sorry if I missed this in the earlier post.
>
hm, #if is evaluated during compile time and buf is a variable determined
runtime. What do you mean exactly?
Best regards
Holger Brunck
next prev parent reply other threads:[~2011-05-13 14:12 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-04 15:53 [U-Boot] [PATCH v3 0/8] keymile arm boards update, part 2 Valentin Longchamp
2011-05-04 15:53 ` [U-Boot] [PATCH v3 1/8] arm/km: remove CONFIG_SYS_KWD_CONFIG from keymile-common.h Valentin Longchamp
2011-05-12 10:45 ` Prafulla Wadaskar
2011-05-04 15:53 ` [U-Boot] [PATCH v3 2/8] arm/km: move CONFIG_EXTRA_ENV_SETTINGS from board to km_arm file Valentin Longchamp
2011-05-12 10:41 ` Prafulla Wadaskar
2011-05-04 15:53 ` [U-Boot] [PATCH v3 3/8] arm/km: introduce bootcount env variable and clean km_arm Valentin Longchamp
2011-05-12 10:46 ` Prafulla Wadaskar
2011-05-04 15:53 ` [U-Boot] [PATCH v3 4/8] arm/km: disable ls (through jffs2 support) Valentin Longchamp
2011-05-04 15:53 ` [U-Boot] [PATCH v3 5/8] arm/km: add second serial interface for kirkwood Valentin Longchamp
2011-05-12 11:02 ` Prafulla Wadaskar
2011-05-04 15:53 ` [U-Boot] [PATCH v3 6/8] arm/km: rename mgcoge2un to mgcoge3un Valentin Longchamp
2011-05-12 11:01 ` Prafulla Wadaskar
2011-05-04 15:53 ` [U-Boot] [PATCH v3 7/8] mvgbe: enable configurability of PORT_SERIAL_CONTROL_VALUE Valentin Longchamp
2011-05-04 15:53 ` [U-Boot] [PATCH v3 8/8] arm/km: update mgcoge3un board support Valentin Longchamp
2011-05-12 11:01 ` Prafulla Wadaskar
2011-05-13 14:12 ` Holger Brunck [this message]
2011-05-13 18:34 ` Wolfgang Denk
2011-05-11 15:21 ` [U-Boot] [PATCH v3 0/8] keymile arm boards update, part 2 Valentin Longchamp
2011-05-12 8:58 ` Prafulla Wadaskar
2011-05-17 14:53 ` Valentin Longchamp
2011-05-20 11:54 ` Valentin Longchamp
2011-05-20 13:05 ` Wolfgang Denk
2011-05-20 15:06 ` Prafulla Wadaskar
2011-05-26 13:36 ` Valentin Longchamp
2011-05-30 16:00 ` Holger Brunck
2011-05-30 19:24 ` Wolfgang Denk
2011-05-30 19:49 ` Albert ARIBAUD
2011-05-30 19:57 ` Albert ARIBAUD
2011-05-30 20:15 ` Albert ARIBAUD
2011-05-31 11:49 ` Albert ARIBAUD
2011-05-31 12:12 ` [U-Boot] [PATCH v3 rebase " Valentin Longchamp
2011-05-31 17:49 ` Albert ARIBAUD
2011-05-31 12:12 ` [U-Boot] [PATCH v3 rebase 1/8] arm/km: remove CONFIG_SYS_KWD_CONFIG from keymile-common.h Valentin Longchamp
2011-05-31 12:12 ` [U-Boot] [PATCH v3 rebase 2/8] arm/km: move CONFIG_EXTRA_ENV_SETTINGS from board to km_arm file Valentin Longchamp
2011-05-31 12:12 ` [U-Boot] [PATCH v3 rebase 3/8] arm/km: introduce bootcount env variable and clean km_arm Valentin Longchamp
2011-05-31 12:12 ` [U-Boot] [PATCH v3 rebase 4/8] arm/km: disable ls (through jffs2 support) Valentin Longchamp
2011-05-31 12:12 ` [U-Boot] [PATCH v3 rebase 5/8] arm/km: add second serial interface for kirkwood Valentin Longchamp
2011-05-31 12:12 ` [U-Boot] [PATCH v3 rebase 6/8] arm/km: rename mgcoge2un to mgcoge3un Valentin Longchamp
2011-05-31 12:12 ` [U-Boot] [PATCH v3 rebase 7/8] mvgbe: enable configurability of PORT_SERIAL_CONTROL_VALUE Valentin Longchamp
2011-05-31 12:12 ` [U-Boot] [PATCH v3 rebase 8/8] arm/km: update mgcoge3un board support Valentin Longchamp
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=4DCD3C43.7030901@keymile.com \
--to=holger.brunck@keymile.com \
--cc=u-boot@lists.denx.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.