parent
d0c6323c7f
commit
ca236db944
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* board.c
|
||||
*
|
||||
* Board functions for Netmodule NRHW 24, based on AM335x EVB
|
||||
* Board functions for Netmodule HW 25, based on AM335x EVB
|
||||
*
|
||||
* Copyright (C) 2018-2020 NetModule AG - http://www.netmodule.com/
|
||||
* Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
|
||||
|
|
@ -100,7 +100,8 @@ DECLARE_GLOBAL_DATA_PTR;
|
|||
* GPIO_10: LED.LWR
|
||||
* GPIO_11: LED.UPR
|
||||
*/
|
||||
|
||||
// TODO: Can we use more meaningful names instead of upper, lower?
|
||||
// TODO: What are the functions?
|
||||
#define PMIC_GSM_SUPPLY_EN_IO 7
|
||||
#define PMIC_LED0 10 /* Lower */
|
||||
#define PMIC_LED1 11 /* Upper */
|
||||
|
|
@ -164,6 +165,9 @@ static void init_leds(void)
|
|||
/* No init code required */
|
||||
}
|
||||
|
||||
// TODO: Double check how LEDs shall be used
|
||||
// TODO: Netmodule use of status/indicator might not be what customer expects
|
||||
// TODO: Can we check with Marcel from Timeserver project?
|
||||
static void set_status_led(int red, int green)
|
||||
{
|
||||
int bus;
|
||||
|
|
@ -249,6 +253,8 @@ static inline int __maybe_unused read_eeprom(void)
|
|||
|
||||
#ifndef CONFIG_SKIP_LOWLEVEL_INIT
|
||||
|
||||
// TODO: Double check training values. See
|
||||
/* \\netmodule.intranet\nm\projects\NM-Router\9100098_NRHW_24_NB800_Facelift\06_sw_engineering\DDR3_Testing_Calibration */
|
||||
static const struct ddr_data ddr3_data = {
|
||||
/* Ratios were optimized by DDR3 training software from TI */
|
||||
.datardsratio0 = 0x39, /* 0x39 */
|
||||
|
|
@ -285,6 +291,9 @@ struct dpll_params dpll_ddr = {
|
|||
DDR3_CLOCK_FREQUENCY, OSC-1, 1, -1, -1, -1, -1
|
||||
};
|
||||
|
||||
// TODO: Since there is no ignition logic (with edge generator) on hw25
|
||||
// TODO: the following is not required
|
||||
#if 0
|
||||
static void pmic_ignition_gate_on(void)
|
||||
{
|
||||
uint8_t val;
|
||||
|
|
@ -305,6 +314,7 @@ static void pmic_ignition_gate_on(void)
|
|||
val |= 0xC0;
|
||||
(void)da9063_set_reg(PMIC_REG_GPIO_MODE8_15, val);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void init_pmic_spl(void)
|
||||
{
|
||||
|
|
@ -315,7 +325,9 @@ static void init_pmic_spl(void)
|
|||
|
||||
bus = da9063_claim_i2c_bus();
|
||||
|
||||
pmic_ignition_gate_on();
|
||||
// TODO: Since there is no ignition logic (with edge generator) on hw25
|
||||
// TODO: the following is not required
|
||||
// pmic_ignition_gate_on();
|
||||
|
||||
/* Enable charging of RTC backup capacitor (1mA, 3.1V) */
|
||||
(void)da9063_set_reg(PMIC_REG_BBAT_CONT, 0xAF);
|
||||
|
|
@ -600,6 +612,7 @@ int board_init(void)
|
|||
da9063_init(CONFIG_PMIC_I2C_BUS);
|
||||
|
||||
/* Let user know we're starting */
|
||||
// TODO: Check LED behaviour
|
||||
init_leds();
|
||||
set_status_led(1, 1); /* Orange */
|
||||
set_indicator_led(0, 0); /* Off */
|
||||
|
|
@ -628,12 +641,6 @@ void set_console(void)
|
|||
setenv("defaultconsole", "ttyS0");
|
||||
}
|
||||
|
||||
/*
|
||||
* Always use internal console for u-boot
|
||||
* as COM/IO shield is not ready at that time.
|
||||
* (Needs to be initialized first using the
|
||||
* shieldcmd that is run by bootcmd.)
|
||||
*/
|
||||
serial_set_console_index(1);
|
||||
|
||||
#if defined(CONFIG_PRE_CONSOLE_BUFFER)
|
||||
|
|
@ -794,6 +801,7 @@ static void blink_led(int pulses)
|
|||
set_status_led(1, 1); /* Orange */
|
||||
}
|
||||
|
||||
// TODO: Double check against specification, TC Router
|
||||
static void check_reset_button(void)
|
||||
{
|
||||
int counter = 0;
|
||||
|
|
|
|||
|
|
@ -111,6 +111,8 @@ int eth_phy_timeout(void);
|
|||
#define MAIN_BOOTCMD "run sdboot"
|
||||
#endif
|
||||
|
||||
// TODO: Might need to check ti_cpsw.rx_packet_max when running on top of AM335x switch
|
||||
|
||||
#define CONFIG_EXTRA_ENV_SETTINGS \
|
||||
/* Memory Adresses */ \
|
||||
"fdt_addr_r=" FDT_ADDR_R "\0" \
|
||||
|
|
@ -132,7 +134,7 @@ int eth_phy_timeout(void);
|
|||
"serverip=192.168.1.254\0" \
|
||||
"tftptimeout=2000\0" \
|
||||
"tftptimeoutcountmax=5\0" \
|
||||
"bootpretryperiod=10000\0" /* 2000 */ \
|
||||
"bootpretryperiod=10000\0" \
|
||||
"autoload=false\0" \
|
||||
\
|
||||
/* OSTree boot */ \
|
||||
|
|
@ -184,8 +186,17 @@ int eth_phy_timeout(void);
|
|||
#define CONFIG_ZERO_BOOTDELAY_CHECK
|
||||
|
||||
/* UART Configuration */
|
||||
#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0: XModem Boot, Shield */
|
||||
#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1: Debug UART (Internal) */
|
||||
#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* UART0: XModem Boot, Debug UART */
|
||||
|
||||
/* TODO: Preparation in case UART5 shall be used later */
|
||||
#if 0
|
||||
#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1: Unused, see note below */
|
||||
#define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2: Unused, see note below */
|
||||
/* NOTE: NS16550 definitions are cumulative, need to set COM2 to have COM3 */
|
||||
#define CONFIG_SYS_NS16550_COM4 0x481A6000 /* UART3: - */
|
||||
#define CONFIG_SYS_NS16550_COM5 0x481A8000 /* UART4: - */
|
||||
#define CONFIG_SYS_NS16550_COM6 0x481AA000 /* UART5: User UART */
|
||||
#endif
|
||||
|
||||
#define CONFIG_I2C
|
||||
#define CONFIG_I2C_MULTI_BUS
|
||||
|
|
|
|||
Loading…
Reference in New Issue