
Hi Peter,
Some comments (hopefully last ones) in addition to Wolfgang's and Tom's:
On 12/16/11 22:31, Peter Barada wrote:
This patch adds basic support for OMAP35x/DM37x SOM LV/Torpedo reference boards. It assumes U-boot is loaded to SDRAM with the help of another small bootloader (x-load) running from SRAM.
Signed-off-by: Peter Barada peter.barada@logicpd.com Cc: Tom Rini tom.rini@gmail.com Cc: Igor Grinberg grinberg@compulab.co.il
Changes for V3: Inline identify_board() into board_init() Remove triple empty lines Use sdelay() instead of naked delay loop Use enable_gpmc_cs_config() to setup GPMC CS1 access to LAN92xx Remove CONFIG_L2_OFF - holdover from previous work in u-boot-2011.06 where adding 270p 32bpp frambuffer support cause failure while booting linux kernel. Will address when I add video support Reduce CONFIG_SYS_MAXARGS to 16
Changes for V2: Rework logic_identify() into identify_board() - can't use checkboard() since its enabled by CONFIG_DISPLAY_BOARDINFO Properly indent comments in set_muxconf_regs() Move setup_net_chip() call from misc_init_r to board_eth_init() Remove triple empty line spacing Pass gpio_request(189) non-empty description Remove board/logicpd/omap3som/config.mk Remove clean/distclean from board/logicpd/omap3som/Makefile Modify board_mmc_init() to be one line function Modify include/configs/omap3_logic.h to use on/off #defines
board/logicpd/omap3som/Makefile | 42 +++ board/logicpd/omap3som/omap3logic.c | 523 +++++++++++++++++++++++++++++++++++ board/logicpd/omap3som/omap3logic.h | 35 +++ boards.cfg | 1 + include/configs/omap3_logic.h | 351 +++++++++++++++++++++++ 5 files changed, 952 insertions(+), 0 deletions(-) create mode 100644 board/logicpd/omap3som/Makefile create mode 100644 board/logicpd/omap3som/omap3logic.c create mode 100644 board/logicpd/omap3som/omap3logic.h create mode 100644 include/configs/omap3_logic.h
[...]
diff --git a/board/logicpd/omap3som/omap3logic.c b/board/logicpd/omap3som/omap3logic.c new file mode 100644 index 0000000..eb051db --- /dev/null +++ b/board/logicpd/omap3som/omap3logic.c
[...]
+/*
- Routine: board_init
- Description: Early hardware init.
- */
+int board_init(void) +{
- struct board_id *board;
- unsigned int val;
- gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
- /* boot param addr */
- gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
- /*
* To identify between a SOM LV and Torpedo module,
* a pulldown resistor is on hsusb0_data5 for the SOM LV module.
* Drive the pin (and let it soak), then read it back.
* If the pin is still high its a Torpedo. If low its a SOM LV
*/
- /* Mux hsusb0_data5 as a GPIO */
- MUX_VAL(CP(HSUSB0_DATA5), (IEN | PTD | DIS | M4));
- if (gpio_request(GPIO_189, "husb0_data5.gpio_189") == 0) {
Usually, by the label goes the functionality it is used for in current request, but af course it is up to you, it is not a blocker as long as the label is valid.
/* Drive GPIO_189 - the pulldown resistor on the SOM LV
* will drain the voltage */
incorrect multi-line comment (fix globally) and probably, the empty line before it can be removed.
gpio_direction_output(GPIO_189, 0);
gpio_set_value(GPIO_189, 1);
/* Let it soak for a bit */
sdelay(0x100);
/* Read state of GPIO_189 as an input and if its set.
* If so the board is a Torpedo */
gpio_direction_input(GPIO_189);
val = gpio_get_value(GPIO_189);
gpio_free(GPIO_189);
board = &boards[!!(get_cpu_family() == CPU_OMAP36XX)][!!val];
printf("Board: %s\n", board->name);
/* Set the machine_id passed to Linux */
gd->bd->bi_arch_number = board->machine_id;
- }
- /* restore hsusb0_data5 pin as hsusb0_data5 */
- MUX_VAL(CP(HSUSB0_DATA5), (IEN | PTD | DIS | M0));
- return 0;
+}
[...]
+/*
- Routine: misc_init_r
- Description: Init ethernet (done here so udelay works)
Function changed, comment left...
- */
+int misc_init_r(void) +{
- dieid_num_r();
- return 0;
+}
[...]