2 * U-Boot - main board file for BCT brettl2
4 * Copyright (c) 2010 BCT Electronic GmbH
6 * Licensed under the GPL-2 or later.
12 #include <asm/blackfin.h>
13 #include <asm/portmux.h>
19 #include "../cm-bf537e/gpio_cfi_flash.h"
22 DECLARE_GLOBAL_DATA_PTR;
26 printf("Board: bct-brettl2 board\n");
27 printf(" Support: http://www.bct-electronic.com/\n");
31 #ifdef CONFIG_BFIN_MAC
32 int board_eth_init(bd_t *bis)
37 ret = bfin_EMAC_initialize(bis);
40 if (eth_getenv_enetaddr("ethaddr", enetaddr)) {
41 printf("setting MAC %pM\n", enetaddr);
45 puts("initialize SMSC LAN9303i ethernet switch\n");
48 if (init_smsc9303i_mii())
56 static void init_tlv320aic31(void)
58 puts("Audio: setup TIMER0 to enable 16.384 MHz clock for tlv320aic31\n");
59 peripheral_request(P_TMR0, "tlv320aic31 clock");
60 bfin_write_TIMER0_CONFIG(0x020d);
61 bfin_write_TIMER0_PERIOD(0x0008);
62 bfin_write_TIMER0_WIDTH(0x0008/2);
63 bfin_write_TIMER_ENABLE(bfin_read_TIMER_ENABLE() | 1);
67 puts(" resetting tlv320aic31\n");
69 gpio_request(GPIO_PF2, "tlv320aic31");
70 gpio_direction_output(GPIO_PF2, 0);
72 gpio_direction_output(GPIO_PF2, 1);
77 static void init_mute_pin(void)
79 printf(" unmute class D amplifier\n");
81 gpio_request(GPIO_PF5, "mute");
82 gpio_direction_output(GPIO_PF5, 1);
86 /* sometimes LEDs (speech, status) are still on after reboot, turn 'em off */
87 static void turn_leds_off(void)
89 printf(" turn LEDs off\n");
91 gpio_request(GPIO_PF6, "led");
92 gpio_direction_output(GPIO_PF6, 0);
95 gpio_request(GPIO_PF15, "led");
96 gpio_direction_output(GPIO_PF15, 0);
100 /* miscellaneous platform dependent initialisations */
101 int misc_init_r(void)
103 gpio_cfi_flash_init();