From: Scott McNutt <smcnutt@psyent.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5] nios2: add altera cf reset
Date: Thu, 22 Apr 2010 20:00:42 -0400 [thread overview]
Message-ID: <4BD0E32A.9090506@psyent.com> (raw)
In-Reply-To: <1269995784-20713-1-git-send-email-thomas@wytron.com.tw>
Applied. Thanks.
--Scott
Thomas Chou wrote:
> This patch toggles power to reset the cf card.
>
> Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
> ---
> more checkpatch.pl fixes
>
> board/altera/common/cfide.c | 33 +++++++++++++++++++++++++++++++++
> 1 files changed, 33 insertions(+), 0 deletions(-)
> create mode 100644 board/altera/common/cfide.c
>
> diff --git a/board/altera/common/cfide.c b/board/altera/common/cfide.c
> new file mode 100644
> index 0000000..40d6a12
> --- /dev/null
> +++ b/board/altera/common/cfide.c
> @@ -0,0 +1,33 @@
> +/*
> + * Altera CF drvier
> + *
> + * (C) Copyright 2010, Thomas Chou <thomas@wytron.com.tw>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +#include <common.h>
> +#include <asm/io.h>
> +
> +#if defined(CONFIG_IDE_RESET) && defined(CONFIG_SYS_CF_CTL_BASE)
> +/* ide_set_reset for Altera CF interface */
> +#define ALTERA_CF_CTL_STATUS 0
> +#define ALTERA_CF_IDE_CTL 4
> +#define ALTERA_CF_CTL_STATUS_PRESENT_MSK (0x1)
> +#define ALTERA_CF_CTL_STATUS_POWER_MSK (0x2)
> +#define ALTERA_CF_CTL_STATUS_RESET_MSK (0x4)
> +#define ALTERA_CF_CTL_STATUS_IRQ_EN_MSK (0x8)
> +#define ALTERA_CF_IDE_CTL_IRQ_EN_MSK (0x1)
> +
> +void ide_set_reset(int idereset)
> +{
> + int i;
> + writel(idereset ? ALTERA_CF_CTL_STATUS_RESET_MSK :
> + ALTERA_CF_CTL_STATUS_POWER_MSK,
> + CONFIG_SYS_CF_CTL_BASE + ALTERA_CF_CTL_STATUS);
> + /* wait 500 ms for power to stabilize */
> + for (i = 0; i < 500; i++)
> + udelay(1000);
> +}
> +#endif
prev parent reply other threads:[~2010-04-23 0:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-28 12:58 [U-Boot] [PATCH] nios2: add altera cf reset Thomas Chou
2010-03-28 13:11 ` [U-Boot] [PATCH v2] " Thomas Chou
2010-03-28 13:27 ` [U-Boot] [PATCH v3] " Thomas Chou
2010-03-28 16:06 ` Scott McNutt
2010-03-28 17:31 ` Wolfgang Denk
2010-03-29 0:40 ` [U-Boot] [PATCH v4] " Thomas Chou
2010-03-31 0:36 ` [U-Boot] [PATCH v5] " Thomas Chou
2010-04-23 0:00 ` Scott McNutt [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=4BD0E32A.9090506@psyent.com \
--to=smcnutt@psyent.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.