~ubuntu-branches/ubuntu/saucy/u-boot/saucy

« back to all changes in this revision

Viewing changes to board/actux2/actux2.c

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams
  • Date: 2011-07-24 09:35:32 UTC
  • mfrom: (16.1.16 sid)
  • Revision ID: james.westby@ubuntu.com-20110724093532-8gkkvtczkjagf4gv
Tags: 2011.06-3
Add DreamPlug support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
DECLARE_GLOBAL_DATA_PTR;
45
45
 
46
 
int board_init (void)
 
46
int board_early_init_f(void)
47
47
{
48
 
        gd->bd->bi_arch_number = MACH_TYPE_ACTUX2;
49
 
 
50
 
        /* adress of boot parameters */
51
 
        gd->bd->bi_boot_params = 0x00000100;
52
 
 
53
 
        GPIO_OUTPUT_ENABLE (CONFIG_SYS_GPIO_IORST);
54
 
        GPIO_OUTPUT_ENABLE (CONFIG_SYS_GPIO_ETHRST);
55
 
        GPIO_OUTPUT_ENABLE (CONFIG_SYS_GPIO_DSR);
56
 
        GPIO_OUTPUT_ENABLE (CONFIG_SYS_GPIO_DCD);
57
 
 
58
 
        GPIO_OUTPUT_CLEAR (CONFIG_SYS_GPIO_IORST);
59
 
        GPIO_OUTPUT_CLEAR (CONFIG_SYS_GPIO_ETHRST);
60
 
 
61
 
        GPIO_OUTPUT_CLEAR (CONFIG_SYS_GPIO_DSR);
62
 
        GPIO_OUTPUT_SET (CONFIG_SYS_GPIO_DCD);
63
 
 
64
 
        /* Setup GPIO's for Interrupt inputs */
65
 
        GPIO_OUTPUT_DISABLE (CONFIG_SYS_GPIO_DBGINT);
66
 
        GPIO_OUTPUT_DISABLE (CONFIG_SYS_GPIO_ETHINT);
67
 
 
68
 
        /* Setup GPIO's for 33MHz clock output */
69
 
        GPIO_OUTPUT_ENABLE (CONFIG_SYS_GPIO_PCI_CLK);
70
 
        GPIO_OUTPUT_ENABLE (CONFIG_SYS_GPIO_EXTBUS_CLK);
71
 
        *IXP425_GPIO_GPCLKR = 0x011001FF;
72
 
 
73
48
        /* CS1: IPAC-X */
74
 
        *IXP425_EXP_CS1 = 0x94d10013;
 
49
        writel(0x94d10013, IXP425_EXP_CS1);
75
50
        /* CS5: Debug port */
76
 
        *IXP425_EXP_CS5 = 0x9d520003;
 
51
        writel(0x9d520003, IXP425_EXP_CS5);
77
52
        /* CS6: HW release register */
78
 
        *IXP425_EXP_CS6 = 0x81860001;
 
53
        writel(0x81860001, IXP425_EXP_CS6);
79
54
        /* CS7: LEDs */
80
 
        *IXP425_EXP_CS7 = 0x80900003;
81
 
 
82
 
        udelay (533);
83
 
        GPIO_OUTPUT_SET (CONFIG_SYS_GPIO_IORST);
84
 
        GPIO_OUTPUT_SET (CONFIG_SYS_GPIO_ETHRST);
85
 
 
86
 
        ACTUX2_LED1 (1);
87
 
        ACTUX2_LED2 (0);
88
 
        ACTUX2_LED3 (0);
89
 
        ACTUX2_LED4 (0);
 
55
        writel(0x80900003, IXP425_EXP_CS7);
 
56
 
 
57
        return 0;
 
58
}
 
59
 
 
60
int board_init(void)
 
61
{
 
62
        gd->bd->bi_arch_number = MACH_TYPE_ACTUX2;
 
63
 
 
64
        /* adress of boot parameters */
 
65
        gd->bd->bi_boot_params = 0x00000100;
 
66
 
 
67
        GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_IORST);
 
68
        GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_ETHRST);
 
69
        GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_DSR);
 
70
        GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_DCD);
 
71
 
 
72
        GPIO_OUTPUT_CLEAR(CONFIG_SYS_GPIO_IORST);
 
73
        GPIO_OUTPUT_CLEAR(CONFIG_SYS_GPIO_ETHRST);
 
74
 
 
75
        GPIO_OUTPUT_CLEAR(CONFIG_SYS_GPIO_DSR);
 
76
        GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_DCD);
 
77
 
 
78
        /* Setup GPIOs for Interrupt inputs */
 
79
        GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_DBGINT);
 
80
        GPIO_OUTPUT_DISABLE(CONFIG_SYS_GPIO_ETHINT);
 
81
 
 
82
        /* Setup GPIOs for 33MHz clock output */
 
83
        GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_PCI_CLK);
 
84
        GPIO_OUTPUT_ENABLE(CONFIG_SYS_GPIO_EXTBUS_CLK);
 
85
        writel(0x011001FF, IXP425_GPIO_GPCLKR);
 
86
 
 
87
        udelay(533);
 
88
        GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_IORST);
 
89
        GPIO_OUTPUT_SET(CONFIG_SYS_GPIO_ETHRST);
 
90
 
 
91
        ACTUX2_LED1(1);
 
92
        ACTUX2_LED2(0);
 
93
        ACTUX2_LED3(0);
 
94
        ACTUX2_LED4(0);
90
95
 
91
96
        return 0;
92
97
}
94
99
/*
95
100
 * Check Board Identity
96
101
 */
97
 
int checkboard (void)
 
102
int checkboard(void)
98
103
{
99
104
        char buf[64];
100
105
        int i = getenv_f("serial#", buf, sizeof(buf));
101
106
 
102
 
        puts ("Board: AcTux-2 rev.");
103
 
        putc (ACTUX2_BOARDREL + 'A' - 1);
 
107
        puts("Board: AcTux-2 rev.");
 
108
        putc(ACTUX2_BOARDREL + 'A' - 1);
104
109
 
105
110
        if (i > 0) {
106
111
                puts(", serial# ");
107
112
                puts(buf);
108
113
        }
109
 
        putc ('\n');
 
114
        putc('\n');
110
115
 
111
 
        return (0);
 
116
        return 0;
112
117
}
113
118
 
114
 
int dram_init (void)
 
119
int dram_init(void)
115
120
{
116
 
        gd->bd->bi_dram[0].start = PHYS_SDRAM_1;
117
 
        gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE;
118
 
 
119
 
        return (0);
 
121
        gd->ram_size = get_ram_size(CONFIG_SYS_SDRAM_BASE, 128<<20);
 
122
        return 0;
120
123
}
121
124
 
122
125
/*************************************************************************
125
128
 * 1 = Rev. A
126
129
 * 2 = Rev. B
127
130
 *************************************************************************/
128
 
u32 get_board_rev (void)
 
131
u32 get_board_rev(void)
129
132
{
130
133
        return ACTUX2_BOARDREL;
131
134
}
132
135
 
133
 
void reset_phy (void)
 
136
void reset_phy(void)
134
137
{
135
138
        /* init IcPlus IP175C ethernet switch to native IP175C mode */
136
 
        miiphy_write ("NPE0", 29, 31, 0x175C);
 
139
        miiphy_write("NPE0", 29, 31, 0x175C);
137
140
}