Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6: (30 commits)
  Blackfin serial driver: supporting BF548-EZKIT serial port
  Video Console: Blackfin doesnt support VGA console
  Blackfin arch: Add peripheral io API to gpio header file
  Blackfin arch: set up gpio interrupt IRQ_PJ9 for BF54x ATAPI PATA driver
  Blackfin arch: add missing CONFIG_LARGE_ALLOCS when upstream merging
  Blackfin arch: as pointed out by Robert P. J. Day, update the CPU_FREQ name to match current Kconfig
  Blackfin arch: extract the entry point from the linked kernel
  Blackfin arch: clean up some coding style issues
  Blackfin arch: combine the common code of free_initrd_mem and free_initmem
  Blackfin arch: Add Support for Peripheral PortMux and resouce allocation
  Blackfin arch: use PAGE_SIZE when doing aligns rather than hardcoded values
  Blackfin arch: fix bug set dma_address properly in dma_map_sg
  Blackfin arch: Disable CACHELINE_ALIGNED_L1 for BF54x by default
  Blackfin arch: Port the dm9000 driver to Blackfin by using the correct low-level io routines
  Blackfin arch: There is no CDPRIO Bit in the EBIU_AMGCTL Register of BF54x arch
  Blackfin arch: scrub dead code
  Blackfin arch: Fix Warning add some defines in BF54x header file
  Blackfin arch: add BF54x missing GPIO access functions
  Blackfin arch: Some memory and code optimizations - Fix SYS_IRQS
  Blackfin arch: Enable BF54x PIN/GPIO interrupts
  ...
  • Loading branch information
Linus Torvalds committed Jul 12, 2007
2 parents 068345f + f4d640c commit 82afee6
Show file tree
Hide file tree
Showing 121 changed files with 9,767 additions and 3,904 deletions.
155 changes: 155 additions & 0 deletions Documentation/blackfin/kgdb.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
A Simple Guide to Configure KGDB

Sonic Zhang <sonic.zhang@analog.com>
Aug. 24th 2006


This KGDB patch enables the kernel developer to do source level debugging on
the kernel for the Blackfin architecture. The debugging works over either the
ethernet interface or one of the uarts. Both software breakpoints and
hardware breakpoints are supported in this version.
http://docs.blackfin.uclinux.org/doku.php?id=kgdb


2 known issues:
1. This bug:
http://blackfin.uclinux.org/tracker/index.php?func=detail&aid=544&group_id=18&atid=145
The GDB client for Blackfin uClinux causes incorrect values of local
variables to be displayed when the user breaks the running of kernel in GDB.
2. Because of a hardware bug in Blackfin 533 v1.0.3:
05000067 - Watchpoints (Hardware Breakpoints) are not supported
Hardware breakpoints cannot be set properly.


Debug over Ethernet:

1. Compile and install the cross platform version of gdb for blackfin, which
can be found at $(BINROOT)/bfin-elf-gdb.

2. Apply this patch to the 2.6.x kernel. Select the menuconfig option under
"Kernel hacking" -> "Kernel debugging" -> "KGDB: kernel debug with remote gdb".
With this selected, option "Full Symbolic/Source Debugging support" and
"Compile the kernel with frame pointers" are also selected.

3. Select option "KGDB: connect over (Ethernet)". Add "kgdboe=@target-IP/,@host-IP/" to
the option "Compiled-in Kernel Boot Parameter" under "Kernel hacking".

4. Connect minicom to the serial port and boot the kernel image.

5. Configure the IP "/> ifconfig eth0 target-IP"

6. Start GDB client "bfin-elf-gdb vmlinux".

7. Connect to the target "(gdb) target remote udp:target-IP:6443".

8. Set software breakpoint "(gdb) break sys_open".

9. Continue "(gdb) c".

10. Run ls in the target console "/> ls".

11. Breakpoint hits. "Breakpoint 1: sys_open(..."

12. Display local variables and function paramters.
(*) This operation gives wrong results, see known issue 1.

13. Single stepping "(gdb) si".

14. Remove breakpoint 1. "(gdb) del 1"

15. Set hardware breakpoint "(gdb) hbreak sys_open".

16. Continue "(gdb) c".

17. Run ls in the target console "/> ls".

