]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - board/actux4/actux4.c
imx6 SION bit has to be on for the pins that are used as ENET_REF_CLK
[karo-tx-uboot.git] / board / actux4 / actux4.c
1 /*
2  * (C) Copyright 2007
3  * Michael Schwingen, michael@schwingen.org
4  *
5  * (C) Copyright 2006
6  * Stefan Roese, DENX Software Engineering, sr@denx.de.
7  *
8  * (C) Copyright 2002
9  * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
10  *
11  * (C) Copyright 2002
12  * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
13  * Marius Groeger <mgroeger@sysgo.de>
14  *
15  * SPDX-License-Identifier:     GPL-2.0+
16  */
17
18 #include <common.h>
19 #include <command.h>
20 #include <malloc.h>
21 #include <asm/arch/ixp425.h>
22 #include <asm/io.h>
23 #include <miiphy.h>
24 #ifdef CONFIG_PCI
25 #include <pci.h>
26 #include <asm/arch/ixp425pci.h>
27 #endif
28
29 #include "actux4_hw.h"
30
31 DECLARE_GLOBAL_DATA_PTR;
32
33 int board_early_init_f(void)
34 {
35         writel(0xbd113c42, IXP425_EXP_CS1);
36         return 0;
37 }
38
39 int board_init(void)
40 {
41         /* adress of boot parameters */
42         gd->bd->bi_boot_params = 0x00000100;
43
44         GPIO_OUTPUT_CLEAR(CONFIG_SYS_GPIO_nPWRON);
45         GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_nPWRON);
46
47         GPIO_OUTPUT_CLEAR(CONFIG_SYS_GPIO_IORST);
48         GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_IORST);
49
50         /* led not populated on board*/
51         GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_LED3);
52         GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_LED3);
53
54         /* middle LED */
55         GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_LED2);
56         GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_LED2);
57
58         /* right LED */
59         /* weak pulldown = LED weak on */
60         GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_LED1);
61         GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_LED1);
62
63         /* Setup GPIO's for Interrupt inputs */
64         GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_USBINTA);
65         GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_USBINTB);
66         GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_USBINTC);
67         GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_RTCINT);
68         GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_PCI_INTA);
69         GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_PCI_INTB);
70
71         GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_USBINTA);
72         GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_USBINTB);
73         GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_USBINTC);
74         GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_RTCINT);
75         GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_PCI_INTA);
76         GPIO_INT_ACT_LOW_SET(CONFIG_SYS_GPIO_PCI_INTB);
77
78         /* Setup GPIO's for 33MHz clock output */
79         writel(0x011001FF, IXP425_GPIO_GPCLKR);
80         GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_EXTBUS_CLK);
81         GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_PCI_CLK);
82
83         udelay(10000);
84         GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_IORST);
85         udelay(10000);
86         GPIO_OUTPUT_CLEAR(CONFIG_SYS_GPIO_IORST);
87         udelay(10000);
88         GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_IORST);
89
90         return 0;
91 }
92
93 /* Check Board Identity */
94 int checkboard(void)
95 {
96         puts("Board: AcTux-4\n");
97         return 0;
98 }
99
100 int dram_init(void)
101 {
102         gd->ram_size = get_ram_size(CONFIG_SYS_SDRAM_BASE, 128<<20);
103         return 0;
104 }
105
106 #ifdef CONFIG_PCI
107 struct pci_controller hose;
108
109 void pci_init_board(void)
110 {
111         pci_ixp_init(&hose);
112 }
113 #endif
114
115 /*
116  * Hardcoded flash setup:
117  * Flash 0 is a non-CFI SST 39VF020 flash, 8 bit flash / 8 bit bus.
118  * Flash 1 is an Intel *16 flash using the CFI driver.
119  */
120 ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
121 {
122         if (banknum == 0) {     /* non-CFI boot flash */
123                 info->portwidth = 1;
124                 info->chipwidth = 1;
125                 info->interface = FLASH_CFI_X8;
126                 return 1;
127         } else
128                 return 0;
129 }