All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Wozniak <awozniak@mc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Custom Board configuration
Date: Wed, 08 Jun 2005 10:29:44 -0400	[thread overview]
Message-ID: <42A700D8.2060102@mc.com> (raw)
In-Reply-To: <20050608130217.543E6C1512@atlas.denx.de>

Wolfgang Denk wrote:
> In message <000101c56c28$4af32eb0$f201a8c0@SN7606> you wrote:
> 
>>need a minimal configuration for booting with u-boot. Is there anywhere a
>>guide or some information what i have to do?!
> 
> 
> I recommend you start with the README, probably section "Porting
> Guide" or so...

cute porting guide - read it anyway.

Here's how I approached our port of a custom PPC440gx board.

- first of all, try to understand the general initialization of U-Boot
- get and install PPC4xx compiler and tools
- setup/use ctags or cscope with a compatible editor
- find and choose an existing U-Boot port that resembles your target
- if target has a JTAG interface, acquire a JTAG debugger
- modify the memory settings of the baseline port you've chosen - I 
used OCOTEA port
- edit the config file for your target (OCOTEA.h). see the README for 
additional entries
- adjust Makefile to pickup your compiler properly
- build it:
make mrproper
make OCOTEA_config
make dep
make
- if build works, verify the .map output fits your target memory layout
- install u-boot.bin and single step via JTAG, see how far you get
- get GDB/DDD hooked up to your BDM JTAG pod
- convert/copy the OCOTEA build target to your own; create a 
board/your_target directory and include/configs/YOUR_TARGET.h
- rebuild as before but with YOUR_TARGET_config
- replace/remove any OCOTEA specific (FPGA) init functions
- get the console I/O, RTC... working
- turn on DEBUG statements to see what is running
- get the rest of the U-Boot commands working thru a combination of JTAG 
and printfs
- document the initialization that you see happening - see my attached 
logfile. it has lot of extra info that may not apply to your target. I'm 
not responsible for any inaccuracies ;)
- don't forget to dig thru the READMEs and source code. It is helpful to 
some degree.

> Best regards,
> 
> Wolfgang Denk
> 

=================================================================================
# logfile	general boot sequence for PPC440GX target
#
# 2005-03-28	Andrew Wozniak, initial draft

_start_440()                             cpu/ppc4xx/start.S
   _start_440
   ...Initialize debug registers
   ...CCR0 init
   ...Setup interrupt vectors at 0x0000_0000
   ...config cache regions
   ...clear and setup TLBs
   ...SDRAM fast refresh
   ...jump to _start
   ...setup ISRAM
   ...setup stack within ISRAM
   ...ready to run "C" level init code
   ...jump to board_init_f		jump to "C" level code

   board_init_f()			lib_ppc/board.c

     init_sequence[]
       board_early_init_f()              board/ocotea/ocotea.c
         ...init OCOTEA FPGA network ops
         ...setup CSO for Flash		setup Flash chip select
         ...setup UIC 			setup interrupt controller
       get_clocks,			get CPU clock info from GD
       init_timebase,
       env_init,				validate CRC, point to env space or hard coded dflt
       init_baudrate,
       serial_init,
       console_init_f,	
       display_options,			display U-Boot name and version info
       checkcpu,				update CPU rev info
       checkboard,			display CPU clock details
         get_sys_info(&sysinfo)
         printf(...)

       init_func_i2c,
       init_func_ram,
         init_dram()
           fixed_sdram()			ocotea.c - memory controller setup/timimg
     end of init[]

     ...init gd (global data) values
     ...allocate stack memory
     ...reserve memory for data, BSS
     ...reserve memory for malloc
     ...allocate/copy global data structure
     ...setup stack
     ...save board info structure
     ...run optional post

     relocate_code()                     cpu/ppc4xx/start.S
       ...copy self to RAM

   board_init_r()                        lib_ppc/board.c
     trap_init()				setup trap handlers	cpu/ppc4xx/start.S
     flash_init()			setup structures, protect monitor & envars
     cpu_init_r()			initialize high-level parts of CPU; time base and timers
     env_relocate()
     s = get_env("ethaddr")		MAC address	( lib_ppc/board.c)
     getenv_IPaddr ("ipaddr")
     pci_init()
     devices_init()
     console_init_r()
     misc_init_r()                    	platform specific
     reset_phy ()
     interrupt_init()			Enable Interrupts	lib_ppc/interrupts.c
       interrupt_init_cpu()		cpu/ppc4xx/interrupts.c

     eth_initialize()                 	net/eth.c
       ppc_440x_eth_initialize()      	cpu/ppc4xx/440gx_enet.c
         ppc_440x_eth_init()		also read SROM for MAC values

       compare SROM and envar MAC values
	print if diff

     for (;;)
       main_loop()                      	u-boot monitor	common/main.c
       ...
       ...
       getenv ("bootdelay")
       run_command(getenv ("bootcmd"))
       for(;;)
         readline()
         run_command()

  reply	other threads:[~2005-06-08 14:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-08 12:47 [U-Boot-Users] Custom Board configuration David Grab
2005-06-08 13:02 ` Wolfgang Denk
2005-06-08 14:29   ` Andrew Wozniak [this message]
2005-06-08 20:12     ` Wolfgang Denk
2005-06-09 14:25       ` AW: " David Grab
2005-06-09 15:01         ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2005-06-08 13:03 Fillod Stephane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42A700D8.2060102@mc.com \
    --to=awozniak@mc.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.