diff options
author | Daniel Gorsulowski <Daniel.Gorsulowski@esd.eu> | 2009-06-30 23:03:33 +0200 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2009-07-06 21:52:43 +0200 |
commit | 45627fce18139a74e0755124d27376b520db156c (patch) | |
tree | 042d853f683b29acb04795b1cc7ee6a6846573e3 /cpu/arm926ejs/at91 | |
parent | 2e23008e5dbde7fe4c4758bee5a393e1db796cdf (diff) | |
download | u-boot-imx-45627fce18139a74e0755124d27376b520db156c.zip u-boot-imx-45627fce18139a74e0755124d27376b520db156c.tar.gz u-boot-imx-45627fce18139a74e0755124d27376b520db156c.tar.bz2 |
at91: Add CAN init function
To enable CAN init, CONFIG_CAN has to be defined in the board config file
and at91_can_hw_init() has to be called in the board specific code.
CAN is available on AT91SAM9263 and AT91CAP9 SoC.
Signed-off-by: Daniel Gorsulowski <Daniel.Gorsulowski@esd.eu>
Diffstat (limited to 'cpu/arm926ejs/at91')
-rw-r--r-- | cpu/arm926ejs/at91/at91cap9_devices.c | 15 | ||||
-rw-r--r-- | cpu/arm926ejs/at91/at91sam9263_devices.c | 15 |
2 files changed, 30 insertions, 0 deletions
diff --git a/cpu/arm926ejs/at91/at91cap9_devices.c b/cpu/arm926ejs/at91/at91cap9_devices.c index c0024ac..39e405f 100644 --- a/cpu/arm926ejs/at91/at91cap9_devices.c +++ b/cpu/arm926ejs/at91/at91cap9_devices.c @@ -3,6 +3,10 @@ * Stelian Pop <stelian.pop@leadtechdesign.com> * Lead Tech Design <www.leadtechdesign.com> * + * (C) Copyright 2009 + * Daniel Gorsulowski <daniel.gorsulowski@esd.eu> + * esd electronic system design gmbh <www.esd.eu> + * * See file CREDITS for list of people who contributed to this * project. * @@ -174,3 +178,14 @@ void at91_macb_hw_init(void) #endif } #endif + +#ifdef CONFIG_AT91_CAN +void at91_can_hw_init(void) +{ + at91_set_A_periph(AT91_PIN_PA12, 0); /* CAN_TX */ + at91_set_A_periph(AT91_PIN_PA13, 1); /* CAN_RX */ + + /* Enable clock */ + at91_sys_write(AT91_PMC_PCER, 1 << AT91CAP9_ID_CAN); +} +#endif diff --git a/cpu/arm926ejs/at91/at91sam9263_devices.c b/cpu/arm926ejs/at91/at91sam9263_devices.c index 0f2613e..f72efdf 100644 --- a/cpu/arm926ejs/at91/at91sam9263_devices.c +++ b/cpu/arm926ejs/at91/at91sam9263_devices.c @@ -3,6 +3,10 @@ * Stelian Pop <stelian.pop@leadtechdesign.com> * Lead Tech Design <www.leadtechdesign.com> * + * (C) Copyright 2009 + * Daniel Gorsulowski <daniel.gorsulowski@esd.eu> + * esd electronic system design gmbh <www.esd.eu> + * * See file CREDITS for list of people who contributed to this * project. * @@ -182,3 +186,14 @@ void at91_uhp_hw_init(void) at91_set_gpio_output(AT91_PIN_PA24, 0); } #endif + +#ifdef CONFIG_AT91_CAN +void at91_can_hw_init(void) +{ + at91_set_A_periph(AT91_PIN_PA13, 0); /* CAN_TX */ + at91_set_A_periph(AT91_PIN_PA14, 1); /* CAN_RX */ + + /* Enable clock */ + at91_sys_write(AT91_PMC_PCER, 1 << AT91SAM9263_ID_CAN); +} +#endif |