18. Hardware breakpoint hits. "Breakpoint 1: sys_open(...".
(*) This hardware breakpoint will not be hit, see known issue 2.

19. Continue "(gdb) c".

20. Interrupt the target in GDB "Ctrl+C".

21. Detach from the target "(gdb) detach".

22. Exit GDB "(gdb) quit".


Debug over the UART:

1. Compile and install the cross platform version of gdb for blackfin, which
can be found at $(BINROOT)/bfin-elf-gdb.

2. Apply this patch to the 2.6.x kernel. Select the menuconfig option under
"Kernel hacking" -> "Kernel debugging" -> "KGDB: kernel debug with remote gdb".
With this selected, option "Full Symbolic/Source Debugging support" and
"Compile the kernel with frame pointers" are also selected.

3. Select option "KGDB: connect over (UART)". Set "KGDB: UART port number" to be
a different one from the console. Don't forget to change the mode of
blackfin serial driver to PIO. Otherwise kgdb works incorrectly on UART.

4. If you want connect to kgdb when the kernel boots, enable
"KGDB: Wait for gdb connection early"

5. Compile kernel.

6. Connect minicom to the serial port of the console and boot the kernel image.

7. Start GDB client "bfin-elf-gdb vmlinux".

8. Set the baud rate in GDB "(gdb) set remotebaud 57600".

9. Connect to the target on the second serial port "(gdb) target remote /dev/ttyS1".

10. Set software breakpoint "(gdb) break sys_open".

11. Continue "(gdb) c".

12. Run ls in the target console "/> ls".

13. A breakpoint is hit. "Breakpoint 1: sys_open(..."

14. All other operations are the same as that in KGDB over Ethernet.


Debug over the same UART as console:

1. Compile and install the cross platform version of gdb for blackfin, which
can be found at $(BINROOT)/bfin-elf-gdb.

2. Apply this patch to the 2.6.x kernel. Select the menuconfig option under
"Kernel hacking" -> "Kernel debugging" -> "KGDB: kernel debug with remote gdb".
With this selected, option "Full Symbolic/Source Debugging support" and
"Compile the kernel with frame pointers" are also selected.

3. Select option "KGDB: connect over UART". Set "KGDB: UART port number" to console.
Don't forget to change the mode of blackfin serial driver to PIO.
Otherwise kgdb works incorrectly on UART.

4. If you want connect to kgdb when the kernel boots, enable
"KGDB: Wait for gdb connection early"

5. Connect minicom to the serial port and boot the kernel image.

6. (Optional) Ask target to wait for gdb connection by entering Ctrl+A. In minicom, you should enter Ctrl+A+A.

7. Start GDB client "bfin-elf-gdb vmlinux".

8. Set the baud rate in GDB "(gdb) set remotebaud 57600".

9. Connect to the target "(gdb) target remote /dev/ttyS0".

10. Set software breakpoint "(gdb) break sys_open".

11. Continue "(gdb) c". Then enter Ctrl+C twice to stop GDB connection.

12. Run ls in the target console "/> ls". Dummy string can be seen on the console.

13. Then connect the gdb to target again. "(gdb) target remote /dev/ttyS0".
Now you will find a breakpoint is hit. "Breakpoint 1: sys_open(..."

14. All other operations are the same as that in KGDB over Ethernet. The only
difference is that after continue command in GDB, please stop GDB
connection by 2 "Ctrl+C"s and connect again after breakpoints are hit or
Ctrl+A is entered.
59 changes: 56 additions & 3 deletions arch/blackfin/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ config GENERIC_CALIBRATE_DELAY

config IRQCHIP_DEMUX_GPIO
bool
depends on (BF53x || BF561 || BF54x)
default y

source "init/Kconfig"
Expand Down Expand Up @@ -114,6 +115,26 @@ config BF537
help
BF537 Processor Support.

config BF542
bool "BF542"
help
BF542 Processor Support.

config BF544
bool "BF544"
help
BF544 Processor Support.

config BF548
bool "BF548"
help
BF548 Processor Support.

config BF549
bool "BF549"
help
BF549 Processor Support.

