From: Gary Jennejohn <garyj@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4 v3] powerpc: keymile: Add a check for the PIGGY debug board
Date: Thu, 20 Nov 2008 11:10:05 +0100 [thread overview]
Message-ID: <20081120111005.0808d243@ernst.jennejohn.org> (raw)
In-Reply-To: <492526BF.8090302@denx.de>
On Thu, 20 Nov 2008 09:58:39 +0100
Heiko Schocher <hs@denx.de> wrote:
> Check the presence of the PIGGY on the keymile boards mgcoge,
> mgsuvd and kmeter1. If the PIGGY is not present, dont register
> this Ethernet device.
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> ---
>
> changes since v2:
>
> - added comments from Ben Warren
>
> board/keymile/common/common.c | 20 ++++++++++++++++++--
> board/keymile/common/common.h | 16 ++++++++++++++++
> board/keymile/kmeter1/Makefile | 6 ++++--
> board/keymile/kmeter1/kmeter1.c | 7 ++++++-
> board/keymile/mgcoge/mgcoge.c | 10 +++++++---
> board/keymile/mgsuvd/mgsuvd.c | 8 ++++++--
> include/configs/kmeter1.h | 9 +++++++++
> include/configs/mgcoge.h | 10 ++++++++++
> include/configs/mgsuvd.h | 9 +++++++++
> 9 files changed, 85 insertions(+), 10 deletions(-)
> create mode 100644 board/keymile/common/common.h
>
> diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c
> index a4cf24c..cc30b36 100644
> --- a/board/keymile/common/common.c
> +++ b/board/keymile/common/common.c
> @@ -22,10 +22,14 @@
> */
>
> #include <common.h>
> +#if defined(CONFIG_MGCOGE)
> #include <mpc8260.h>
> +#endif
> #include <ioports.h>
> #include <malloc.h>
> #include <hush.h>
> +#include <net.h>
> +#include <asm/io.h>
>
> #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
> #include <libfdt.h>
> @@ -33,8 +37,6 @@
>
> #if defined(CONFIG_HARD_I2C) || defined(CONFIG_SOFT_I2C)
> #include <i2c.h>
> -#endif
> -#include <asm/io.h>
>
> extern int i2c_soft_read_pin (void);
>
> @@ -495,6 +497,7 @@ void i2c_init_board(void)
> #endif
> }
> #endif
> +#endif
>
> #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
> int fdt_set_node_and_value (void *blob,
> @@ -521,3 +524,16 @@ int fdt_set_node_and_value (void *blob,
> return ret;
> }
> #endif
> +
> +int ethernet_present (void)
> +{
> + return (in_8((u8 *)CONFIG_SYS_PIGGY_BASE + CONFIG_SYS_SLOT_ID_OFF) & 0x80);
> +}
> +
> +int board_eth_init(bd_t *bis)
> +{
#ifdef CONFIG_KEYMILE_HDLC_ENET
(void)keymile_hdlc_enet_initialize(bis);
#endif
> + if (ethernet_present ()) {
> + return -1;
> + }
> + return 0;
> +}
If it looked like this it would be perfect!
---
Gary Jennejohn
*********************************************************************
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
*********************************************************************
next prev parent reply other threads:[~2008-11-20 10:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-20 8:58 [U-Boot] [PATCH 3/4 v3] powerpc: keymile: Add a check for the PIGGY debug board Heiko Schocher
2008-11-20 10:10 ` Gary Jennejohn [this message]
2008-11-21 7:29 ` [U-Boot] [PATCH 3/4 v4] " Heiko Schocher
2008-11-25 7:51 ` Ben Warren
2009-01-23 23:39 ` Wolfgang Denk
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=20081120111005.0808d243@ernst.jennejohn.org \
--to=garyj@denx.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox