Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jack Humbert
reform-boundary-uboot
Commits
329f0f52
Commit
329f0f52
authored
14 years ago
by
Reinhard Meyer
Committed by
Albert ARIBAUD
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ATMEL: fix related common atmel driver files
Signed-off-by:
Reinhard Meyer
<
u-boot@emk-elektronik.de
>
parent
372f2783
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
drivers/mmc/gen_atmel_mci.c
+1
-1
1 addition, 1 deletion
drivers/mmc/gen_atmel_mci.c
drivers/net/macb.c
+8
-6
8 additions, 6 deletions
drivers/net/macb.c
drivers/serial/atmel_usart.c
+7
-21
7 additions, 21 deletions
drivers/serial/atmel_usart.c
drivers/spi/atmel_spi.c
+8
-8
8 additions, 8 deletions
drivers/spi/atmel_spi.c
with
24 additions
and
36 deletions
drivers/mmc/gen_atmel_mci.c
+
1
−
1
View file @
329f0f52
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
#include
<asm/errno.h>
#include
<asm/errno.h>
#include
<asm/byteorder.h>
#include
<asm/byteorder.h>
#include
<asm/arch/clk.h>
#include
<asm/arch/clk.h>
#include
<asm/arch/
memory-map
.h>
#include
<asm/arch/
hardware
.h>
#include
"atmel_mci.h"
#include
"atmel_mci.h"
#ifndef CONFIG_SYS_MMC_CLK_OD
#ifndef CONFIG_SYS_MMC_CLK_OD
...
...
This diff is collapsed.
Click to expand it.
drivers/net/macb.c
+
8
−
6
View file @
329f0f52
...
@@ -469,17 +469,19 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
...
@@ -469,17 +469,19 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
/* choose RMII or MII mode. This depends on the board */
/* choose RMII or MII mode. This depends on the board */
#ifdef CONFIG_RMII
#ifdef CONFIG_RMII
#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45)
defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
defined(CONFIG_AT91SAM9XE)
macb_writel
(
macb
,
USRIO
,
MACB_BIT
(
RMII
)
|
MACB_BIT
(
CLKEN
));
macb_writel
(
macb
,
USRIO
,
MACB_BIT
(
RMII
)
|
MACB_BIT
(
CLKEN
));
#else
#else
macb_writel
(
macb
,
USRIO
,
0
);
macb_writel
(
macb
,
USRIO
,
0
);
#endif
#endif
#else
#else
#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
#if defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45)
defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
defined(CONFIG_AT91SAM9XE)
macb_writel
(
macb
,
USRIO
,
MACB_BIT
(
CLKEN
));
macb_writel
(
macb
,
USRIO
,
MACB_BIT
(
CLKEN
));
#else
#else
macb_writel
(
macb
,
USRIO
,
MACB_BIT
(
MII
));
macb_writel
(
macb
,
USRIO
,
MACB_BIT
(
MII
));
...
...
This diff is collapsed.
Click to expand it.
drivers/serial/atmel_usart.c
+
7
−
21
View file @
329f0f52
...
@@ -23,21 +23,7 @@
...
@@ -23,21 +23,7 @@
#include
<asm/io.h>
#include
<asm/io.h>
#include
<asm/arch/clk.h>
#include
<asm/arch/clk.h>
#include
<asm/arch/memory-map.h>
#include
<asm/arch/hardware.h>
#if defined(CONFIG_USART0)
# define USART_ID 0
# define USART_BASE USART0_BASE
#elif defined(CONFIG_USART1)
# define USART_ID 1
# define USART_BASE USART1_BASE
#elif defined(CONFIG_USART2)
# define USART_ID 2
# define USART_BASE USART2_BASE
#elif defined(CONFIG_USART3)
# define USART_ID 3
# define USART_BASE USART3_BASE
#endif
#include
"atmel_usart.h"
#include
"atmel_usart.h"
...
@@ -45,7 +31,7 @@ DECLARE_GLOBAL_DATA_PTR;
...
@@ -45,7 +31,7 @@ DECLARE_GLOBAL_DATA_PTR;
void
serial_setbrg
(
void
)
void
serial_setbrg
(
void
)
{
{
atmel_usart3_t
*
usart
=
(
atmel_usart3_t
*
)
USART_BASE
;
atmel_usart3_t
*
usart
=
(
atmel_usart3_t
*
)
CONFIG_
USART_BASE
;
unsigned
long
divisor
;
unsigned
long
divisor
;
unsigned
long
usart_hz
;
unsigned
long
usart_hz
;
...
@@ -54,14 +40,14 @@ void serial_setbrg(void)
...
@@ -54,14 +40,14 @@ void serial_setbrg(void)
* Baud Rate = --------------
* Baud Rate = --------------
* 16 * CD
* 16 * CD
*/
*/
usart_hz
=
get_usart_clk_rate
(
USART_ID
);
usart_hz
=
get_usart_clk_rate
(
CONFIG_
USART_ID
);
divisor
=
(
usart_hz
/
16
+
gd
->
baudrate
/
2
)
/
gd
->
baudrate
;
divisor
=
(
usart_hz
/
16
+
gd
->
baudrate
/
2
)
/
gd
->
baudrate
;
writel
(
USART3_BF
(
CD
,
divisor
),
&
usart
->
brgr
);
writel
(
USART3_BF
(
CD
,
divisor
),
&
usart
->
brgr
);
}
}
int
serial_init
(
void
)
int
serial_init
(
void
)
{
{
atmel_usart3_t
*
usart
=
(
atmel_usart3_t
*
)
USART_BASE
;
atmel_usart3_t
*
usart
=
(
atmel_usart3_t
*
)
CONFIG_
USART_BASE
;
writel
(
USART3_BIT
(
RSTRX
)
|
USART3_BIT
(
RSTTX
),
&
usart
->
cr
);
writel
(
USART3_BIT
(
RSTRX
)
|
USART3_BIT
(
RSTTX
),
&
usart
->
cr
);
...
@@ -80,7 +66,7 @@ int serial_init(void)
...
@@ -80,7 +66,7 @@ int serial_init(void)
void
serial_putc
(
char
c
)
void
serial_putc
(
char
c
)
{
{
atmel_usart3_t
*
usart
=
(
atmel_usart3_t
*
)
USART_BASE
;
atmel_usart3_t
*
usart
=
(
atmel_usart3_t
*
)
CONFIG_
USART_BASE
;
if
(
c
==
'\n'
)
if
(
c
==
'\n'
)
serial_putc
(
'\r'
);
serial_putc
(
'\r'
);
...
@@ -97,7 +83,7 @@ void serial_puts(const char *s)
...
@@ -97,7 +83,7 @@ void serial_puts(const char *s)
int
serial_getc
(
void
)
int
serial_getc
(
void
)
{
{
atmel_usart3_t
*
usart
=
(
atmel_usart3_t
*
)
USART_BASE
;
atmel_usart3_t
*
usart
=
(
atmel_usart3_t
*
)
CONFIG_
USART_BASE
;
while
(
!
(
readl
(
&
usart
->
csr
)
&
USART3_BIT
(
RXRDY
)))
while
(
!
(
readl
(
&
usart
->
csr
)
&
USART3_BIT
(
RXRDY
)))
WATCHDOG_RESET
();
WATCHDOG_RESET
();
...
@@ -106,6 +92,6 @@ int serial_getc(void)
...
@@ -106,6 +92,6 @@ int serial_getc(void)
int
serial_tstc
(
void
)
int
serial_tstc
(
void
)
{
{
atmel_usart3_t
*
usart
=
(
atmel_usart3_t
*
)
USART_BASE
;
atmel_usart3_t
*
usart
=
(
atmel_usart3_t
*
)
CONFIG_
USART_BASE
;
return
(
readl
(
&
usart
->
csr
)
&
USART3_BIT
(
RXRDY
))
!=
0
;
return
(
readl
(
&
usart
->
csr
)
&
USART3_BIT
(
RXRDY
))
!=
0
;
}
}
This diff is collapsed.
Click to expand it.
drivers/spi/atmel_spi.c
+
8
−
8
View file @
329f0f52
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#include
<asm/io.h>
#include
<asm/io.h>
#include
<asm/arch/clk.h>
#include
<asm/arch/clk.h>
#include
<asm/arch/
memory-map
.h>
#include
<asm/arch/
hardware
.h>
#include
"atmel_spi.h"
#include
"atmel_spi.h"
...
@@ -48,21 +48,21 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
...
@@ -48,21 +48,21 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
switch
(
bus
)
{
switch
(
bus
)
{
case
0
:
case
0
:
regs
=
(
void
*
)
SPI0_BASE
;
regs
=
(
void
*
)
ATMEL_BASE_SPI0
;
break
;
break
;
#ifdef
SPI1_BASE
#ifdef
ATMEL_BASE_SPI1
case
1
:
case
1
:
regs
=
(
void
*
)
SPI1_BASE
;
regs
=
(
void
*
)
ATMEL_BASE_SPI1
;
break
;
break
;
#endif
#endif
#ifdef
SPI2_BASE
#ifdef
ATMEL_BASE_SPI2
case
2
:
case
2
:
regs
=
(
void
*
)
SPI2_BASE
;
regs
=
(
void
*
)
ATMEL_BASE_SPI2
;
break
;
break
;
#endif
#endif
#ifdef
SPI3_BASE
#ifdef
ATMEL_BASE_SPI3
case
3
:
case
3
:
regs
=
(
void
*
)
SPI3_BASE
;
regs
=
(
void
*
)
ATMEL_BASE_SPI3
;
break
;
break
;
#endif
#endif
default:
default:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment