summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-02-03 20:22:10 +0100
committerWolfgang Denk <wd@denx.de>2010-02-03 20:22:10 +0100
commit111d6c6ad15d1425d3e5a678b2ff4b593e910fca (patch)
treefebbcf93318ed9265c4efef9b63c1a1249067d1f /board
parent08254a1a9795711a6e43ad6e73d88a3988706731 (diff)
parent4710cee1b5292fe077a67cc23193cc43060fbe3d (diff)
Merge branch 'master' of git://git.denx.de/u-boot-ppc4xx
Diffstat (limited to 'board')
-rw-r--r--board/esd/plu405/plu405.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/board/esd/plu405/plu405.c b/board/esd/plu405/plu405.c
index e385a78a2e8..0f7fa69a74c 100644
--- a/board/esd/plu405/plu405.c
+++ b/board/esd/plu405/plu405.c
@@ -46,6 +46,34 @@ const unsigned char fpgadata[] =
*/
#include "../common/fpga.c"
+/*
+ * generate a short spike on the CAN tx line
+ * to bring the couplers in sync
+ */
+void init_coupler(u32 addr)
+{
+ struct sja1000_basic_s *ctrl = (struct sja1000_basic_s *)addr;
+
+ /* reset */
+ out_8(&ctrl->cr, CR_RR);
+
+ /* dominant */
+ out_8(&ctrl->btr0, 0x00); /* btr setup is required */
+ out_8(&ctrl->btr1, 0x14); /* we use 1Mbit/s */
+ out_8(&ctrl->oc, OC_TP1 | OC_TN1 | OC_POL1 |
+ OC_TP0 | OC_TN0 | OC_POL0 | OC_MODE1);
+ out_8(&ctrl->cr, 0x00);
+
+ /* delay */
+ in_8(&ctrl->cr);
+ in_8(&ctrl->cr);
+ in_8(&ctrl->cr);
+ in_8(&ctrl->cr);
+
+ /* reset */
+ out_8(&ctrl->cr, CR_RR);
+}
+
int board_early_init_f(void)
{
/*