* [U-Boot] [PATCH] mpc83xx: Add UPMA configuration to SIMPC8313
@ 2010-04-28 17:48 Ron Madrid
2010-04-28 22:08 ` Kim Phillips
0 siblings, 1 reply; 5+ messages in thread
From: Ron Madrid @ 2010-04-28 17:48 UTC (permalink / raw)
To: u-boot
Added UPM array table, upmconfig, and Local Bus configuration support for SIMPC8313
Signed-off-by: Ron Madrid <ron_madrid@sbcglobal.net>
---
board/sheldon/simpc8313/simpc8313.c | 34 ++++++++++++++++++++++++++++++++++
include/configs/SIMPC8313.h | 10 ++++++++++
2 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/board/sheldon/simpc8313/simpc8313.c b/board/sheldon/simpc8313/simpc8313.c
index 1044de2..3bfd4db 100644
--- a/board/sheldon/simpc8313/simpc8313.c
+++ b/board/sheldon/simpc8313/simpc8313.c
@@ -91,6 +91,40 @@ void pci_init_board(void)
int misc_init_r(void)
{
int rc = 0;
+ volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
+ volatile fsl_lbus_t *lbus = &immap->lbus;
+ volatile u32 *mxmr = &lbus->mamr; /* Pointer to mamr */
+
+ /* UPM Table Configuration Code */
+ static uint UPMATable[] = {
+ /* Read Single-Beat (RSS) */
+ 0x0fff0c00, 0x0fffdc00, 0x0fff0c05, 0xfffffc00,
+ 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01,
+ /* Read Burst (RBS) */
+ 0x0fff0c00, 0x0ffcdc00, 0x0ffc0c00, 0x0ffc0f0c,
+ 0x0ffccf0c, 0x0ffc0f0c, 0x0ffcce0c, 0x3ffc0c05,
+ 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
+ 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01,
+ /* Write Single-Beat (WSS) */
+ 0x0ffc0c00, 0x0ffcdc00, 0x0ffc0c05, 0xfffffc00,
+ 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01,
+ /* Write Burst (WBS) */
+ 0x0ffc0c00, 0x0fffcc0c, 0x0fff0c00, 0x0fffcc00,
+ 0x0fff1c00, 0x0fffcf0c, 0x0fff0f0c, 0x0fffcf0c,
+ 0x0fff0c0c, 0x0fffcc0c, 0x0fff0c05, 0xfffffc00,
+ 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01,
+ /* Refresh Timer (RTS) */
+ 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
+ 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc00,
+ 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01,
+ /* Exception Condition (EXS) */
+ 0xfffffc00, 0xfffffc00, 0xfffffc00, 0xfffffc01
+ };
+
+ upmconfig(UPMA, UPMATable, sizeof(UPMATable) / sizeof(UPMATable[0]));
+
+ /* Set LUPWAIT to be active low and enabled */
+ *mxmr = 0x08000000 | MxMR_GPL_x4DIS;
return rc;
}
diff --git a/include/configs/SIMPC8313.h b/include/configs/SIMPC8313.h
index 84af8df..889050f 100644
--- a/include/configs/SIMPC8313.h
+++ b/include/configs/SIMPC8313.h
@@ -184,6 +184,16 @@
#define CONFIG_SYS_NAND_LBLAWBAR_PRELIM CONFIG_SYS_LBLAWBAR0_PRELIM
#define CONFIG_SYS_NAND_LBLAWAR_PRELIM CONFIG_SYS_LBLAWAR0_PRELIM
+#define CONFIG_SYS_BR1_PRELIM ( 0xFF000000 /* FPGA Base Addr */ \
+ | BR_PS_16 \
+ | BR_MS_UPMA \
+ | BR_V )
+#define CONFIG_SYS_OR1_PRELIM ( 0xFFE00000 /* length 2MB */ \
+ | OR_UPM_BCTLD)
+
+#define CONFIG_SYS_LBLAWBAR1_PRELIM 0xFF000000 /* FPGA Base Addr */
+#define CONFIG_SYS_LBLAWAR1_PRELIM 0x80000014 /* 2MB */
+
/*
* JFFS2 configuration
*/
--
1.5.5.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] mpc83xx: Add UPMA configuration to SIMPC8313
2010-04-28 17:48 [U-Boot] [PATCH] mpc83xx: Add UPMA configuration to SIMPC8313 Ron Madrid
@ 2010-04-28 22:08 ` Kim Phillips
2010-04-28 22:18 ` Ron Madrid
0 siblings, 1 reply; 5+ messages in thread
From: Kim Phillips @ 2010-04-28 22:08 UTC (permalink / raw)
To: u-boot
On Wed, 28 Apr 2010 10:48:44 -0700
Ron Madrid <ron_madrid@sbcglobal.net> wrote:
> + volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
> + volatile fsl_lbus_t *lbus = &immap->lbus;
> + volatile u32 *mxmr = &lbus->mamr; /* Pointer to mamr */
no volatiles...
> + /* Set LUPWAIT to be active low and enabled */
> + *mxmr = 0x08000000 | MxMR_GPL_x4DIS;
...because we should now be using i/o accessors. Also, let's add a
MxMR_UWPL in fsl_lbc.h please (can be in same patch).
> +#define CONFIG_SYS_BR1_PRELIM ( 0xFF000000 /* FPGA Base Addr */ \
> + | BR_PS_16 \
> + | BR_MS_UPMA \
> + | BR_V )
> +#define CONFIG_SYS_OR1_PRELIM ( 0xFFE00000 /* length 2MB */ \
OR_AM_2MB (and therefore drop the comment).
> + | OR_UPM_BCTLD)
> +
> +#define CONFIG_SYS_LBLAWBAR1_PRELIM 0xFF000000 /* FPGA Base Addr */
if FPGA base address becomes a recurring reference, best to name it
something like CONFIG_SYS_FPGA_BASE.
> +#define CONFIG_SYS_LBLAWAR1_PRELIM 0x80000014 /* 2MB */
(LBLAWAR_EN | LBLAWAR_2MB)
Kim
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] mpc83xx: Add UPMA configuration to SIMPC8313
2010-04-28 22:08 ` Kim Phillips
@ 2010-04-28 22:18 ` Ron Madrid
2010-04-28 23:05 ` Kim Phillips
0 siblings, 1 reply; 5+ messages in thread
From: Ron Madrid @ 2010-04-28 22:18 UTC (permalink / raw)
To: u-boot
> > + /* Set LUPWAIT to be active low
> and enabled */
> > + *mxmr = 0x08000000 |
> MxMR_GPL_x4DIS;
>
> ...because we should now be using i/o accessors.
Not entirely sure what you mean here. Should I be
using __raw_writel, or writel, or ...?
Thanks.
Ron
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] mpc83xx: Add UPMA configuration to SIMPC8313
2010-04-28 23:05 ` Kim Phillips
@ 2010-04-28 22:58 ` Ron Madrid
0 siblings, 0 replies; 5+ messages in thread
From: Ron Madrid @ 2010-04-28 22:58 UTC (permalink / raw)
To: u-boot
> out_be32 (or even setbits_be32) looks appropriate
> here. The raw
> accessors can be used as an alternative when performance
> and/or code
> density issues arise.
Thanks for the clarification!
Ron
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] mpc83xx: Add UPMA configuration to SIMPC8313
2010-04-28 22:18 ` Ron Madrid
@ 2010-04-28 23:05 ` Kim Phillips
2010-04-28 22:58 ` Ron Madrid
0 siblings, 1 reply; 5+ messages in thread
From: Kim Phillips @ 2010-04-28 23:05 UTC (permalink / raw)
To: u-boot
On Wed, 28 Apr 2010 15:18:36 -0700
Ron Madrid <ron_madrid@sbcglobal.net> wrote:
> > > + /* Set LUPWAIT to be active low
> > and enabled */
> > > + *mxmr = 0x08000000 |
> > MxMR_GPL_x4DIS;
> >
> > ...because we should now be using i/o accessors.
>
> Not entirely sure what you mean here. Should I be
> using __raw_writel, or writel, or ...?
out_be32 (or even setbits_be32) looks appropriate here. The raw
accessors can be used as an alternative when performance and/or code
density issues arise.
Kim
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-04-28 23:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-28 17:48 [U-Boot] [PATCH] mpc83xx: Add UPMA configuration to SIMPC8313 Ron Madrid
2010-04-28 22:08 ` Kim Phillips
2010-04-28 22:18 ` Ron Madrid
2010-04-28 23:05 ` Kim Phillips
2010-04-28 22:58 ` Ron Madrid
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.