From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 6/8] SPARC: Added SMC91111 support for LEON2 and LEON3 processors
Date: Thu, 13 Mar 2008 13:20:17 +0100 [thread overview]
Message-ID: <20080313122017.9954F247AF@gemini.denx.de> (raw)
In-Reply-To: Your message of "Thu, 13 Mar 2008 10:39:36 +0100." <47D8F658.90001@gaisler.com>
In message <47D8F658.90001@gaisler.com> you wrote:
> This patch makes SPARC/LEON processors able to read and write
> to the SMC91111 chip using the chip external I/O bus of the memory
> controller. This patchs defines the standard in and out macros
> expected by the SMC9111 driver.
>
> To access that I/O bus one must set up the memory controller
> (MCTRL or FTMCTRL) correctly. It is assumed that the user sets
> up this correctly when the other MCTRL parameters are set up. It
> can be set up from the board configuration header file.
>
> Best Regards,
> Daniel Hellstrom
>
>
> drivers/net/smc91111.h | 74
> +++++++++++++++++++++++++++++++++++++++++++++++-
> 1 files changed, 73 insertions(+), 1 deletions(-)
>
>
> diff --git a/drivers/net/smc91111.h b/drivers/net/smc91111.h
> index d03cbc3..8d3976a 100644
> --- a/drivers/net/smc91111.h
> +++ b/drivers/net/smc91111.h
> @@ -176,7 +176,79 @@ typedef unsigned long int dword;
> }; \
> })
>
> -#else /* if not CONFIG_PXA250 */
> +#elif defined(CONFIG_LEON) /* if not CONFIG_PXA250 */
> +
> +#define SMC_LEON_SWAP16(_x_) \
> + ({ word _x = (_x_); ((_x << 8) | (_x >> 8)); })
> +
> +#define SMC_LEON_SWAP32(_x_) \
> + ({ dword _x = (_x_); \
> + ((_x << 24) | \
> + ((0x0000FF00UL & _x) << 8) | \
> + ((0x00FF0000UL & _x) >> 8) | \
> + (_x >> 24)); })
> +
> +#define SMC_inl(r) (SMC_LEON_SWAP32((*(volatile dword
> *)(SMC_BASE_ADDRESS+((r)<<0)))))
> +#define SMC_inl_nosw(r) ((*(volatile dword
> *)(SMC_BASE_ADDRESS+((r)<<0))))
> +#define SMC_inw(r) (SMC_LEON_SWAP16((*(volatile word
> *)(SMC_BASE_ADDRESS+((r)<<0)))))
> +#define SMC_inw_nosw(r) ((*(volatile word
> *)(SMC_BASE_ADDRESS+((r)<<0))))
> +#define SMC_inb(p) ({ \
> + word ___v = SMC_inw((p) & ~1); \
> + if (p & 1) ___v >>= 8; \
> + else ___v &= 0xff; \
> + ___v; })
Line wrapped, indentation not by TAB nor in columns of 8, plus more
coding style issues.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Another dream that failed. There's nothing sadder.
-- Kirk, "This side of Paradise", stardate 3417.3
prev parent reply other threads:[~2008-03-13 12:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-13 9:39 [U-Boot-Users] [PATCH 6/8] SPARC: Added SMC91111 support for LEON2 and LEON3 processors Daniel Hellstrom
2008-03-13 12:20 ` Wolfgang Denk [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=20080313122017.9954F247AF@gemini.denx.de \
--to=wd@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