config BF561
bool "BF561"
help
Expand All @@ -125,6 +146,11 @@ choice
prompt "Silicon Rev"
default BF_REV_0_2 if BF537
default BF_REV_0_3 if BF533
default BF_REV_0_0 if BF549

config BF_REV_0_0
bool "0.0"
depends on (BF549)

config BF_REV_0_2
bool "0.2"
Expand All @@ -150,6 +176,16 @@ config BF_REV_NONE

endchoice

config BF53x
bool
depends on (BF531 || BF532 || BF533 || BF534 || BF536 || BF537)
default y

config BF54x
bool
depends on (BF542 || BF544 || BF548 || BF549)
default y

config BFIN_DUAL_CORE
bool
depends on (BF561)
Expand Down Expand Up @@ -198,6 +234,12 @@ config BFIN537_BLUETECHNIX_CM
help
CM-BF537 support for EVAL- and DEV-Board.

config BFIN548_EZKIT
bool "BF548-EZKIT"
depends on (BF548 || BF549)
help
BFIN548-EZKIT board Support.

config BFIN561_BLUETECHNIX_CM
bool "Bluetechnix CM-BF561"
depends on (BF561)
Expand Down Expand Up @@ -265,6 +307,7 @@ config BFIN_SHARED_FLASH_ENET
source "arch/blackfin/mach-bf533/Kconfig"
source "arch/blackfin/mach-bf561/Kconfig"
source "arch/blackfin/mach-bf537/Kconfig"
source "arch/blackfin/mach-bf548/Kconfig"

menu "Board customizations"

Expand Down Expand Up @@ -497,7 +540,8 @@ config IP_CHECKSUM_L1

config CACHELINE_ALIGNED_L1
bool "Locate cacheline_aligned data to L1 Data Memory"
default y
default y if !BF54x
default n if BF54x
depends on !BF531
help
If enabled cacheline_anligned data is linked
Expand Down Expand Up @@ -541,9 +585,17 @@ endchoice

source "mm/Kconfig"

config LARGE_ALLOCS
bool "Allow allocating large blocks (> 1MB) of memory"
help
Allow the slab memory allocator to keep chains for very large
memory sizes - upto 32MB. You may need this if your system has
a lot of RAM, and you need to able to allocate very large
contiguous chunks. If unsure, say N.

config BFIN_DMA_5XX
bool "Enable DMA Support"
depends on (BF533 || BF532 || BF531 || BF537 || BF536 || BF534 || BF561)
depends on (BF533 || BF532 || BF531 || BF537 || BF536 || BF534 || BF561 || BF54x)
default y
help
DMA driver for BF5xx.
Expand Down Expand Up @@ -686,6 +738,7 @@ config C_AMCKEN

config C_CDPRIO
bool "DMA has priority over core for ext. accesses"
depends on !BF54x
default n

config C_B0PEN
Expand Down Expand Up @@ -839,7 +892,7 @@ endchoice

endmenu

if (BF537 || BF533)
if (BF537 || BF533 || BF54x)

menu "CPU Frequency scaling"

Expand Down
2 changes: 2 additions & 0 deletions arch/blackfin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ machine-$(CONFIG_BF533) := bf533
machine-$(CONFIG_BF534) := bf537
machine-$(CONFIG_BF536) := bf537
machine-$(CONFIG_BF537) := bf537
machine-$(CONFIG_BF548) := bf548
machine-$(CONFIG_BF549) := bf548
machine-$(CONFIG_BF561) := bf561
MACHINE := $(machine-y)
export MACHINE
Expand Down
3 changes: 2 additions & 1 deletion arch/blackfin/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ extra-y += vmlinux.bin vmlinux.gz

quiet_cmd_uimage = UIMAGE $@
cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A $(ARCH) -O linux -T kernel \
-C gzip -a $(CONFIG_BOOT_LOAD) -e $(CONFIG_BOOT_LOAD) -n 'Linux-$(KERNELRELEASE)' \
-C gzip -n 'Linux-$(KERNELRELEASE)' -a $(CONFIG_BOOT_LOAD) \
-e $(shell $(NM) vmlinux | awk '$$NF == "__start" {print $$1}') \
-d $< $@

$(obj)/vmlinux.bin: vmlinux FORCE
Expand Down
Loading

0 comments on commit 82afee6

Please sign in to comment.