Re: [U-Boot] [PATCH] ARMV7: Add support For Logic OMAP35x/DM37x modules

2011-12-18 Thread Igor Grinberg
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.bar...@logicpd.com
 Cc: Tom Rini tom.r...@gmail.com
 Cc: Igor Grinberg grinb...@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 000..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;
 +}

[...]


-- 
Regards,
Igor.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARMV7: Add support For Logic OMAP35x/DM37x modules

2011-12-17 Thread Wolfgang Denk
Dear Peter Barada,

In message 1324067511-14142-1-git-send-email-peter.bar...@logicpd.com you 
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.bar...@logicpd.com
 Cc: Tom Rini tom.r...@gmail.com
 Cc: Igor Grinberg grinb...@compulab.co.il
...
  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

Entry to MAINTAINERS missing.

 +/* two dimensional array of strucures containining board name and Linux
 + * machine IDs; row it selected based on CPU column is slected based
 + * on hsusb0_data5 pin having a pulldown resistor */

Incorrect multiline comment style.  Please fix globally.


 +#ifdef CONFIG_SMC911X
 +/* GPMC CS1 settings for Logic SOM LV/Torpedo LAN92xx Ethernet chip */
 +static const u32 gpmc_lan92xx_config[] = {
 + 0x1000,
 + 0x00080801,
 + 0x,
 + 0x08010801,
 + 0x00080a0a,
 + 0x03000280,
 +};

And what exactly is the meaning of these magic numbers?


 +#define CONFIG_HARD_I2C  1
 +#define CONFIG_SYS_I2C_SPEED 10
 +#define CONFIG_SYS_I2C_SLAVE 1
 +#define CONFIG_SYS_I2C_BUS   0
 +#define CONFIG_SYS_I2C_BUS_SELECT1
 +#define CONFIG_I2C_MULTI_BUS 1
 +#define CONFIG_DRIVER_OMAP34XX_I2C   1

Please do not define values for macros that only switch on a feature.

...
 +#define CONFIG_PREBOOT \
 + echo ==NOTICE;\
 + echo The u-boot environment is not set. - You are;\
 + echo required to set a valid display for your LCD panel.; \
 + echo Valid display options are:;  \
 + echo \  2 == LQ121S1DG31 TFT SVGA(12.1)  Sharp\;\
 + echo \  3 == LQ036Q1DA01 TFT QVGA(3.6)   Sharp w/ASIC\; \
 + echo \  5 == LQ064D343   TFT VGA (6.4)   Sharp\;\
 + echo \  7 == LQ10D368TFT VGA (10.4)  Sharp\;\
 + echo \ 15 == LQ043T1DG01 TFT WQVGA   (4.3)   Sharp (DEFAULT)\; \
 + echo \ vga[-16 OR -24]   LCD VGA 640x480\;  \
 + echo \ svga[-16 OR -24]  LCD SVGA800x600\;  \
 + echo \ xga[-16 OR -24]   LCD XGA 1024x768\; \
 + echo \ 720p[-16 OR -24]  LCD 720P1280x720\; \
 + echo \ sxga[-16 OR -24]  LCD SXGA1280x1024\;\
 + echo \ uxga[-16 OR -24]  LCD UXGA1600x1200\;\
 + echo MAKE SURE YOUR DISPLAY VARIABLE IS CORRECTLY ENTERED!;   \
 + setenv display 15;\

Strange.  First you ask the user to set a valid display type, and then
you hard-set it to some predefined value.  What's the reationale
behind that?

 + setenv preboot;   \
 + saveenv;

Would it not be better to erase the preboot setting only after some
display type definition was entered and saved _by_the_user_ ?

 +/*---
 + * Physical Memory Map
 + */

Incorrect multiline comment style. Please fix globally.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If all the Chinese simultaneously jumped into the Pacific  off  a  10
foot platform erected 10 feet off their coast, it would cause a tidal
wave that would destroy everything in this country west of Nebraska.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ARMV7: Add support For Logic OMAP35x/DM37x modules

2011-12-16 Thread Peter Barada
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.bar...@logicpd.com
Cc: Tom Rini tom.r...@gmail.com
Cc: Igor Grinberg grinb...@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/Makefile b/board/logicpd/omap3som/Makefile
new file mode 100644
index 000..75e237b
--- /dev/null
+++ b/board/logicpd/omap3som/Makefile
@@ -0,0 +1,42 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS-y:= omap3logic.o
+
+COBJS  := $(sort $(COBJS-y))
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
diff --git a/board/logicpd/omap3som/omap3logic.c 
b/board/logicpd/omap3som/omap3logic.c
new file mode 100644
index 000..eb051db
--- /dev/null
+++ b/board/logicpd/omap3som/omap3logic.c
@@ -0,0 +1,523 @@
+/*
+ * (C) Copyright 2011
+ * Logic Product Development www.logicpd.com
+ *
+ * Author :
+ * Peter Barada peter.bar...@logicpd.com
+ *
+ * Derived from Beagle Board and 3430 SDP code by
+ * Richard Woodruff r-woodru...@ti.com
+ * Syed Mohammed Khasim kha...@ti.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#include common.h
+#include netdev.h
+#include flash.h
+#include nand.h
+#include i2c.h
+#include twl4030.h
+#include asm/io.h
+#include asm/arch/mmc_host_def.h
+#include asm/arch/mux.h
+#include asm/arch/mem.h
+#include asm/arch/sys_proto.h
+#include 

Re: [U-Boot] [PATCH] ARMV7: Add support For Logic OMAP35x/DM37x modules

2011-12-16 Thread Peter Barada
On 12/16/2011 03:31 PM, 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.
[snip]

My apologies, I forgot to change the subject to [PATCH V3], but as the
commentary indicates, it is V3.  I'm still getting used to git send-email...

-- 
Peter Barada
peter.bar...@logicpd.com

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARMV7: Add support For Logic OMAP35x/DM37x modules

2011-12-16 Thread Tom Rini
On Fri, Dec 16, 2011 at 1:31 PM, Peter Barada peter.bar...@logicpd.com 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.bar...@logicpd.com
 Cc: Tom Rini tom.r...@gmail.com
 Cc: Igor Grinberg grinb...@compulab.co.il
[snip]
 +#ifdef CONFIG_SMC911X
 +/* GPMC CS1 settings for Logic SOM LV/Torpedo LAN92xx Ethernet chip */
 +static const u32 gpmc_lan92xx_config[] = {
 +       0x1000,
 +       0x00080801,
 +       0x,
 +       0x08010801,
 +       0x00080a0a,
 +       0x03000280,
 +};

The correct form here is #define NET_LAN92XX_GPMC_CONFIGn 0x... in
board.h and then ref them here.

And feel free to wait a little before spinning v4 incase others have
comments.  Assuming it's just this (or some other trivial comments)
that change in v4 I'll put that v4 into u-boot-ti/next early next
week.  Thanks for turning around on the feedback quickly!

-- 
Tom
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot