LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* initrd rootfs ramdisk
From: David Grab @ 2005-07-05  6:36 UTC (permalink / raw)
  To: linuxppc-embedded

Good morning,

i solved my problem last problem and now i get console output. :) So next
step is to setup the root file system. I want to use an image loaded into
ramdisk, but seems i´m missing something. I´m using u-boot to load the
ramdisk and linux kernel. Actually i don´t know how the kernel gets the
location of the loaded ramdisk. I only added the support (see Kernel
configuration) and the command line parameter root=/dev/ram rw. But the boot
command arguments from u-boot seems not recognized from the linux kernel.
Should the option CONFIG_BOOT_LOAD point on the address of the ramdisk? I
hope someone could help me to trigger out my problem.

Thanks and Best regards,

David



Console output:

## Booting image at ff000000 ...
   Image Name:   Linux-2.6.11.6
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    657688 Bytes = 642.3 kB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
## Current stack ends at 0x1FF9DB40 => set upper limit to 0x00800000
## cmdline at 0x007FFF00 ... 0x007FFF10
bd address  = 0x1FF9DF54
memstart    = 0x00000000
memsize     = 0x20000000
flashstart  = 0xFF000000
flashsize   = 0x01000000
flashoffset = 0x00000000
sramstart   = 0x00000000
sramsize    = 0x00000000
bootflags   = 0x0A080007
intfreq     =    500 MHz
busfreq     = 166.666 MHz
ethaddr     = 00:04:AC:E3:28:8A
eth1addr    = 00:04:AC:E3:28:8B
eth2addr    = 00:04:AC:E3:28:8C
eth3addr    = 00:04:AC:E3:28:8D
IP addr     = 192.168.0.116
baudrate    = 115200 bps
## Loading RAMDisk Image at ff800000 ...
   Image Name:   Test Ramdisk
   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)
   Data Size:    1629365 Bytes =  1.6 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## initrd at 0xFF800040 ... 0xFF98DCF4 (len=1629365=0x18DCB5)
   Loading Ramdisk to 1fe0f000, end 1ff9ccb5 ... OK
## Transferring control to Linux (at address 00000000) ...
Linux version 2.6.11.6 (david@FedoraDG) (gcc-Version 3.3.3 (DENX ELDK 3.1
3.3.3-8)) #1 Mon Jul 4 07:34:21 CEST 2005
IBM
Built 1 zonelists
Kernel command line: root=/dev/ram rw ip=on console=ttyS1,115200
PID hash table entries: 4096 (order: 12, 65536 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 517760k available (996k kernel code, 352k data, 96k init, 0k
highmem)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
Linux NoNET1.0 for Linux 2.6
PCI: Probing PCI hardware
SCSI subsystem initialized
Serial: 8250/16550 driver $Revision: 1.90 $ 6 ports, IRQ sharing enabled
ttyS0 at MMIO 0x0 (irq = 0) is a 16550A
ttyS1 at MMIO 0x0 (irq = 1) is a 16550A
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(1,0)
 <0>Rebooting in 180 seconds..


Kernel configuration:

#
# Automatically generated make config: don't edit
#
CONFIG_MMU=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_HAVE_DEC_LOCK=y
CONFIG_PPC=y
CONFIG_PPC32=y
CONFIG_GENERIC_NVRAM=y

#
# Code maturity level options
#
CONFIG_EXPERIMENTAL=y
CONFIG_CLEAN_COMPILE=y
# CONFIG_STANDALONE is not set
CONFIG_BROKEN_ON_SMP=y

#
# General setup
#
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
# CONFIG_POSIX_MQUEUE is not set
# CONFIG_BSD_PROCESS_ACCT is not set
CONFIG_SYSCTL=y
# CONFIG_AUDIT is not set
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_HOTPLUG is not set
# CONFIG_IKCONFIG is not set
CONFIG_EMBEDDED=y
CONFIG_KALLSYMS=y
# CONFIG_KALLSYMS_ALL is not set
CONFIG_FUTEX=y
CONFIG_EPOLL=y
CONFIG_IOSCHED_NOOP=y
CONFIG_IOSCHED_AS=y
CONFIG_IOSCHED_DEADLINE=y
CONFIG_IOSCHED_CFQ=y
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set

#
# Loadable module support
#
CONFIG_MODULES=y
CONFIG_MODULE_UNLOAD=y
# CONFIG_MODULE_FORCE_UNLOAD is not set
CONFIG_OBSOLETE_MODPARM=y
# CONFIG_MODVERSIONS is not set
CONFIG_KMOD=y

#
# Processor
#
# CONFIG_6xx is not set
# CONFIG_40x is not set
CONFIG_44x=y
# CONFIG_POWER3 is not set
# CONFIG_POWER4 is not set
# CONFIG_8xx is not set
# CONFIG_E500 is not set
CONFIG_BOOKE=y
CONFIG_PTE_64BIT=y
# CONFIG_MATH_EMULATION is not set
# CONFIG_CPU_FREQ is not set
CONFIG_4xx=y

#
# IBM 4xx options
#
# CONFIG_EBONY is not set
# CONFIG_OCOTEA is not set
CONFIG_HIMA=y
CONFIG_440GX=y
CONFIG_440A=y
CONFIG_IBM_OCP=y
CONFIG_IBM_EMAC4=y
# CONFIG_PM is not set
CONFIG_NOT_COHERENT_CACHE=y

#
# Platform options
#
# CONFIG_PC_KEYBOARD is not set
# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
# CONFIG_HIGHMEM is not set
CONFIG_KERNEL_ELF=y
CONFIG_BINFMT_ELF=y
# CONFIG_BINFMT_MISC is not set
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="root=/dev/ram rw ip=on console=ttyS1,115200"

#
# Bus options
#
CONFIG_PCI=y
CONFIG_PCI_DOMAINS=y
# CONFIG_PCI_LEGACY_PROC is not set
# CONFIG_PCI_NAMES is not set

#
# Advanced setup
#
# CONFIG_ADVANCED_OPTIONS is not set

#
# Default settings for advanced configuration options are used
#
CONFIG_HIGHMEM_START=0xfe000000
CONFIG_LOWMEM_SIZE=0x30000000
CONFIG_KERNEL_START=0xc0000000
CONFIG_TASK_SIZE=0x80000000
CONFIG_CONSISTENT_START=0xff100000
CONFIG_CONSISTENT_SIZE=0x00200000
CONFIG_BOOT_LOAD=0x01000000

#
# Device Drivers
#

#
# Generic Driver Options
#
CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_DEBUG_DRIVER is not set

#
# Memory Technology Devices (MTD)
#
# CONFIG_MTD is not set

#
# Parallel port support
#
# CONFIG_PARPORT is not set

#
# Plug and Play support
#

#
# Block devices
#
# CONFIG_BLK_DEV_FD is not set
# CONFIG_BLK_CPQ_DA is not set
# CONFIG_BLK_CPQ_CISS_DA is not set
# CONFIG_BLK_DEV_DAC960 is not set
# CONFIG_BLK_DEV_UMEM is not set
CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_CARMEL is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_INITRD=y
# CONFIG_LBD is not set


#
# ATA/ATAPI/MFM/RLL support
#
CONFIG_IDE=y

#
# SCSI device support
#
CONFIG_SCSI=y

#
# Multi-device support (RAID and LVM)
#
# CONFIG_MD is not set

#
# Fusion MPT device support
#

#
# IEEE 1394 (FireWire) support
#
# CONFIG_IEEE1394 is not set

#
# I2O device support
#
# CONFIG_I2O is not set

#
# Macintosh device drivers
#

#
# Networking support
#
# CONFIG_NET=y

#
# Networking options
#
# CONFIG_PACKET=y
# CONFIG_PACKET_MMAP is not set
# CONFIG_NETLINK_DEV is not set
# CONFIG_UNIX=y
# CONFIG_NET_KEY is not set
# CONFIG_INET=y
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ADVANCED_ROUTER is not set
# CONFIG_IP_PNP=y
# CONFIG_IP_PNP_DHCP is not set
# CONFIG_IP_PNP_BOOTP=y
# CONFIG_IP_PNP_RARP is not set
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_ARPD is not set
# CONFIG_SYN_COOKIES is not set
# CONFIG_INET_AH is not set
# CONFIG_INET_ESP is not set
# CONFIG_INET_IPCOMP is not set

#
# IP: Virtual Server Configuration
#
# CONFIG_IP_VS is not set
# CONFIG_IPV6 is not set
# CONFIG_NETFILTER=y
# CONFIG_NETFILTER_DEBUG is not set
#

# IP: Netfilter Configuration
#
# CONFIG_IP_NF_CONNTRACK is not set
# CONFIG_IP_NF_QUEUE is not set
# CONFIG_IP_NF_IPTABLES is not set
# CONFIG_IP_NF_ARPTABLES is not set
# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
# CONFIG_IP_NF_COMPAT_IPFWADM is not set

#
# SCTP Configuration (EXPERIMENTAL)
#
# CONFIG_IP_SCTP is not set
# CONFIG_ATM is not set
# CONFIG_BRIDGE is not set
# CONFIG_VLAN_8021Q is not set
# CONFIG_DECNET is not set
# CONFIG_LLC2 is not set
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_NET_HW_FLOWCONTROL is not set

#
# QoS and/or fair queueing
#
# CONFIG_NET_SCHED is not set
# CONFIG_NET_CLS_ROUTE is not set

#
# Network testing
#
# CONFIG_NET_PKTGEN is not set
# CONFIG_NETPOLL is not set
# CONFIG_NET_POLL_CONTROLLER is not set
# CONFIG_HAMRADIO is not set
# CONFIG_IRDA is not set
# CONFIG_BT is not set
# CONFIG_NETDEVICES=y
# CONFIG_DUMMY is not set
# CONFIG_BONDING is not set
# CONFIG_EQUALIZER is not set
# CONFIG_TUN is not set

#
# ARCnet devices
#
# CONFIG_ARCNET is not set

#
# Ethernet (10 or 100Mbit)
#
# CONFIG_NET_ETHERNET=y
# CONFIG_MII=y
# CONFIG_OAKNET is not set
# CONFIG_HAPPYMEAL is not set
# CONFIG_SUNGEM is not set
# CONFIG_NET_VENDOR_3COM is not set


#
# Tulip family network device support
#
# CONFIG_NET_TULIP is not set
# CONFIG_HP100 is not set
# CONFIG_IBM_EMAC=y
# CONFIG_IBM_EMAC_ERRMSG is not set
# CONFIG_IBM_EMAC_RXB=128
# CONFIG_IBM_EMAC_TXB=128
# CONFIG_IBM_EMAC_FGAP=8
# CONFIG_IBM_EMAC_SKBRES=0
# CONFIG_NET_PCI is not set

#
# Ethernet (1000 Mbit)
#
# CONFIG_ACENIC is not set
# CONFIG_DL2K is not set
# CONFIG_E1000 is not set
# CONFIG_NS83820 is not set
# CONFIG_HAMACHI is not set
# CONFIG_YELLOWFIN is not set
# CONFIG_R8169 is not set
# CONFIG_SK98LIN is not set
# CONFIG_TIGON3 is not set

#
# Ethernet (10000 Mbit)
#
# CONFIG_IXGB is not set
# CONFIG_S2IO is not set

#
# Token Ring devices
#
# CONFIG_TR is not set

#
# Wireless LAN (non-hamradio)
#
# CONFIG_NET_RADIO is not set

#
# Wan interfaces
#
# CONFIG_WAN is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
# CONFIG_PPP is not set
# CONFIG_SLIP is not set
# CONFIG_SHAPER is not set
# CONFIG_NETCONSOLE is not set

#
# ISDN subsystem
#
# CONFIG_ISDN is not set

#
# Telephony Support
#
# CONFIG_PHONE is not set

#
# Input device support
#
# CONFIG_INPUT is not set

#
# Userland interfaces
#
# CONFIG_INPUT_MOUSEDEV is not set
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
# CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
# CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
# CONFIG_INPUT_JOYDEV is not set
# CONFIG_INPUT_TSDEV is not set
# CONFIG_INPUT_EVDEV is not set
# CONFIG_INPUT_EVBUG is not set

#
# Input I/O drivers
#
# CONFIG_GAMEPORT is not set
# CONFIG_SOUND_GAMEPORT is not set
# CONFIG_SERIO is not set
# CONFIG_SERIO_I8042 is not set
# CONFIG_SERIO_SERPORT is not set
# CONFIG_SERIO_CT82C710 is not set
# CONFIG_SERIO_PCIPS2 is not set

#
# Input Device Drivers
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TOUCHSCREEN is not set
# CONFIG_INPUT_MISC is not set

#
# Character devices
#
# CONFIG_VT is not set
# CONFIG_SERIAL_NONSTANDARD is not set

#
# Serial drivers
#
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
# CONFIG_SERIAL_8250_MANY_PORTS is not set
CONFIG_SERIAL_8250_SHARE_IRQ=y
# CONFIG_SERIAL_8250_DETECT_IRQ is not set
# CONFIG_SERIAL_8250_MULTIPORT is not set
# CONFIG_SERIAL_8250_RSA is not set

#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
# CONFIG_QIC02_TAPE is not set

#
# IPMI
#
# CONFIG_IPMI_HANDLER is not set

#
# Watchdog Cards
#
# CONFIG_WATCHDOG is not set
# CONFIG_NVRAM is not set
# CONFIG_GEN_RTC is not set
# CONFIG_DTLK is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set

#
# Ftape, the floppy tape device driver
#
# CONFIG_FTAPE is not set
# CONFIG_AGP is not set
# CONFIG_DRM is not set
# CONFIG_RAW_DRIVER is not set

#
# I2C support
#
# CONFIG_I2C is not set

#
# Misc devices
#

#
# Multimedia devices
#
# CONFIG_VIDEO_DEV is not set

#
# Digital Video Broadcasting Devices
#
# CONFIG_DVB is not set

#
# Graphics support
#
# CONFIG_FB is not set

#
# Sound
#
# CONFIG_SOUND is not set

#
# USB support
#
# CONFIG_USB is not set

#
# USB Gadget Support
#
# CONFIG_USB_GADGET is not set

#
# File systems
#
CONFIG_EXT2_FS=y
# CONFIG_EXT2_FS_XATTR is not set
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
# CONFIG_EXT3_FS_POSIX_ACL is not set
# CONFIG_EXT3_FS_SECURITY is not set
CONFIG_JBD=y
# CONFIG_JBD_DEBUG is not set
CONFIG_FS_MBCACHE=y
# CONFIG_REISERFS_FS is not set
# CONFIG_JFS_FS is not set
# CONFIG_XFS_FS is not set
# CONFIG_MINIX_FS is not set
# CONFIG_ROMFS_FS is not set
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set

#
# CD-ROM/DVD Filesystems
#
# CONFIG_ISO9660_FS is not set
# CONFIG_UDF_FS is not set

#
# DOS/FAT/NT Filesystems
#
# CONFIG_FAT_FS is not set
# CONFIG_NTFS_FS is not set

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_SYSFS=y
# CONFIG_DEVFS_FS is not set
# CONFIG_DEVPTS_FS_XATTR is not set
# CONFIG_TMPFS is not set
# CONFIG_HUGETLB_PAGE is not set
CONFIG_RAMFS=y

#
# Miscellaneous filesystems
#
# CONFIG_ADFS_FS is not set
# CONFIG_AFFS_FS is not set
# CONFIG_HFS_FS is not set
# CONFIG_HFSPLUS_FS is not set
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set

#
# Network File Systems
#
# CONFIG_NFS_FS=y
# CONFIG_NFS_V3 is not set
# CONFIG_NFS_V4 is not set
# CONFIG_NFS_DIRECTIO is not set
# CONFIG_NFSD is not set
# CONFIG_ROOT_NFS=y
# CONFIG_LOCKD=y
# CONFIG_EXPORTFS is not set
# CONFIG_SUNRPC=y
# CONFIG_RPCSEC_GSS_KRB5 is not set
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set

#
# Partition Types
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y


#
# Native Language Support
#
# CONFIG_NLS is not set

#
# Library routines
#
CONFIG_CRC32=y
# CONFIG_LIBCRC32C is not set

#
# Profiling support
#
# CONFIG_PROFILING is not set

#
# Kernel hacking
#
CONFIG_DEBUG_KERNEL=y
# CONFIG_DEBUG_SLAB is not set
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_DEBUG_SPINLOCK is not set
# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
# CONFIG_KGDB is not set
# CONFIG_XMON is not set
CONFIG_BDI_SWITCH=y
CONFIG_DEBUG_INFO=y
# CONFIG_SERIAL_TEXT_DEBUG is not set
CONFIG_PPC_OCP=y

#
# Security options
#
# CONFIG_SECURITY is not set

#
# Cryptographic options
#
# CONFIG_CRYPTO is not set

^ permalink raw reply

* mpcbdm Flash.dev for intel 28F640J3
From: Wojciech Kromer @ 2005-07-05  7:12 UTC (permalink / raw)
  To: Embedded PPC Linux Mailing List

Anone have such file, supports intel flashes with mpcbdm and mpcbdm-gbd?

^ permalink raw reply

* How to porting U-Boot to MPC852T
From: Rober Hsu @ 2005-07-05  7:16 UTC (permalink / raw)
  To: LinuxPPC

Hello:

   I can run ppcboot 1.1.6 at my MPC852T very well,
but when i change to 1.2.0 or above, it has many trouble
to me.I found 1.1.6 can work at 100MHZ, but else fail.

   Somebody know how to use u-boot or ppcboot 1.2.0 at MPC852T at 100MHZ
and Enable Fast  Ethernet, i just can run at ppcboot 1.1.6, else
fail.I've try all version from ppcboot 1.2.0 to u-boot 1.2.0.I think i
can run 852T at 100Mhz and enable fast ethernet,so my hardware is no
problem.But ppcboot 1.2.0  change too much source code, it makse me very
confuse,i don't know how to quickly debug it.

#Running at 50MHz is stable than 100MHZ but fec is stil not work

PPCBoot 1.2.0 (Jul  5 2005 - 10:04:03)
 
CPU:   MPC852T (0x08010004) at 50 MHz: 4 kB I-Cache 4 kB D-Cache FEC
present
DRAM:  16 MB
Not load linux now? (enter anykey):
FLASH:  8 MB
In:    serial
Out:   serial
Err:   serial
 
Type "run flash_nfs" to mount root filesystem over NFS
 
=>
 
=> tftp 0 ppcboot.bin
NIP: 00000000 XER: A0000000 LR: 00FE3F0C REGS: 00fafb48 TRAP: 1000 DAR:
A0000000
MSR: 00009002 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 00
 
GPR00: 00000000 00FAFC38 00000000 FFFFFFFF 00FAFDD1 00000075 00FAFEC0
00000000
GPR08: 00FF9818 FFFFFFFF 00FF7DA0 00001E00 59005035 00000000 00FF8B00
C0FD0000
GPR16: 00000000 00000000 00000000 00000000 39000004 00000001 FFFFFFFC
00001000
GPR24: 00000001 00000000 00FAFFC4 00000003 00000003 00FAFF94 00FF90F0
00FF7F70
Call backtrace:
00000160 00FE1744 00FEC8C4 00FEC64C 00FE48DC 00FE40D4 00FE15CC
00FD23B0 30343A30
Software Emulation Exception

 
#100MHZ halt at System init

PPCBoot 1.2.0 (Jul  5 2005 - 15:00:32)
 
CPU:   MPC852T (0x08010004) at 100 MHz: 4 kB I-Cache 4 kB D-Cache FEC
present
DRAM:  16 MB   <--- System Halt at here




/*
 * (C) Copyright 2000, 2001, 2002
 * Wolfgang Denk, DENX Software Engineering, wd@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
 */

/*
 * board/config.h - configuration options, board specific
 */

#ifndef __CONFIG_H
#define __CONFIG_H

/*
 * High Level Configuration Options
 * (easy to change)
 */

#define CONFIG_8xx_GCLK_FREQ    100000000
#define CONFIG_MPC860			1 /* This is a MPC860 CPU		*/
#define CONFIG_TQM860L			1 /* ...on a TQM8xxL module	*/

#define	CONFIG_8xx_CONS_SMC1	1	/* Console is on SMC1		*/
#undef	CONFIG_8xx_CONS_SMC2
#undef	CONFIG_8xx_CONS_NONE

#define CONFIG_BAUDRATE		115200	/* console baudrate = 115kbps	*/

#define CONFIG_BOOTDELAY	-1	/* autoboot after 5 seconds	*/

#define	CONFIG_CLOCKS_IN_MHZ	1	/* clocks passsed to Linux in MHz */

#define CONFIG_BOARD_TYPES	1	/* support board types		*/

#define CONFIG_PREBOOT	"echo;"	\
		"echo Type \"run flash_nfs\" to mount root filesystem over NFS;" \
		"echo"

#undef	CONFIG_BOOTARGS
#define CONFIG_BOOTCOMMAND							\
	"bootp; " 								\
	"setenv bootargs root=/dev/nfs rw nfsroot=$(serverip):$(rootpath) " 	\
	"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname)::off; "
	\
	"bootm"
	
#define	CONFIG_EXTRA_ENV_SETTINGS					\
    "ethaddr=00:01:02:B4:36:56\0" \
	""		

#define CONFIG_LOADS_ECHO	1	/* echo on for serial download	*/
#undef	CFG_LOADS_BAUD_CHANGE		/* don't allow baudrate change	*/

#undef	CONFIG_WATCHDOG			/* watchdog disabled		*/

#define	CONFIG_STATUS_LED	1	/* Status LED enabled		*/

#undef	CONFIG_CAN_DRIVER		/* CAN Driver support disabled	*/

#define CONFIG_BOOTP_MASK	(CONFIG_BOOTP_DEFAULT |
CONFIG_BOOTP_BOOTFILESIZE)

#define CONFIG_MAC_PARTITION
#define CONFIG_DOS_PARTITION

#define	CONFIG_RTC_MPC8xx		/* use internal RTC of MPC8xx	*/

#define CONFIG_COMMANDS	      ( CONFIG_CMD_DFL	| \
				CFG_CMD_ASKENV	| \
				CFG_CMD_DHCP	| \
				CFG_CMD_IDE	| \
				CFG_CMD_DATE	)

/* this must be included AFTER the definition of CONFIG_COMMANDS (if
any) */
#include <cmd_confdefs.h>

/*
 * Miscellaneous configurable options
 */
#define	CFG_LONGHELP			/* undef to save memory		*/
#define	CFG_PROMPT		"=> "	/* Monitor Command Prompt	*/

#if 0
#define	CFG_HUSH_PARSER		1	/* use "hush" command parser	*/
#endif
#ifdef	CFG_HUSH_PARSER
#define	CFG_PROMPT_HUSH_PS2	"> "
#endif

#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
#define	CFG_CBSIZE		1024	/* Console I/O Buffer Size	*/
#else
#define	CFG_CBSIZE		256	/* Console I/O Buffer Size	*/
#endif
#define	CFG_PBSIZE (CFG_CBSIZE+sizeof(CFG_PROMPT)+16) /* Print Buffer
Size */
#define	CFG_MAXARGS		16	/* max number of command args	*/
#define CFG_BARGSIZE	CFG_CBSIZE	/* Boot Argument Buffer Size	*/

#define CFG_MEMTEST_START	0x0400000	/* memtest works on	*/
#define CFG_MEMTEST_END		0x0C00000	/* 4 ... 12 MB in DRAM	*/

#define	CFG_LOAD_ADDR		0x100000	/* default load address	*/

#define	CFG_HZ			1000	/* decrementer freq: 1 ms ticks	*/

#define CFG_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }

/*
 * Low Level Configuration Settings
 * (address mappings, register initial values, etc.)
 * You should know what you are doing if you make changes here.
 */
/*-----------------------------------------------------------------------
 * Internal Memory Mapped Register
 */
#define CFG_IMMR		0xFFF00000

/*-----------------------------------------------------------------------
 * Definitions for initial stack pointer and data area (in DPRAM)
 */
#define CFG_INIT_RAM_ADDR	CFG_IMMR
#define	CFG_INIT_RAM_END	0x2F00	/* End of used area in DPRAM	*/
#define	CFG_GBL_DATA_SIZE	64  /* size in bytes reserved for initial data
*/
#define CFG_GBL_DATA_OFFSET	(CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
#define	CFG_INIT_SP_OFFSET	CFG_GBL_DATA_OFFSET

/*-----------------------------------------------------------------------
 * Start addresses for the final memory configuration
 * (Set up by the startup code)
 * Please note that CFG_SDRAM_BASE _must_ start at 0
 */
#define	CFG_SDRAM_BASE		0x00000000
#define CFG_FLASH_BASE		0x40000000
#if defined(DEBUG)
#define	CFG_MONITOR_LEN		(256 << 10)	/* Reserve 256 kB for Monitor	*/
#else
#define	CFG_MONITOR_LEN		(192 << 10)	/* Reserve 192 kB for Monitor	*/
#endif
#define CFG_MONITOR_BASE	CFG_FLASH_BASE
#define	CFG_MALLOC_LEN		(128 << 10)	/* Reserve 128 kB for malloc()	*/

/*
 * For booting Linux, the board info and command line data
 * have to be in the first 8 MB of memory, since this is
 * the maximum mapped by the Linux kernel during initialization.
 */
#define	CFG_BOOTMAPSZ		(8 << 20)	/* Initial Memory map for Linux	*/

/*-----------------------------------------------------------------------
 * FLASH organization
 */
#define CFG_MAX_FLASH_BANKS	2	/* max number of memory banks		*/
#define CFG_MAX_FLASH_SECT	71	/* max number of sectors on one chip	*/

#define CFG_FLASH_ERASE_TOUT	120000	/* Timeout for Flash Erase (in
ms)	*/
#define CFG_FLASH_WRITE_TOUT	500	/* Timeout for Flash Write (in ms)	*/

#define	CFG_ENV_IS_IN_FLASH	1
#define	CFG_ENV_OFFSET		0x8000	/*   Offset   of Environment Sector	*/
#define	CFG_ENV_SIZE		0x4000	/* Total Size of Environment Sector	*/

/* Address and size of Redundant Environment Sector	*/
#define CFG_ENV_OFFSET_REDUND	(CFG_ENV_OFFSET+CFG_ENV_SIZE)
#define CFG_ENV_SIZE_REDUND	(CFG_ENV_SIZE)

/*-----------------------------------------------------------------------
 * Hardware Information Block
 */
#define CFG_HWINFO_OFFSET	0x0003FFC0	/* offset of HW Info block */
#define CFG_HWINFO_SIZE		0x00000040	/* size   of HW Info block */
#define CFG_HWINFO_MAGIC	0x54514D38	/* 'TQM8' */

/*-----------------------------------------------------------------------
 * Cache Configuration
 */
#define CFG_CACHELINE_SIZE	16	/* For all MPC8xx CPUs			*/
#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
#define CFG_CACHELINE_SHIFT	4	/* log base 2 of the above value	*/
#endif

/*-----------------------------------------------------------------------
 * SYPCR - System Protection Control				11-9
 * SYPCR can only be written once after reset!

*-----------------------------------------------------------------------
 * Software & Bus Monitor Timer max, Bus Monitor enable, SW Watchdog
freeze
 */
#if defined(CONFIG_WATCHDOG)
#define CFG_SYPCR	(SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF | \
			 SYPCR_SWE  | SYPCR_SWRI| SYPCR_SWP)
#else
#define CFG_SYPCR	(SYPCR_SWTC | SYPCR_BMT | SYPCR_BME | SYPCR_SWF |
SYPCR_SWP)
#endif

/*-----------------------------------------------------------------------
 * SIUMCR - SIU Module Configuration				11-6

*-----------------------------------------------------------------------
 * PCMCIA config., multi-function pin tri-state
 */
#ifndef	CONFIG_CAN_DRIVER
#define CFG_SIUMCR	(SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
#else	/* we must activate GPL5 in the SIUMCR for CAN */
#define CFG_SIUMCR	(SIUMCR_DBGC11 | SIUMCR_DBPC00 | SIUMCR_MLRC01)
#endif	/* CONFIG_CAN_DRIVER */

/*-----------------------------------------------------------------------
 * TBSCR - Time Base Status and Control				11-26

*-----------------------------------------------------------------------
 * Clear Reference Interrupt Status, Timebase freezing enabled
 */
#define CFG_TBSCR	(TBSCR_REFA | TBSCR_REFB | TBSCR_TBF)

/*-----------------------------------------------------------------------
 * RTCSC - Real-Time Clock Status and Control Register		11-27

*-----------------------------------------------------------------------
 */
#define CFG_RTCSC	(RTCSC_SEC | RTCSC_ALR | RTCSC_RTF| RTCSC_RTE)

/*-----------------------------------------------------------------------
 * PISCR - Periodic Interrupt Status and Control		11-31

*-----------------------------------------------------------------------
 * Clear Periodic Interrupt Status, Interrupt Timer freezing enabled
 */
#define CFG_PISCR	(PISCR_PS | PISCR_PITF)

/*-----------------------------------------------------------------------
 * PLPRCR - PLL, Low-Power, and Reset Control Register		15-30

*-----------------------------------------------------------------------
 * Reset PLL lock status sticky bit, timer expired status bit and timer
 * interrupt status bit
 *
 * If this is a 80 MHz CPU, set PLL multiplication factor to 5
(5*16=80)!
*/

#define CFG_PLPRCR 0x0a4ac000
//#define CFG_PLPRCR 0x2240c000 

/*-----------------------------------------------------------------------
 * SCCR - System Clock and reset Control Register		15-27

*-----------------------------------------------------------------------
 * Set clock output, timebase and RTC source and divider,
 * power management and some other internal clocks
 */
#define SCCR_MASK	SCCR_EBDF11
#ifdef	CONFIG_80MHz	/* for 80 MHz, we use a 16 MHz clock * 5 */
#define CFG_SCCR	(/* SCCR_TBS  | */ \
			 SCCR_COM00   | SCCR_DFSYNC00 | SCCR_DFBRG00  | \
			 SCCR_DFNL000 | SCCR_DFNH000  | SCCR_DFLCD000 | \
			 SCCR_DFALCD00)
#else			/* up to 50 MHz we use a 1:1 clock */
#define CFG_SCCR	(SCCR_TBS     | \
			 SCCR_COM00   | SCCR_DFSYNC00 | SCCR_DFBRG00  | \
			 SCCR_DFNL000 | SCCR_DFNH000  | SCCR_DFLCD000 | \
			 SCCR_DFALCD00)
#endif	/* CONFIG_80MHz */

/*-----------------------------------------------------------------------
 * PCMCIA stuff

*-----------------------------------------------------------------------
 *
 */
#define CFG_PCMCIA_MEM_ADDR	(0xE0000000)
#define CFG_PCMCIA_MEM_SIZE	( 64 << 20 )
#define CFG_PCMCIA_DMA_ADDR	(0xE4000000)
#define CFG_PCMCIA_DMA_SIZE	( 64 << 20 )
#define CFG_PCMCIA_ATTRB_ADDR	(0xE8000000)
#define CFG_PCMCIA_ATTRB_SIZE	( 64 << 20 )
#define CFG_PCMCIA_IO_ADDR	(0xEC000000)
#define CFG_PCMCIA_IO_SIZE	( 64 << 20 )

/*-----------------------------------------------------------------------
 * IDE/ATA stuff (Supports IDE harddisk on PCMCIA Adapter)

*-----------------------------------------------------------------------
 */

#define	CONFIG_IDE_8xx_PCCARD	1	/* Use IDE with PC Card	Adapter	*/

#undef	CONFIG_IDE_8xx_DIRECT		/* Direct IDE    not supported	*/
#undef	CONFIG_IDE_LED			/* LED   for ide not supported	*/
#undef	CONFIG_IDE_RESET		/* reset for ide not supported	*/

#define CFG_IDE_MAXBUS		1	/* max. 1 IDE bus		*/
#define CFG_IDE_MAXDEVICE	1	/* max. 1 drive per IDE bus	*/

#define CFG_ATA_IDE0_OFFSET	0x0000

#define CFG_ATA_BASE_ADDR	CFG_PCMCIA_MEM_ADDR

/* Offset for data I/O			*/
#define CFG_ATA_DATA_OFFSET	(CFG_PCMCIA_MEM_SIZE + 0x320)

/* Offset for normal register accesses	*/
#define CFG_ATA_REG_OFFSET	(2 * CFG_PCMCIA_MEM_SIZE + 0x320)

/* Offset for alternate registers	*/
#define CFG_ATA_ALT_OFFSET	0x0100

/*-----------------------------------------------------------------------
 *

*-----------------------------------------------------------------------
 *
 */
/*#define	CFG_DER	0x2002000F*/
#define CFG_DER	0

/*
 * Init Memory Controller:
 *
 * BR0/1 and OR0/1 (FLASH)
 */

#define FLASH_BASE0_PRELIM	0x40000000	/* FLASH bank #0	*/
#define FLASH_BASE1_PRELIM	0x40400000	/* FLASH bank #0	*/

/* used to re-map FLASH both when starting from SRAM or FLASH:
 * restrict access enough to keep SRAM working (if any)
 * but not too much to meddle with FLASH accesses
 */
#define CFG_REMAP_OR_AM		0x80000000	/* OR addr mask */
#define CFG_PRELIM_OR_AM	0xE0000000	/* OR addr mask */

/*
 * FLASH timing:
 */
#if   defined(CONFIG_80MHz)
/* 80 MHz CPU - 40 MHz bus: ACS = 00, TRLX = 0, CSNT = 1, SCY = 3, EHTR
= 1 */
#define CFG_OR_TIMING_FLASH	(OR_ACS_DIV1  | 0       | OR_CSNT_SAM | \
				 OR_SCY_3_CLK | OR_EHTR | OR_BI)
#elif defined(CONFIG_66MHz)
/* 66 MHz CPU - 66 MHz bus: ACS = 00, TRLX = 1, CSNT = 1, SCY = 3, EHTR
= 1 */
#define CFG_OR_TIMING_FLASH	(OR_ACS_DIV1  | OR_TRLX | OR_CSNT_SAM | \
				 OR_SCY_3_CLK | OR_EHTR | OR_BI)
#else		/*   50 MHz */
/* 50 MHz CPU - 50 MHz bus: ACS = 00, TRLX = 1, CSNT = 1, SCY = 2, EHTR
= 1 */
#define CFG_OR_TIMING_FLASH	(OR_ACS_DIV1  | OR_TRLX | OR_CSNT_SAM | \
				 OR_SCY_2_CLK | OR_EHTR | OR_BI)
#endif	/*CONFIG_??MHz */

#define CFG_OR0_REMAP	(CFG_REMAP_OR_AM  | CFG_OR_TIMING_FLASH)
#define CFG_OR0_PRELIM	(CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH)
#define CFG_BR0_PRELIM	((FLASH_BASE0_PRELIM & BR_BA_MSK) | BR_V )

#define CFG_OR1_REMAP	CFG_OR0_REMAP
#define CFG_OR1_PRELIM	CFG_OR0_PRELIM
#define CFG_BR1_PRELIM	((FLASH_BASE1_PRELIM & BR_BA_MSK) | BR_V )

/*
 * BR2/3 and OR2/3 (SDRAM)
 *
 */
#define SDRAM_BASE2_PRELIM	0x00000000	/* SDRAM bank #0	*/
#define SDRAM_BASE3_PRELIM	0x20000000	/* SDRAM bank #1	*/
#define	SDRAM_MAX_SIZE		0x04000000	/* max 64 MB per bank	*/

/* SDRAM timing: Multiplexed addresses, GPL5 output to GPL5_A (don't
care)	*/
#define CFG_OR_TIMING_SDRAM	0x00000A00

#define CFG_OR2_PRELIM	(CFG_PRELIM_OR_AM | CFG_OR_TIMING_SDRAM )
#define CFG_BR2_PRELIM	((SDRAM_BASE2_PRELIM & BR_BA_MSK) | BR_MS_UPMA |
BR_V )

#ifndef	CONFIG_CAN_DRIVER
#define	CFG_OR3_PRELIM	CFG_OR2_PRELIM
#define CFG_BR3_PRELIM	((SDRAM_BASE3_PRELIM & BR_BA_MSK) | BR_MS_UPMA |
BR_V )
#else	/* CAN uses CS3#, so we can have only one SDRAM bank anyway */
#define	CFG_CAN_BASE		0xC0000000	/* CAN mapped at 0xC0000000	*/
#define CFG_CAN_OR_AM		0xFFFF8000	/* 32 kB address mask		*/
#define CFG_OR3_CAN		(CFG_CAN_OR_AM | OR_G5LA | OR_BI)
#define CFG_BR3_CAN		((CFG_CAN_BASE & BR_BA_MSK) | \
					BR_PS_8 | BR_MS_UPMB | BR_V )
#endif	/* CONFIG_CAN_DRIVER */

/*
 * Memory Periodic Timer Prescaler
 *
 * The Divider for PTA (refresh timer) configuration is based on an
 * example SDRAM configuration (64 MBit, one bank). The adjustment to
 * the number of chip selects (NCS) and the actually needed refresh
 * rate is done by setting MPTPR.
 *
 * PTA is calculated from
 *	PTA = (gclk * Trefresh) / ((2 ^ (2 * DFBRG)) * PTP * NCS)
 *
 *	gclk	  CPU clock (not bus clock!)
 *	Trefresh  Refresh cycle * 4 (four word bursts used)
 *
 * 4096  Rows from SDRAM example configuration
 * 1000  factor s -> ms
 *   32  PTP (pre-divider from MPTPR) from SDRAM example configuration
 *    4  Number of refresh cycles per period
 *   64  Refresh cycle in ms per number of rows
 * --------------------------------------------
 * Divider = 4096 * 32 * 1000 / (4 * 64) = 512000
 *
 * 50 MHz => 50.000.000 / Divider =  98
 * 66 Mhz => 66.000.000 / Divider = 129
 * 80 Mhz => 80.000.000 / Divider = 156
 */
#if   defined(CONFIG_80MHz)
#define CFG_MAMR_PTA		156
#elif defined(CONFIG_66MHz)
#define CFG_MAMR_PTA		129
#else		/*   50 MHz */
#define CFG_MAMR_PTA		 98
#endif	/*CONFIG_??MHz */

/*
 * For 16 MBit, refresh rates could be 31.3 us
 * (= 64 ms / 2K = 125 / quad bursts).
 * For a simpler initialization, 15.6 us is used instead.
 *
 * #define CFG_MPTPR_2BK_2K	MPTPR_PTP_DIV32		for 2 banks
 * #define CFG_MPTPR_1BK_2K	MPTPR_PTP_DIV64		for 1 bank
 */
#define CFG_MPTPR_2BK_4K	MPTPR_PTP_DIV16		/* setting for 2 banks	*/
#define CFG_MPTPR_1BK_4K	MPTPR_PTP_DIV32		/* setting for 1 bank	*/

/* refresh rate 7.8 us (= 64 ms / 8K = 31.2 / quad bursts) for 256
MBit		*/
#define CFG_MPTPR_2BK_8K	MPTPR_PTP_DIV8		/* setting for 2 banks	*/
#define CFG_MPTPR_1BK_8K	MPTPR_PTP_DIV16		/* setting for 1 bank	*/

/*
 * MAMR settings for SDRAM
 */

/* 8 column SDRAM */
#define CFG_MAMR_8COL	((CFG_MAMR_PTA << MAMR_PTA_SHIFT)  | MAMR_PTAE	   
|	\
			 MAMR_AMA_TYPE_0 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A11 |	\
			 MAMR_RLFA_1X	 | MAMR_WLFA_1X	   | MAMR_TLFA_4X)
/* 9 column SDRAM */
#define CFG_MAMR_9COL	((CFG_MAMR_PTA << MAMR_PTA_SHIFT)  | MAMR_PTAE	   
|	\
			 MAMR_AMA_TYPE_1 | MAMR_DSA_1_CYCL | MAMR_G0CLA_A10 |	\
			 MAMR_RLFA_1X	 | MAMR_WLFA_1X	   | MAMR_TLFA_4X)


/*
 * Internal Definitions
 *
 * Boot Flags
 */
#define	BOOTFLAG_COLD	0x01		/* Normal Power-On: Boot from FLASH	*/
#define BOOTFLAG_WARM	0x02		/* Software reboot			*/

#define CONFIG_SCC1_ENET    
#define CONFIG_FEC_ENET     1
#define CONFIG_ETHPRIME		"SCC ETHERNET"

#endif	/* __CONFIG_H */


  

^ permalink raw reply

* Re: mpcbdm Flash.dev for intel 28F640J3
From: Wolfgang Denk @ 2005-07-05  8:20 UTC (permalink / raw)
  To: Wojciech Kromer; +Cc: Embedded PPC Linux Mailing List
In-Reply-To: <42CA32D7.9030700@dgt.com.pl>

In message <42CA32D7.9030700@dgt.com.pl> you wrote:
> Anone have such file, supports intel flashes with mpcbdm and mpcbdm-gbd?

You probably wanted to ask this on  the  bdm4gdb-users  mailing  list
instead. I'm afraid you won't see much response, though.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
A stone was placed at a ford in a river with the inscription:
"When this stone is covered it is dangerous to ford here."

^ permalink raw reply

* Re: How to porting U-Boot to MPC852T
From: Wolfgang Denk @ 2005-07-05  8:28 UTC (permalink / raw)
  To: Rober Hsu; +Cc: LinuxPPC
In-Reply-To: <1120547797.16541.24.camel@localhost.localdomain>

In message <1120547797.16541.24.camel@localhost.localdomain> you wrote:
> 
>    I can run ppcboot 1.1.6 at my MPC852T very well,
> but when i change to 1.2.0 or above, it has many trouble
> to me.I found 1.1.6 can work at 100MHZ, but else fail.

This is off topic on a Linux mailing list.

>    Somebody know how to use u-boot or ppcboot 1.2.0 at MPC852T at 100MHZ
> and Enable Fast  Ethernet, i just can run at ppcboot 1.1.6, else
> fail.I've try all version from ppcboot 1.2.0 to u-boot 1.2.0.I think i
> can run 852T at 100Mhz and enable fast ethernet,so my hardware is no
> problem.But ppcboot 1.2.0  change too much source code, it makse me very
> confuse,i don't know how to quickly debug it.

You did not mention which board you are using. If it is  one  of  the
boards in the public source tree than all current versions of U-Boot,
especially  top-of-tree  in  CVS. should just work fine. We use it on
several MPC852 based boards.

> #Running at 50MHz is stable than 100MHZ but fec is stil not work
> 
> PPCBoot 1.2.0 (Jul  5 2005 - 10:04:03)
>  
> CPU:   MPC852T (0x08010004) at 50 MHz: 4 kB I-Cache 4 kB D-Cache FEC
> present
> DRAM:  16 MB
> Not load linux now? (enter anykey):
^^^^^^^^^^^^^^^^^^^^

This does not look like a standard port of PPCBoot /  U-Boot.  Heaven
knows which modifications and/or bugs it may contain.

> => tftp 0 ppcboot.bin
> NIP: 00000000 XER: A0000000 LR: 00FE3F0C REGS: 00fafb48 TRAP: 1000 DAR:
> A0000000
> MSR: 00009002 EE: 1 PR: 0 FP: 0 ME: 1 IR/DR: 00
>  
> GPR00: 00000000 00FAFC38 00000000 FFFFFFFF 00FAFDD1 00000075 00FAFEC0
> 00000000
> GPR08: 00FF9818 FFFFFFFF 00FF7DA0 00001E00 59005035 00000000 00FF8B00
> C0FD0000
> GPR16: 00000000 00000000 00000000 00000000 39000004 00000001 FFFFFFFC
> 00001000
> GPR24: 00000001 00000000 00FAFFC4 00000003 00000003 00FAFF94 00FF90F0
> 00FF7F70
> Call backtrace:
> 00000160 00FE1744 00FEC8C4 00FEC64C 00FE48DC 00FE40D4 00FE15CC
> 00FD23B0 30343A30
> Software Emulation Exception

User error. You just overwrote the exception vectors.  You  just  got
what you asked for.

> #100MHZ halt at System init
> 
> PPCBoot 1.2.0 (Jul  5 2005 - 15:00:32)
>  
> CPU:   MPC852T (0x08010004) at 100 MHz: 4 kB I-Cache 4 kB D-Cache FEC
> present
> DRAM:  16 MB   <--- System Halt at here

Probably a some errors in your SDRAM init  code.  Are  you  sure  you
adjusted  it  correctly  for  the  new clock? [One more reason to use
current code instead.]

> #define CONFIG_8xx_GCLK_FREQ    100000000
> #define CONFIG_MPC860			1 /* This is a MPC860 CPU		*/
> #define CONFIG_TQM860L			1 /* ...on a TQM8xxL module	*/


Arghhh!!!! You CANNOT, I repeat *CANNOT* just  take  a  configuration
from  one  board  and  use  it on completely different hardware. This
config file is for a TQM860L board, and it will definitely  NOT  work
correctly on your MPC852 based system.


Sorry, but you obviously failed to read  the  documentation  (README,
FAQ, Manual). Go back to square 0.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Perl already has an IDE.  It's called Unix.
                      -- Tom Christiansen in 375bd509@cs.colorado.edu

^ permalink raw reply

* Re: initrd rootfs ramdisk
From: Wolfgang Denk @ 2005-07-05  8:18 UTC (permalink / raw)
  To: David Grab; +Cc: linuxppc-embedded
In-Reply-To: <000001c5812b$eb088c70$f201a8c0@SN7606>

In message <000001c5812b$eb088c70$f201a8c0@SN7606> you wrote:
> 
> i solved my problem last problem and now i get console output. :) So next
> step is to setup the root file system. I want to use an image loaded into
> ramdisk, but seems i´m missing something. I´m using u-boot to load the
> ramdisk and linux kernel. Actually i don´t know how the kernel gets the
> location of the loaded ramdisk. I only added the support (see Kernel

It gets passed in registers r4 (start address) and r5 (end address).

> configuration) and the command line parameter root=/dev/ram rw. But the boot
> command arguments from u-boot seems not recognized from the linux kernel.

But the kernel prints the boot parameters just fine.

> Should the option CONFIG_BOOT_LOAD point on the address of the ramdisk? I

No.

> hope someone could help me to trigger out my problem.

Are you sure that you have ext2 filesystem support  enabled  in  your
kernel configuration?

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
I perceive a possibility of an immediate  chronological  sequence  of
events which includes a violence.
                        - Terry Pratchett, _The Dark Side of the Sun_

^ permalink raw reply

* mpc823 scc2 as eth0, nfs slow with linuxppc-2.4.25, but ok with linuxppc-2.4.4, why?
From: debora @ 2005-07-05 10:09 UTC (permalink / raw)
  To: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 4844 bytes --]



Hello All,

My board uses a MPC823 and SCC2 as its ethernet interface.

display "nfs: server 192.168.0.82 not responding, still trying"
        "nfs: server 192.168.0.82 OK"
when boot with linux-2.4.25, but ok with linux-2.4.4

Below is what it looks like when booting.


boot with linux-2.4.25:
eth0: CPM ENET Version 0.2 on SCC2, 42:dd:0c:46:e8:b8
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 4096)
IP-Config: Complete:
      device=eth0, addr=192.168.0.182, mask=255.255.255.0, gw=192.168.0.1,
     host=192.168.0.182, domain=, nis-domain=(none),
     bootserver=192.168.0.82, rootserver=192.168.0.82, rootpath=
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Looking up port of RPC 100003/2 on 192.168.0.82
Looking up port of RPC 100005/1 on 192.168.0.82
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 52k init
nfs: server 192.168.0.82 not responding, still trying
nfs: server 192.168.0.82 OK
nfs: server 192.168.0.82 not responding, still trying
nfs: server 192.168.0.82 not responding, still trying
nfs: server 192.168.0.82 OK
nfs: server 192.168.0.82 OK
                Welcome to Sinovee Linux 2.0 (Overlord)
                Press 'I' to enter interactive startup.
Mounting proc filesystem:  nfs: server 192.168.0.82 not responding, still trying
nfs: server 192.168.0.82 OK
[  OK  ]
Configuring kernel parameters:  [  OK  ]
Setting clock (utc): Wed Jun 22 17:36:00 CST 2005 [  OK  ]
Activating swap partitions:  [  OK  ]
Setting hostname 192.168.0.182:  [  OK  ]
Starting watchdog: [OK]
Watchdog daemon ver 0.1, (c) 2002, FEL co. ltd.
watchdog: No such device
INIT: Entering runlevel: 3
Entering non-interactive startup
Starting xinetd: nfs: server 192.168.0.82 not responding, still trying
nfs: server 192.168.0.82 OK
[  OK  ]

Sinovee Linux 2.0 (Overlord)
Kernel 2.4.4 on an MPC8xx
192 login: root
nfs: server 192.168.0.82 not responding, still trying
nfs: server 192.168.0.82 OK
sh-2.04#
sh-2.04#

boot with linux-2.4.4:
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Kernel command line: root=/dev/nfs rw console=ttyS0,19200 nfsroot=192.168.0.82:/
prj/sc8xx/root ip=192.168.0.182:192.168.0.82:192.168.0.1:255.255.255.0::eth0:off
Decrementer Frequency: 4687500
Calibrating delay loop... 74.75 BogoMIPS
Memory: 30744k available (1004k kernel code, 376k data, 48k init, 0k highmem)
Dentry-cache hash table entries: 4096 (order: 3, 32768 bytes)
Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 2048 (order: 2, 16384 bytes)
POSIX conformance testing by UNIFIX
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Starting kswapd v1.8
CPM UART driver version 0.03
ttyS0 on SMC1 at 0x0280, BRG1
ttyS1 on SMC2 at 0x0380, BRG2
pty: 256 Unix98 ptys configured
WDT_8xx: SWT not enabled by firmware, SYPCR=0xffffff88
block: queued sectors max/low 20357kB/6785kB, 64 slots per queue
RAMDISK driver initialized: 16 RAM disks of 6144K size 1024 blocksize
eth0: CPM ENET Version 0.21 on SCC2, 42:dd:0c:46:e8:b8
loop: loaded (max 8 devices)
Using configured DiskOnChip probe address 0x80000000
DiskOnChip 2000 found at address 0x80000000
Flash chip found: Manufacturer ID: 98, Chip ID: 75 (Toshiba TC58256FT/DC)
1 flash chips found. Total DiskOnChip size: 32 MiB
NFTL driver: nftlcore.c $Revision: 1.83 $, nftlmount.c $Revision: 1.23 $
Cannot calculate an NFTL geometry to match size of 0xf760.
Using C:989 H:16 S:4 (== 0xf740 sects)
Partition check:
 nftla: nftla1
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 2048 bind 2048)
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
Looking up port of RPC 100003/2 on 192.168.0.82
Looking up port of RPC 100005/2 on 192.168.0.82
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 48k init
INIT: version 2.78 booting
                Welcome to Sinovee Linux 2.0 (Overlord)
               Press 'I' to enter interactive startup.
Mounting proc filesystem:  [  OK  ]
Configuring kernel parameters:  [  OK  ]
Setting clock (utc): Fri Jun 24 02:00:28 CST 2005 [  OK  ]
Activating swap partitions:  [  OK  ]
Setting hostname 192.168.0.182:  [  OK  ]
Starting watchdog: Watchdog daemon ver 0.1, (c) 2002, FEL co. ltd.
watchdog: No such device
[OK]
INIT: Entering runlevel: 3
Entering non-interactive startup
Starting xinetd: [  OK  ]

Sinovee Linux 2.0 (Overlord)
Kernel 2.4.4 on an MPC8xx

192 login:



[-- Attachment #2: Type: text/html, Size: 6718 bytes --]

^ permalink raw reply

* Re: mpc823 scc2 as eth0, nfs slow with linuxppc-2.4.25, but ok with linuxppc-2.4.4, why?
From: Alex Zeffertt @ 2005-07-05 10:45 UTC (permalink / raw)
  To: debora; +Cc: linuxppc-embedded
In-Reply-To: <000c01c58149$94e7c4a0$0600a8c0@sinoveesc24ljh>

Your .config has probably changed when you upgraded your kernel.  It may be that
you've lost NFS v3 support and it's falling back on v1 support.  Check you have
v3 configured.  You need

CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
CONFIG_ROOT_NFS=y

Alex


On Tue, 5 Jul 2005 18:09:07 +0800
"debora" <deboralh@fel.com.cn> wrote:

> 
> 
> Hello All,
> 
> My board uses a MPC823 and SCC2 as its ethernet interface.
> 
> display "nfs: server 192.168.0.82 not responding, still trying"
>         "nfs: server 192.168.0.82 OK"
> when boot with linux-2.4.25, but ok with linux-2.4.4
> 
> Below is what it looks like when booting.
> 
> 
> boot with linux-2.4.25:
> eth0: CPM ENET Version 0.2 on SCC2, 42:dd:0c:46:e8:b8
> RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
> NET4: Linux TCP/IP 1.0 for NET4.0
> IP Protocols: ICMP, UDP, TCP
> IP: routing cache hash table of 512 buckets, 4Kbytes
> TCP: Hash tables configured (established 2048 bind 4096)
> IP-Config: Complete:
>       device=eth0, addr=192.168.0.182, mask=255.255.255.0, gw=192.168.0.1,
>      host=192.168.0.182, domain=, nis-domain=(none),
>      bootserver=192.168.0.82, rootserver=192.168.0.82, rootpath=
> NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
> Looking up port of RPC 100003/2 on 192.168.0.82
> Looking up port of RPC 100005/1 on 192.168.0.82
> VFS: Mounted root (nfs filesystem).
> Freeing unused kernel memory: 52k init
> nfs: server 192.168.0.82 not responding, still trying
> nfs: server 192.168.0.82 OK
> nfs: server 192.168.0.82 not responding, still trying
> nfs: server 192.168.0.82 not responding, still trying
> nfs: server 192.168.0.82 OK
> nfs: server 192.168.0.82 OK
>                 Welcome to Sinovee Linux 2.0 (Overlord)
>                 Press 'I' to enter interactive startup.
> Mounting proc filesystem:  nfs: server 192.168.0.82 not responding, still
> trying nfs: server 192.168.0.82 OK
> [  OK  ]
> Configuring kernel parameters:  [  OK  ]
> Setting clock (utc): Wed Jun 22 17:36:00 CST 2005 [  OK  ]
> Activating swap partitions:  [  OK  ]
> Setting hostname 192.168.0.182:  [  OK  ]
> Starting watchdog: [OK]
> Watchdog daemon ver 0.1, (c) 2002, FEL co. ltd.
> watchdog: No such device
> INIT: Entering runlevel: 3
> Entering non-interactive startup
> Starting xinetd: nfs: server 192.168.0.82 not responding, still trying
> nfs: server 192.168.0.82 OK
> [  OK  ]
> 
> Sinovee Linux 2.0 (Overlord)
> Kernel 2.4.4 on an MPC8xx
> 192 login: root
> nfs: server 192.168.0.82 not responding, still trying
> nfs: server 192.168.0.82 OK
> sh-2.04#
> sh-2.04#
> 
> boot with linux-2.4.4:
> NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
> Kernel command line: root=/dev/nfs rw console=ttyS0,19200
> nfsroot=192.168.0.82:/ prj/sc8xx/root
> ip=192.168.0.182:192.168.0.82:192.168.0.1:255.255.255.0::eth0:off Decrementer
> Frequency: 4687500 Calibrating delay loop... 74.75 BogoMIPS
> Memory: 30744k available (1004k kernel code, 376k data, 48k init, 0k highmem)
> Dentry-cache hash table entries: 4096 (order: 3, 32768 bytes)
> Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
> Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
> Inode-cache hash table entries: 2048 (order: 2, 16384 bytes)
> POSIX conformance testing by UNIFIX
> Linux NET4.0 for Linux 2.4
> Based upon Swansea University Computer Society NET3.039
> Starting kswapd v1.8
> CPM UART driver version 0.03
> ttyS0 on SMC1 at 0x0280, BRG1
> ttyS1 on SMC2 at 0x0380, BRG2
> pty: 256 Unix98 ptys configured
> WDT_8xx: SWT not enabled by firmware, SYPCR=0xffffff88
> block: queued sectors max/low 20357kB/6785kB, 64 slots per queue
> RAMDISK driver initialized: 16 RAM disks of 6144K size 1024 blocksize
> eth0: CPM ENET Version 0.21 on SCC2, 42:dd:0c:46:e8:b8
> loop: loaded (max 8 devices)
> Using configured DiskOnChip probe address 0x80000000
> DiskOnChip 2000 found at address 0x80000000
> Flash chip found: Manufacturer ID: 98, Chip ID: 75 (Toshiba TC58256FT/DC)
> 1 flash chips found. Total DiskOnChip size: 32 MiB
> NFTL driver: nftlcore.c $Revision: 1.83 $, nftlmount.c $Revision: 1.23 $
> Cannot calculate an NFTL geometry to match size of 0xf760.
> Using C:989 H:16 S:4 (== 0xf740 sects)
> Partition check:
>  nftla: nftla1
> NET4: Linux TCP/IP 1.0 for NET4.0
> IP Protocols: ICMP, UDP, TCP
> IP: routing cache hash table of 512 buckets, 4Kbytes
> TCP: Hash tables configured (established 2048 bind 2048)
> NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
> Looking up port of RPC 100003/2 on 192.168.0.82
> Looking up port of RPC 100005/2 on 192.168.0.82
> VFS: Mounted root (nfs filesystem).
> Freeing unused kernel memory: 48k init
> INIT: version 2.78 booting
>                 Welcome to Sinovee Linux 2.0 (Overlord)
>                Press 'I' to enter interactive startup.
> Mounting proc filesystem:  [  OK  ]
> Configuring kernel parameters:  [  OK  ]
> Setting clock (utc): Fri Jun 24 02:00:28 CST 2005 [  OK  ]
> Activating swap partitions:  [  OK  ]
> Setting hostname 192.168.0.182:  [  OK  ]
> Starting watchdog: Watchdog daemon ver 0.1, (c) 2002, FEL co. ltd.
> watchdog: No such device
> [OK]
> INIT: Entering runlevel: 3
> Entering non-interactive startup
> Starting xinetd: [  OK  ]
> 
> Sinovee Linux 2.0 (Overlord)
> Kernel 2.4.4 on an MPC8xx
> 
> 192 login:
> 
> 

^ permalink raw reply

* AW: initrd rootfs ramdisk
From: David Grab @ 2005-07-05 11:18 UTC (permalink / raw)
  To: wd; +Cc: linuxppc-embedded
In-Reply-To: <20050705081854.8096B353A4A@atlas.denx.de>


>> i solved my problem last problem and now i get console output. :) So next
>> step is to setup the root file system. I want to use an image loaded into
>> ramdisk, but seems i´m missing something. I´m using u-boot to load the
>> ramdisk and linux kernel. Actually i don´t know how the kernel gets the
>> location of the loaded ramdisk. I only added the support (see Kernel

>It gets passed in registers r4 (start address) and r5 (end address).

>> configuration) and the command line parameter root=/dev/ram rw. But the
boot
>> command arguments from u-boot seems not recognized from the linux kernel.

>But the kernel prints the boot parameters just fine.

Maybe because i defined it in kernel configuration! But from u-boot i don´t
get any arguments.

CONFIG_CMDLINE="initrd=0x1fe0f000 root=/dev/ram rw ip=on
console=ttyS1,115200"

I thougt i can give the linux kernel position from u-boot where initrd is
located, but i have the same problem.

u-boot starts well, and the declarations for boot arguments are defined:

#define CONFIG_BOOTARGS		"root=/dev/ram rw"
#define CONFIG_BOOTCOMMAND	"bootm ff000000 ff800000"    /* autoboot command
*/

But the linux kernel seems not get them. With CONFIG_CMDLINE="ip=on
console=ttyS1,115200" in the kernel settings to see if the kernel gets the
command line parameters from u-boot as mentioned above, i got this error:

RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
VFS: Cannot open root device "<NULL>" or unknown-block(3,1)
Please append a correct "root=" boot option
Kernel panic - not syncing: VFS: Unable to mount root fs on
unknown-block(3,1)

I also read the FAQ
http://www.denx.de/twiki/bin/view/DULG/LinuxHangsAfterUncompressingKernel,
but there are even no CFG_IMMR declaration for any ppc440 board. And i also
don´t know what address to define there to hit my board, so i left them out.
The bd_info strucure in linux-2.6.11.6\include\asm-ppc\ppcboot.h and
u-boot-1.1.2\include\asm-ppc\u-boot.h is the same.

>> Should the option CONFIG_BOOT_LOAD point on the address of the ramdisk? I

>No.

ok

>> hope someone could help me to trigger out my problem.

>Are you sure that you have ext2 filesystem support  enabled  in  your
>kernel configuration?

Yes it´s selected as mentioned in kernel configuration parameters in my
first mail.

#
# File systems
#
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_EXT3_FS_XATTR=y
CONFIG_JBD=y
CONFIG_FS_MBCACHE=y

also declared:

#
# Block devices
#
CONFIG_BLK_DEV_LOOP=y
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_SIZE=4096
CONFIG_BLK_DEV_INITRD=y

and:

#
# Pseudo filesystems
#
CONFIG_PROC_FS=y
CONFIG_PROC_KCORE=y
CONFIG_SYSFS=y
CONFIG_RAMFS=y

^ permalink raw reply

* Re: [PATCH] 8xx: get_mmu_context() for (very) FEW_CONTEXTS and KERNEL_PREEMPT race/starvation issue
From: Guillaume Autran @ 2005-07-05 13:12 UTC (permalink / raw)
  To: linux-ppc-embedded
In-Reply-To: <42C3F978.2070305@mrv.com>


[-- Attachment #1.1: Type: text/plain, Size: 2596 bytes --]

Sorry for the late reply. I was away for the long weekend. However, my 
validation test ran all the way through the long weekend ! So, we can 
consider this a fix.
See the patch attached.

Thanks,
Guillaume.


Guillaume Autran wrote:

> Well, disabling preemption in the get_mmu_context() does not help much...
> I'm trying to disable preemption only inside destroy_mmu_context() as 
> suggested.
> Will keep you posted.
>
> Guillaume.
>
>
>
> Marcelo Tosatti wrote:
>
>>On Thu, Jun 30, 2005 at 09:26:07AM +1000, Benjamin Herrenschmidt wrote:
>>  
>>
>>>>Execution is resumed exactly where it has been interrupted.
>>>>
>>>>      
>>>>
>>>>>The idea behind my patch was to get rid of that nr_free_contexts counter 
>>>>>that is (I thing) redundant with the context_map.
>>>>>        
>>>>>
>>>>Apparently its there to avoid the spinlock exactly on !FEW_CONTEXTS machines.
>>>>
>>>>I suppose that what happens is that get_mmu_context() gets preempted after stealing
>>>>a context (so nr_free_contexts = 0), but before setting next_mmu_context to the 
>>>>next entry
>>>>
>>>>next_mmu_context = (ctx + 1) & LAST_CONTEXT;
>>>>      
>>>>
>>>Ugh ? Can switch_mm() be preempted at all ? Did I miss yet another
>>>"let's open 10 gazillion races for gun" Ingo patch ?
>>>    
>>>
>>
>>Doh nope it can't - my bad.
>>
>>  
>>
>>>>So if the now running higher prio tasks calls switch_mm() (which is likely to happen)
>>>>it loops forever on atomic_dec_if_positive(&nr_free_contexts), while steal_context()
>>>>sees "mm->context == CONTEXT".
>>>>      
>>>>
>>>I think the race is only when destroy_context() is preempted, but maybe
>>>I missed something.
>>>    
>>>
>>
>>Nope, I think you are right. My "theory" is obviously flawed now. 
>>
>>There seem to be several contexts where destroy_context() could be called
>>with preempt enabled - I should have been shutup in the first place :)
>>
>>Lets wait for Guillaume to test...
>>
>>  
>>
>
>-- 
>=======================================
>Guillaume Autran
>Senior Software Engineer
>MRV Communications, Inc.
>Tel: (978) 952-4932 office
>E-mail: gautran@mrv.com
>======================================= 
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Linuxppc-embedded mailing list
>Linuxppc-embedded@ozlabs.org
>https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>

-- 
=======================================
Guillaume Autran
Senior Software Engineer
MRV Communications, Inc.
Tel: (978) 952-4932 office
E-mail: gautran@mrv.com
======================================= 


[-- Attachment #1.2: Type: text/html, Size: 3781 bytes --]

[-- Attachment #2: preempt.patch --]
[-- Type: text/plain, Size: 650 bytes --]

diff -Nru linux-2.6.12/include/asm-ppc/mmu_context.h linux-2.6.12.new/include/asm-ppc/mmu_context.h
--- linux-2.6.12/include/asm-ppc/mmu_context.h	2005-06-17 15:48:29.000000000 -0400
+++ linux-2.6.12.new/include/asm-ppc/mmu_context.h	2005-07-05 08:58:46.000000000 -0400
@@ -149,6 +149,7 @@
  */
 static inline void destroy_context(struct mm_struct *mm)
 {
+	preempt_disable();
 	if (mm->context != NO_CONTEXT) {
 		clear_bit(mm->context, context_map);
 		mm->context = NO_CONTEXT;
@@ -156,6 +157,7 @@
 		atomic_inc(&nr_free_contexts);
 #endif
 	}
+	preempt_enable();
 }
 
 static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,

^ permalink raw reply

* 2.6.12-rc2 netconsole problem
From: Sam Song @ 2005-07-05 13:55 UTC (permalink / raw)
  To: linuxppc-embedded

Hi all,

I tried netconsole on a 8241 board with RealTek 8110S 
Gb Ethernet.It seemed nice so far but still one step 
to make it. Did I miss sth or what?

Linux version 2.6.12-rc2 (root@sam.shu.org) (gcc
version 3.2.2 20030217 (Yellow Dog Linux 3.0
3.2.2-2a_1)) #3 Mon Jul 4 12:33:23 CST 2005
......
Kernel command line:
netconsole=@192.168.57.243/eth0,@192.168.57.200/ 
root=/dev/ram0 rw
ip=192.168.57.243:192.168.57.200:::TOPAZ:eth0:off 
panic=1
netconsole: local port 6665
netconsole: local IP 192.168.57.243
netconsole: interface eth0
netconsole: remote port 6666
netconsole: remote IP 192.168.57.200
netconsole: remote ethernet address ff:ff:ff:ff:ff:ff
......
RAMDISK driver initialized: 16 RAM disks of 200000K 
size 1024 blocksize
eth0: RTL8169s/8110s Gigabit Ethernet driver 2.2 at 
0xfe00, 00:d0:b8:00:c3:52, IRQ 0
eth0: Auto-negotiation Enabled.
eth0: 100Mbps Full-duplex operation.
netconsole: device eth0 not up yet, forcing it
netconsole: carrier detect appears untrustworthy,
waiting 4 seconds
netconsole: network logging started
Uniform Multi-Platform E-IDE driver Revision:
7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes;
override with idebus=xx
......
NET: Registered protocol family 2
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP established hash table entries: 4096 (order: 3,
32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384
bytes)
TCP: Hash tables configured (established 4096 bind
4096)
NET: Registered protocol family 1
NET: Registered protocol family 17
IP-Config: Guessing netmask 255.255.255.0
IP-Config: Complete:
      device=eth0, addr=192.168.57.243,
mask=255.255.255.0, gw=255.255.255.255,
     host=192, domain=, nis-domain=(none),
     bootserver=192.168.57.200,
rootserver=192.168.57.200, rootpath=
RAMDISK: Compressed image found at block 0
EXT2-fs warning: mounting unchecked fs, running e2fsck
is recommended
VFS: Mounted root (ext2 filesystem).
Mounted devfs on /dev
Freeing unused kernel memory: 120k init

OK, it just stoped before init process. Is there any
necessary to fix sth on RAMDISK like add netconsole
device node?

Thanks in advance,

Sam


	

	
		
___________________________________________________________ 
雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱
http://cn.mail.yahoo.com/?id=77071

^ permalink raw reply

* Re: PPC bn_div_words routine rewrite
From: Andy Polyakov @ 2005-07-05 15:00 UTC (permalink / raw)
  To: openssl-dev; +Cc: linuxppc-embedded
In-Reply-To: <4dd15d1805070407352bd5120e@mail.gmail.com>

> Let's start the week off with less hostility and more productive
> criticism on this topic.

If you want productivity, then provide real evidence in form of stack 
backtrace at segmentation violation point, disassemble output in the 
vicinity of segmentation violation point and 'info registers' output at 
the same point. As for hostility I leave it without comment, as you're 
apparently can outrank anybody in that area:-)

>>But you're apparently right about a bug being present in PPC assembler.
> 
> 
> So you are saying there is a bug in the GCC assembler? How confident
> are you in that?  Is the first correct step to examine the assembly
> code for errors before jumping to any conclusion that the GCC
> assembler is bad?

Did I say GCC assembler? I said PPC assembler, which refers to 
crypto/bn/asm/ppc.pl.

>>>>This is a rewrite of the bn_div_words routine for the PowerPC arch,
>>>>tested on a MPC8xx processor.
>>
>>Well, suggested routine apparently sends ssh-keygen on the PPC-based
>>32-bit system I have access to to an end-less loop... 
> 
> 
> If you care to read the c function I supplied or if you don't believe
> it:  If you understand ppc 32-bit instructions, as specified in the
> PowerPC Microprocessor Family: Programming Environments for 32-Bit
> Microprocessors.  My routine would not be able to find a condition
> that will make it go into an end-less loop,unless you messed up bad
> somewhere.

I didn't say that suggested routine goes into an end-less loop, but that 
it "*apparently* sends ssh-keygen into end-less loop." I made no claims 
about which routine exactly loops, and I even admit that I don't know 
for sure if it was in fact end-less loop, because I've chosen to kill 
the process after couple of minutes. Note that normally it takes just 
few seconds on the machine I've tested on, so that couple of minutes is 
essentially unacceptable and by all means *appears* as end-less loop.

> In summary, what I am trying to provide the community is an
> alternative to ... the current implementation of which is
> very questionable.

crypto/bn/asm/ppc.pl distributed with OpenSSL was designed for and 
explicitly tested by IBM under 32- and 64-bit PPC Linux, 32- and 64-bit 
AIX, as well as 32-bit MacOS X. Special care was taken to make sure that 
neither of ABIs/calling conventions used by above listed platforms are 
violated, so that module can be safely invoked by compiler-generated 
code for above mentioned OSes. Afterwards there were reports that it was 
successfully used on unspecified [in report] embedded PPC-based 
platform. Despite this on Friday I could personally confirm on 32-bit 
MacOS X that there admittedly was a bug in ppc.pl, which manifests as 
failure to generate sane decimal ASCII presentation of a BIGNUM, which 
is exactly the kind of operation taking place when you run ssh-keygen -t 
rsa1 [it should be noted decimal ASCII is unfortunately not covered by 
'make test_bn' suite]. But under no circumstances segmentation violation 
was observed. At the same time I could personally confirm that if pasted 
into osx32_ppc.s, suggested implementation induces 'make test_bn' 
failure on 32-bit MacOS X. In particular test/bntest terminates with

print "test BN_sqr\n"
-FF554CAEAE * -FF554CAEAE - FEAB0B30019BBA80FE44
Square test failed!
1

while test/exptest:

BN_mod_exp_recp() problems
14482:error:03082065:bignum routines:BN_div_recp:bad 
reciprocal:bn_recp.c:194:

For me it's enough reasons to become sceptical to submission and conduct 
trouble-shooting of my own. Currently available ppc.pl was verified to 
pass 'make test_bn' on 32-bit MacOS X, 32- and 64-bit AIX [tested by 
IBM], as well as to generate correct decimal ASCII presentation on the 
mentioned platforms. If it doesn't work for you, then submit information 
listed in the beginning of the letter. A.

^ permalink raw reply

* Fwd: PPC bn_div_words routine rewrite
From: David Ho @ 2005-07-05 15:45 UTC (permalink / raw)
  To: appro, linuxppc-embedded
In-Reply-To: <4dd15d1805070508312427a0ba@mail.gmail.com>

This is the second confirmed report of the same problem on the ppc8xx.

After reading my email.  I must say I was the unfriendly one, I
apologize for that.

More debugging evidence to come.

---------- Forwarded message ----------
From: Murch, Christopher <cmurch@mrv.com>
Date: Jul 1, 2005 9:46 AM
Subject: RE: PPC bn_div_words routine rewrite
To: David Ho <davidkwho@gmail.com>


David,
I had observed the same issue on ppc 8xx machines after upgrading to the as=
m
version of the BN routines.  Thank you very much for your work for the fix.
My question is, do you have high confidence in the other new asm ppc BN
routines after observing this issue or do you think they might have similia=
r
problems?
Thanks.
Chris

-----Original Message-----
From: David Ho [mailto:davidkwho@gmail.com]
Sent: Thursday, June 30, 2005 6:22 PM
To: openssl-dev@openssl.org; linuxppc-embedded@ozlabs.org
Subject: Re: PPC bn_div_words routine rewrite


The reason I had to redo this routine, in case anyone is wondering, is
because ssh-keygen  segfaults when this assembly routine returns junk
to the BN_div_word function. On a ppc, if you issue the command

ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""

The program craps out when it tries to write the public key in ascii
decimal.

Regards,
David

On 6/30/05, David Ho <davidkwho@gmail.com> wrote:
> Hi all,
>
> This is a rewrite of the bn_div_words routine for the PowerPC arch,
> tested on a MPC8xx processor.
> I initially thought there is maybe a small mistake in the code that
> requires a one-liner change but it turns out I have to redo the
> routine.
> I guess this routine is not called very often as I see that most other
> routines are hand-crafted, whereas this routine is compiled from a C
> function that apparently has not gone through a whole lot of testing.
>
> I wrote a C function to confirm correctness of the code.
>
> unsigned long div_words (unsigned long h,
>                          unsigned long l,
>                          unsigned long d)
> {
>   unsigned long i_h; /* intermediate dividend */
>   unsigned long i_q; /* quotient of i_h/d */
>   unsigned long i_r; /* remainder of i_h/d */
>
>   unsigned long i_cntr;
>   unsigned long i_carry;
>
>   unsigned long ret_q; /* return quotient */
>
>   /* cannot divide by zero */
>   if (d =3D=3D 0) return 0xffffffff;
>
>   /* do simple 32-bit divide */
>   if (h =3D=3D 0) return l/d;
>
>   i_q =3D h/d;
>   i_r =3D h - (i_q*d);
>   ret_q =3D i_q;
>
>   i_cntr =3D 32;
>
>   while (i_cntr--)
>   {
>     i_carry =3D (l & 0x80000000) ? 1:0;
>     l =3D l << 1;
>
>     i_h =3D (i_r << 1) | i_carry;
>     i_q =3D i_h/d;
>     i_r =3D i_h - (i_q*d);
>
>     ret_q =3D (ret_q << 1) | i_q;
>   }
>
>   return ret_q;
> }
>
>
> Then I handcrafted the routine in PPC assembly.
> The result is a 26 line assembly that is easy to understand and
> predictable as opposed to a 81liner that I am still trying to
> decipher...
> If anyone is interested in incorporating this routine to the openssl
> code I'll be happy to assist.
> At this point I think I will be taking a bit of a break from this 3
> day debugging/fixing marathon.
>
> Regards,
> David Ho
>
>
> #
> #       Handcrafted version of bn_div_words
> #
> #       r3 =3D h
> #       r4 =3D l
> #       r5 =3D d
>
>         cmplwi  0,r5,0                  # compare r5 and 0
>         bc      BO_IF_NOT,CR0_EQ,.Lppcasm_div1  # proceed if d!=3D0
>         li      r3,-1                   # d=3D0 return -1
>         bclr    BO_ALWAYS,CR0_LT
> .Lppcasm_div1:
>         cmplwi  0,r3,0                  # compare r3 and 0
>         bc      BO_IF_NOT,CR0_EQ,.Lppcasm_div2  # proceed if h !=3D 0
>         divwu   r3,r4,r5                # ret_q =3D l/d
>         bclr    BO_ALWAYS,CR0_LT        # return result in r3
> .Lppcasm_div2:
>         divwu   r9,r3,r5                # i_q =3D h/d
>         mullw   r10,r9,r5               # i_r =3D h - (i_q*d)
>         subf    r10,r10,r3
>         mr      r3,r9                   # req_q =3D i_q
> .Lppcasm_set_ctr:
>         li      r12,32                  # ctr =3D bitsizeof(d)
>         mtctr   r12
> .Lppcasm_div_loop:
>         addc    r4,r4,r4                # l =3D l << 1 -> i_carry
>         adde    r11,r10,r10             # i_h =3D (i_r << 1) | i_carry
>         divwu   r9,r11,r5               # i_q =3D i_h/d
>         mullw   r10,r9,r5               # i_r =3D i_h - (i_q*d)
>         subf    r10,r10,r11
>         add     r3,r3,r3                # ret_q =3D ret_q << 1 | i_q
>         add     r3,r3,r9
>         bc      BO_dCTR_NZERO,CR0_EQ,.Lppcasm_div_loop
> .Lppc_div_end:
>         bclr    BO_ALWAYS,CR0_LT        # return result in r3
>         .long   0x00000000
>
_______________________________________________
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

^ permalink raw reply

* Re: AW: initrd rootfs ramdisk
From: Wolfgang Denk @ 2005-07-05 16:01 UTC (permalink / raw)
  To: David Grab; +Cc: linuxppc-embedded
In-Reply-To: <000801c58153$54af2400$f201a8c0@SN7606>

In message <000801c58153$54af2400$f201a8c0@SN7606> you wrote:
> 
> >But the kernel prints the boot parameters just fine.
> 
> Maybe because i defined it in kernel configuration! But from u-boot i don´t
> get any arguments.

Then you must be using a wrong image type. Are you sure you use "make
uImage" to build your kernel image for U-Boot?

> I thougt i can give the linux kernel position from u-boot where initrd is
> located, but i have the same problem.

You don;t. U-Boot passes this information automatically.

> RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
> loop: loaded (max 8 devices)
> VFS: Cannot open root device "<NULL>" or unknown-block(3,1)
> Please append a correct "root=" boot option
> Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(3,1)

Block device 3, 1 is /dev/hda1 - is your ramdisk known to be working?


Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"The majority of the stupid is  invincible  and  guaranteed  for  all
time.  The  terror  of their tyranny, however, is alleviated by their
lack of consistency."                               - Albert Einstein

^ permalink raw reply

* Re: PPC bn_div_words routine rewrite
From: David Ho @ 2005-07-05 16:36 UTC (permalink / raw)
  To: appro, linuxppc-embedded, openssl-dev
In-Reply-To: <4dd15d1805070508451b76afae@mail.gmail.com>

First pass debugging results from gdb on ppc8xx.  Executing ssh-keygen
with following arguments.

(gdb) show args
Argument list to give program being debugged when it is started is
    "-t rsa1 -f /etc/ssh/ssh_host_key -N """.

Program received signal SIGSEGV, Segmentation fault.
BN_bn2dec (a=3D0x1002d9f0) at bn_print.c:136
136                             *lp=3DBN_div_word(t,BN_DEC_CONV);

(gdb) i r
r0             0x0      0
r1             0x7fffd580       2147472768
r2             0x30012868       805382248
r3             0x80000000       2147483648
r4             0xfef33fc        267334652
r5             0x25     37
r6             0xfccdef8        265084664
r7             0x7fffd4c0       2147472576
r8             0xfbad2887       4222429319
r9             0x84044022       2214871074
r10            0x0      0
r11            0x2      2
r12            0xfef2054        267329620
r13            0x10030bc8       268635080
r14            0x0      0
r15            0x0      0
r16            0x0      0
r17            0x0      0
r18            0x0      0
r19            0x0      0
r20            0x0      0
r21            0x0      0
r22            0x0      0
r23            0x64     100
r24            0x5      5
r25            0x1002d438       268620856
r26            0x1002d9f0       268622320
r27            0x1002c578       268617080
r28            0x1      1
r29            0x10031000       268636160
r30            0xffbf7d0        268171216
r31            0x1002d9f0       268622320
pc             0xfef2058        267329624
ps             0xd032   53298
cr             0x24044022       604258338
lr             0xfef2054        267329620
ctr            0xfccefa0        265088928
xer            0x20000000       536870912
fpscr          0x0      0
vscr           0x0      0
vrsave         0x0      0

(gdb) p/x $pc
$1 =3D 0xfef2058

0x0fef2058 <BN_bn2dec+472>:     stw     r3,0(r29)

(gdb) x 0x10031000
0x10031000:     Cannot access memory at address 0x10031000










On 7/5/05, David Ho <davidkwho@gmail.com> wrote:
> This is the second confirmed report of the same problem on the ppc8xx.
>=20
> After reading my email.  I must say I was the unfriendly one, I
> apologize for that.
>=20
> More debugging evidence to come.
>=20
> ---------- Forwarded message ----------
> From: Murch, Christopher <cmurch@mrv.com>
> Date: Jul 1, 2005 9:46 AM
> Subject: RE: PPC bn_div_words routine rewrite
> To: David Ho <davidkwho@gmail.com>
>=20
>=20
> David,
> I had observed the same issue on ppc 8xx machines after upgrading to the =
asm
> version of the BN routines.  Thank you very much for your work for the fi=
x.
> My question is, do you have high confidence in the other new asm ppc BN
> routines after observing this issue or do you think they might have simil=
iar
> problems?
> Thanks.
> Chris
>=20
> -----Original Message-----
> From: David Ho [mailto:davidkwho@gmail.com]
> Sent: Thursday, June 30, 2005 6:22 PM
> To: openssl-dev@openssl.org; linuxppc-embedded@ozlabs.org
> Subject: Re: PPC bn_div_words routine rewrite
>=20
>=20
> The reason I had to redo this routine, in case anyone is wondering, is
> because ssh-keygen  segfaults when this assembly routine returns junk
> to the BN_div_word function. On a ppc, if you issue the command
>=20
> ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
>=20
> The program craps out when it tries to write the public key in ascii
> decimal.
>=20
> Regards,
> David
>=20
> On 6/30/05, David Ho <davidkwho@gmail.com> wrote:
> > Hi all,
> >
> > This is a rewrite of the bn_div_words routine for the PowerPC arch,
> > tested on a MPC8xx processor.
> > I initially thought there is maybe a small mistake in the code that
> > requires a one-liner change but it turns out I have to redo the
> > routine.
> > I guess this routine is not called very often as I see that most other
> > routines are hand-crafted, whereas this routine is compiled from a C
> > function that apparently has not gone through a whole lot of testing.
> >
> > I wrote a C function to confirm correctness of the code.
> >
> > unsigned long div_words (unsigned long h,
> >                          unsigned long l,
> >                          unsigned long d)
> > {
> >   unsigned long i_h; /* intermediate dividend */
> >   unsigned long i_q; /* quotient of i_h/d */
> >   unsigned long i_r; /* remainder of i_h/d */
> >
> >   unsigned long i_cntr;
> >   unsigned long i_carry;
> >
> >   unsigned long ret_q; /* return quotient */
> >
> >   /* cannot divide by zero */
> >   if (d =3D=3D 0) return 0xffffffff;
> >
> >   /* do simple 32-bit divide */
> >   if (h =3D=3D 0) return l/d;
> >
> >   i_q =3D h/d;
> >   i_r =3D h - (i_q*d);
> >   ret_q =3D i_q;
> >
> >   i_cntr =3D 32;
> >
> >   while (i_cntr--)
> >   {
> >     i_carry =3D (l & 0x80000000) ? 1:0;
> >     l =3D l << 1;
> >
> >     i_h =3D (i_r << 1) | i_carry;
> >     i_q =3D i_h/d;
> >     i_r =3D i_h - (i_q*d);
> >
> >     ret_q =3D (ret_q << 1) | i_q;
> >   }
> >
> >   return ret_q;
> > }
> >
> >
> > Then I handcrafted the routine in PPC assembly.
> > The result is a 26 line assembly that is easy to understand and
> > predictable as opposed to a 81liner that I am still trying to
> > decipher...
> > If anyone is interested in incorporating this routine to the openssl
> > code I'll be happy to assist.
> > At this point I think I will be taking a bit of a break from this 3
> > day debugging/fixing marathon.
> >
> > Regards,
> > David Ho
> >
> >
> > #
> > #       Handcrafted version of bn_div_words
> > #
> > #       r3 =3D h
> > #       r4 =3D l
> > #       r5 =3D d
> >
> >         cmplwi  0,r5,0                  # compare r5 and 0
> >         bc      BO_IF_NOT,CR0_EQ,.Lppcasm_div1  # proceed if d!=3D0
> >         li      r3,-1                   # d=3D0 return -1
> >         bclr    BO_ALWAYS,CR0_LT
> > .Lppcasm_div1:
> >         cmplwi  0,r3,0                  # compare r3 and 0
> >         bc      BO_IF_NOT,CR0_EQ,.Lppcasm_div2  # proceed if h !=3D 0
> >         divwu   r3,r4,r5                # ret_q =3D l/d
> >         bclr    BO_ALWAYS,CR0_LT        # return result in r3
> > .Lppcasm_div2:
> >         divwu   r9,r3,r5                # i_q =3D h/d
> >         mullw   r10,r9,r5               # i_r =3D h - (i_q*d)
> >         subf    r10,r10,r3
> >         mr      r3,r9                   # req_q =3D i_q
> > .Lppcasm_set_ctr:
> >         li      r12,32                  # ctr =3D bitsizeof(d)
> >         mtctr   r12
> > .Lppcasm_div_loop:
> >         addc    r4,r4,r4                # l =3D l << 1 -> i_carry
> >         adde    r11,r10,r10             # i_h =3D (i_r << 1) | i_carry
> >         divwu   r9,r11,r5               # i_q =3D i_h/d
> >         mullw   r10,r9,r5               # i_r =3D i_h - (i_q*d)
> >         subf    r10,r10,r11
> >         add     r3,r3,r3                # ret_q =3D ret_q << 1 | i_q
> >         add     r3,r3,r9
> >         bc      BO_dCTR_NZERO,CR0_EQ,.Lppcasm_div_loop
> > .Lppc_div_end:
> >         bclr    BO_ALWAYS,CR0_LT        # return result in r3
> >         .long   0x00000000
> >
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>

^ permalink raw reply

* Re: PPC bn_div_words routine rewrite
From: David Ho @ 2005-07-05 17:01 UTC (permalink / raw)
  To: appro, linuxppc-embedded, openssl-dev
In-Reply-To: <4dd15d1805070509361339d08e@mail.gmail.com>

I can tell you with certainty, with reference to the function
BN_bn2dec, that since lp is a pointer, and within the while loop
around bn_print.c:136 lp is being incremented.  Because the test
BN_is_zero(t) is always false, you have a pointer that is going off
into the stratosphere, hence the segfault on ppc8xx.

More analysis to come.

On 7/5/05, David Ho <davidkwho@gmail.com> wrote:
> First pass debugging results from gdb on ppc8xx.  Executing ssh-keygen
> with following arguments.
>=20
> (gdb) show args
> Argument list to give program being debugged when it is started is
>     "-t rsa1 -f /etc/ssh/ssh_host_key -N """.
>=20
> Program received signal SIGSEGV, Segmentation fault.
> BN_bn2dec (a=3D0x1002d9f0) at bn_print.c:136
> 136                             *lp=3DBN_div_word(t,BN_DEC_CONV);
>=20
> (gdb) i r
> r0             0x0      0
> r1             0x7fffd580       2147472768
> r2             0x30012868       805382248
> r3             0x80000000       2147483648
> r4             0xfef33fc        267334652
> r5             0x25     37
> r6             0xfccdef8        265084664
> r7             0x7fffd4c0       2147472576
> r8             0xfbad2887       4222429319
> r9             0x84044022       2214871074
> r10            0x0      0
> r11            0x2      2
> r12            0xfef2054        267329620
> r13            0x10030bc8       268635080
> r14            0x0      0
> r15            0x0      0
> r16            0x0      0
> r17            0x0      0
> r18            0x0      0
> r19            0x0      0
> r20            0x0      0
> r21            0x0      0
> r22            0x0      0
> r23            0x64     100
> r24            0x5      5
> r25            0x1002d438       268620856
> r26            0x1002d9f0       268622320
> r27            0x1002c578       268617080
> r28            0x1      1
> r29            0x10031000       268636160
> r30            0xffbf7d0        268171216
> r31            0x1002d9f0       268622320
> pc             0xfef2058        267329624
> ps             0xd032   53298
> cr             0x24044022       604258338
> lr             0xfef2054        267329620
> ctr            0xfccefa0        265088928
> xer            0x20000000       536870912
> fpscr          0x0      0
> vscr           0x0      0
> vrsave         0x0      0
>=20
> (gdb) p/x $pc
> $1 =3D 0xfef2058
>=20
> 0x0fef2058 <BN_bn2dec+472>:     stw     r3,0(r29)
>=20
> (gdb) x 0x10031000
> 0x10031000:     Cannot access memory at address 0x10031000
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
>=20
> On 7/5/05, David Ho <davidkwho@gmail.com> wrote:
> > This is the second confirmed report of the same problem on the ppc8xx.
> >
> > After reading my email.  I must say I was the unfriendly one, I
> > apologize for that.
> >
> > More debugging evidence to come.
> >
> > ---------- Forwarded message ----------
> > From: Murch, Christopher <cmurch@mrv.com>
> > Date: Jul 1, 2005 9:46 AM
> > Subject: RE: PPC bn_div_words routine rewrite
> > To: David Ho <davidkwho@gmail.com>
> >
> >
> > David,
> > I had observed the same issue on ppc 8xx machines after upgrading to th=
e asm
> > version of the BN routines.  Thank you very much for your work for the =
fix.
> > My question is, do you have high confidence in the other new asm ppc BN
> > routines after observing this issue or do you think they might have sim=
iliar
> > problems?
> > Thanks.
> > Chris
> >
> > -----Original Message-----
> > From: David Ho [mailto:davidkwho@gmail.com]
> > Sent: Thursday, June 30, 2005 6:22 PM
> > To: openssl-dev@openssl.org; linuxppc-embedded@ozlabs.org
> > Subject: Re: PPC bn_div_words routine rewrite
> >
> >
> > The reason I had to redo this routine, in case anyone is wondering, is
> > because ssh-keygen  segfaults when this assembly routine returns junk
> > to the BN_div_word function. On a ppc, if you issue the command
> >
> > ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
> >
> > The program craps out when it tries to write the public key in ascii
> > decimal.
> >
> > Regards,
> > David
> >
> > On 6/30/05, David Ho <davidkwho@gmail.com> wrote:
> > > Hi all,
> > >
> > > This is a rewrite of the bn_div_words routine for the PowerPC arch,
> > > tested on a MPC8xx processor.
> > > I initially thought there is maybe a small mistake in the code that
> > > requires a one-liner change but it turns out I have to redo the
> > > routine.
> > > I guess this routine is not called very often as I see that most othe=
r
> > > routines are hand-crafted, whereas this routine is compiled from a C
> > > function that apparently has not gone through a whole lot of testing.
> > >
> > > I wrote a C function to confirm correctness of the code.
> > >
> > > unsigned long div_words (unsigned long h,
> > >                          unsigned long l,
> > >                          unsigned long d)
> > > {
> > >   unsigned long i_h; /* intermediate dividend */
> > >   unsigned long i_q; /* quotient of i_h/d */
> > >   unsigned long i_r; /* remainder of i_h/d */
> > >
> > >   unsigned long i_cntr;
> > >   unsigned long i_carry;
> > >
> > >   unsigned long ret_q; /* return quotient */
> > >
> > >   /* cannot divide by zero */
> > >   if (d =3D=3D 0) return 0xffffffff;
> > >
> > >   /* do simple 32-bit divide */
> > >   if (h =3D=3D 0) return l/d;
> > >
> > >   i_q =3D h/d;
> > >   i_r =3D h - (i_q*d);
> > >   ret_q =3D i_q;
> > >
> > >   i_cntr =3D 32;
> > >
> > >   while (i_cntr--)
> > >   {
> > >     i_carry =3D (l & 0x80000000) ? 1:0;
> > >     l =3D l << 1;
> > >
> > >     i_h =3D (i_r << 1) | i_carry;
> > >     i_q =3D i_h/d;
> > >     i_r =3D i_h - (i_q*d);
> > >
> > >     ret_q =3D (ret_q << 1) | i_q;
> > >   }
> > >
> > >   return ret_q;
> > > }
> > >
> > >
> > > Then I handcrafted the routine in PPC assembly.
> > > The result is a 26 line assembly that is easy to understand and
> > > predictable as opposed to a 81liner that I am still trying to
> > > decipher...
> > > If anyone is interested in incorporating this routine to the openssl
> > > code I'll be happy to assist.
> > > At this point I think I will be taking a bit of a break from this 3
> > > day debugging/fixing marathon.
> > >
> > > Regards,
> > > David Ho
> > >
> > >
> > > #
> > > #       Handcrafted version of bn_div_words
> > > #
> > > #       r3 =3D h
> > > #       r4 =3D l
> > > #       r5 =3D d
> > >
> > >         cmplwi  0,r5,0                  # compare r5 and 0
> > >         bc      BO_IF_NOT,CR0_EQ,.Lppcasm_div1  # proceed if d!=3D0
> > >         li      r3,-1                   # d=3D0 return -1
> > >         bclr    BO_ALWAYS,CR0_LT
> > > .Lppcasm_div1:
> > >         cmplwi  0,r3,0                  # compare r3 and 0
> > >         bc      BO_IF_NOT,CR0_EQ,.Lppcasm_div2  # proceed if h !=3D 0
> > >         divwu   r3,r4,r5                # ret_q =3D l/d
> > >         bclr    BO_ALWAYS,CR0_LT        # return result in r3
> > > .Lppcasm_div2:
> > >         divwu   r9,r3,r5                # i_q =3D h/d
> > >         mullw   r10,r9,r5               # i_r =3D h - (i_q*d)
> > >         subf    r10,r10,r3
> > >         mr      r3,r9                   # req_q =3D i_q
> > > .Lppcasm_set_ctr:
> > >         li      r12,32                  # ctr =3D bitsizeof(d)
> > >         mtctr   r12
> > > .Lppcasm_div_loop:
> > >         addc    r4,r4,r4                # l =3D l << 1 -> i_carry
> > >         adde    r11,r10,r10             # i_h =3D (i_r << 1) | i_carr=
y
> > >         divwu   r9,r11,r5               # i_q =3D i_h/d
> > >         mullw   r10,r9,r5               # i_r =3D i_h - (i_q*d)
> > >         subf    r10,r10,r11
> > >         add     r3,r3,r3                # ret_q =3D ret_q << 1 | i_q
> > >         add     r3,r3,r9
> > >         bc      BO_dCTR_NZERO,CR0_EQ,.Lppcasm_div_loop
> > > .Lppc_div_end:
> > >         bclr    BO_ALWAYS,CR0_LT        # return result in r3
> > >         .long   0x00000000
> > >
> > _______________________________________________
> > Linuxppc-embedded mailing list
> > Linuxppc-embedded@ozlabs.org
> > https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> >
>

^ permalink raw reply

* Re: [PATCH] Set cpu explicitly in kernel compiles
From: Olaf Hering @ 2005-07-05 18:14 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-dev
In-Reply-To: <20050703183237.GC16764@smtp.west.cox.net>

 On Sun, Jul 03, Tom Rini wrote:

> cpu-as-y = -Wa,-mcpu=powerpc	# Pure ppc32

That alone should fix it, adding -mcpu=$somecpu may generate bad code
for other cpu types, according to alanm.

> cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
> cpu-as-$(CONFIG_PPC_601) := -Wa,-mcpu=601 # Or whatever the 601 option is

601 doesnt need special cflags handling.

cpu-as-$(CONFIG_6xx) += -Wa,-mcpu=powerpc

may be enough, no idea if -Wa is required.

^ permalink raw reply

* Re: 2.6.12-rc2 netconsole problem
From: Tom Rini @ 2005-07-05 19:45 UTC (permalink / raw)
  To: Sam Song; +Cc: linuxppc-embedded
In-Reply-To: <20050705135513.94638.qmail@web15803.mail.cnb.yahoo.com>

On Tue, Jul 05, 2005 at 09:55:13PM +0800, Sam Song wrote:

[snip]
> OK, it just stoped before init process. Is there any
> necessary to fix sth on RAMDISK like add netconsole
> device node?

Nope, that's how netconsole works, it's not interactive (like console is
after init is spawned).

-- 
Tom Rini
http://gate.crashing.org/~trini/

^ permalink raw reply

* Re: [PATCH] Set cpu explicitly in kernel compiles
From: Tom Rini @ 2005-07-05 19:47 UTC (permalink / raw)
  To: Olaf Hering; +Cc: linuxppc-dev
In-Reply-To: <20050705181448.GA28142@suse.de>

On Tue, Jul 05, 2005 at 08:14:48PM +0200, Olaf Hering wrote:
>  On Sun, Jul 03, Tom Rini wrote:
> 
> > cpu-as-y = -Wa,-mcpu=powerpc	# Pure ppc32
> 
> That alone should fix it, adding -mcpu=$somecpu may generate bad code
> for other cpu types, according to alanm.

Exactly.

> > cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
> > cpu-as-$(CONFIG_PPC_601) := -Wa,-mcpu=601 # Or whatever the 601 option is
> 
> 601 doesnt need special cflags handling.

gcc info page says that -mcpu=powerpc won't work for 601.

-- 
Tom Rini
http://gate.crashing.org/~trini/

^ permalink raw reply

* Re: mpc8xx and ld.so problem
From: Tom Rini @ 2005-07-05 19:53 UTC (permalink / raw)
  To: Yuli Barcohen; +Cc: linux-ppc-embedded
In-Reply-To: <17096.61878.43282.752343@astp0002.localdomain>

On Mon, Jul 04, 2005 at 11:22:14AM +0300, Yuli Barcohen wrote:
> >>>>> Jason McMullan writes:
> 
> [...deleted...]
> 
>     Jason> Ha. Funny. The glibc powerpc maintainer doesn't want any
>     Jason> embedded fixes in the mainline. Last I checked, that was for
>     Jason> 'the tools vendors' to fix.
> 
>     Jason> "We won't work around processor bugs" is their philosophy.
> 
> [...deleted...]
> 
> I investigated the problem a bit when I had trouble with a self-compiled
> glibc a year or so ago. IIRC, I found bug in the memset code, not in the
> chip. The code was just wrong for cache line sizes not equal to 32. So
> memset.S is good for 60x series (PQII included) but for 8xx it fails. We
> use dcbX instructions in some kernel drivers and since we never had any
> problems with those drivers I'm a bit surprised to hear that all 8xx
> chips have got that bug.

It's also OK on a multiple of 32, iirc, but not smaller.  And using the
information the kernel does export would be too slow.  Or at least no
one figured out a good way to do it, userspace side.

-- 
Tom Rini
http://gate.crashing.org/~trini/

^ permalink raw reply

* Re: [PATCH] Set cpu explicitly in kernel compiles
From: Olaf Hering @ 2005-07-05 19:54 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-dev
In-Reply-To: <20050705194724.GB6878@smtp.west.cox.net>

 On Tue, Jul 05, Tom Rini wrote:

> gcc info page says that -mcpu=powerpc won't work for 601.

-mcpu=common may work for everyone, after a quick grep in
gcc/config/rs6000

^ permalink raw reply

* Re: [PATCH] Set cpu explicitly in kernel compiles
From: Tom Rini @ 2005-07-05 19:58 UTC (permalink / raw)
  To: Olaf Hering; +Cc: linuxppc-dev
In-Reply-To: <20050705195441.GA15455@suse.de>

On Tue, Jul 05, 2005 at 09:54:41PM +0200, Olaf Hering wrote:
>  On Tue, Jul 05, Tom Rini wrote:
> 
> > gcc info page says that -mcpu=powerpc won't work for 601.
> 
> -mcpu=common may work for everyone, after a quick grep in
> gcc/config/rs6000

It does, and that's the code bloat you're trying to get rid of :)

-- 
Tom Rini
http://gate.crashing.org/~trini/

^ permalink raw reply

* Re: [PATCH] Set cpu explicitly in kernel compiles
From: Olaf Hering @ 2005-07-05 20:17 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-dev
In-Reply-To: <20050705195819.GD6878@smtp.west.cox.net>

 On Tue, Jul 05, Tom Rini wrote:

> On Tue, Jul 05, 2005 at 09:54:41PM +0200, Olaf Hering wrote:
> >  On Tue, Jul 05, Tom Rini wrote:
> > 
> > > gcc info page says that -mcpu=powerpc won't work for 601.
> > 
> > -mcpu=common may work for everyone, after a quick grep in
> > gcc/config/rs6000
> 
> It does, and that's the code bloat you're trying to get rid of :)

Yeah, leads to fun like that:

init/built-in.o: In function `calibrate_delay':
: undefined reference to `__quous'

need to grep harder.

^ permalink raw reply

* Re: PPC bn_div_words routine rewrite
From: David Ho @ 2005-07-05 20:21 UTC (permalink / raw)
  To: appro, linuxppc-embedded, openssl-dev
In-Reply-To: <4dd15d1805070510015cdaac04@mail.gmail.com>

Let's take first call to BN_div_word for example from BN_bn2dec, the
parameter being passed to BN_div_word is (a=3D35, w=3D1000000000) (decimal
numbers).  It then calls the bn_div_words with (h=3D0, l=3D35,
d=3D1000000000)  if you examine the code in linux_ppc32.s it will exit
early on because h is 0.  the routine returns a divide by 0, which is
undefined according to the manual.  In the case of ppc8xx the result
is 0x80000000.  So this is the return value from bn_div_words, as seen
in register R3.

So what happens next is BN_div_word modifies "a" (1st parameter) with
the result (0x80000000) and returns 23 as the remainder of the
division. So "a" is never zero as a result and hence the test for
BN_is_zero is always false.  The problem fails the very first time it
uses bn_div_words.

The next thing I did naturally was to fix the case when you have h=3D0,
which you can quite easy do it with the native divwu instruction.  Lo
and behold I was once again disappointed when h is not equal to 0.

More to come...


On 7/5/05, David Ho <davidkwho@gmail.com> wrote:
> I can tell you with certainty, with reference to the function
> BN_bn2dec, that since lp is a pointer, and within the while loop
> around bn_print.c:136 lp is being incremented.  Because the test
> BN_is_zero(t) is always false, you have a pointer that is going off
> into the stratosphere, hence the segfault on ppc8xx.
>=20
> More analysis to come.
>=20
> On 7/5/05, David Ho <davidkwho@gmail.com> wrote:
> > First pass debugging results from gdb on ppc8xx.  Executing ssh-keygen
> > with following arguments.
> >
> > (gdb) show args
> > Argument list to give program being debugged when it is started is
> >     "-t rsa1 -f /etc/ssh/ssh_host_key -N """.
> >
> > Program received signal SIGSEGV, Segmentation fault.
> > BN_bn2dec (a=3D0x1002d9f0) at bn_print.c:136
> > 136                             *lp=3DBN_div_word(t,BN_DEC_CONV);
> >
> > (gdb) i r
> > r0             0x0      0
> > r1             0x7fffd580       2147472768
> > r2             0x30012868       805382248
> > r3             0x80000000       2147483648
> > r4             0xfef33fc        267334652
> > r5             0x25     37
> > r6             0xfccdef8        265084664
> > r7             0x7fffd4c0       2147472576
> > r8             0xfbad2887       4222429319
> > r9             0x84044022       2214871074
> > r10            0x0      0
> > r11            0x2      2
> > r12            0xfef2054        267329620
> > r13            0x10030bc8       268635080
> > r14            0x0      0
> > r15            0x0      0
> > r16            0x0      0
> > r17            0x0      0
> > r18            0x0      0
> > r19            0x0      0
> > r20            0x0      0
> > r21            0x0      0
> > r22            0x0      0
> > r23            0x64     100
> > r24            0x5      5
> > r25            0x1002d438       268620856
> > r26            0x1002d9f0       268622320
> > r27            0x1002c578       268617080
> > r28            0x1      1
> > r29            0x10031000       268636160
> > r30            0xffbf7d0        268171216
> > r31            0x1002d9f0       268622320
> > pc             0xfef2058        267329624
> > ps             0xd032   53298
> > cr             0x24044022       604258338
> > lr             0xfef2054        267329620
> > ctr            0xfccefa0        265088928
> > xer            0x20000000       536870912
> > fpscr          0x0      0
> > vscr           0x0      0
> > vrsave         0x0      0
> >
> > (gdb) p/x $pc
> > $1 =3D 0xfef2058
> >
> > 0x0fef2058 <BN_bn2dec+472>:     stw     r3,0(r29)
> >
> > (gdb) x 0x10031000
> > 0x10031000:     Cannot access memory at address 0x10031000
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On 7/5/05, David Ho <davidkwho@gmail.com> wrote:
> > > This is the second confirmed report of the same problem on the ppc8xx=
.
> > >
> > > After reading my email.  I must say I was the unfriendly one, I
> > > apologize for that.
> > >
> > > More debugging evidence to come.
> > >
> > > ---------- Forwarded message ----------
> > > From: Murch, Christopher <cmurch@mrv.com>
> > > Date: Jul 1, 2005 9:46 AM
> > > Subject: RE: PPC bn_div_words routine rewrite
> > > To: David Ho <davidkwho@gmail.com>
> > >
> > >
> > > David,
> > > I had observed the same issue on ppc 8xx machines after upgrading to =
the asm
> > > version of the BN routines.  Thank you very much for your work for th=
e fix.
> > > My question is, do you have high confidence in the other new asm ppc =
BN
> > > routines after observing this issue or do you think they might have s=
imiliar
> > > problems?
> > > Thanks.
> > > Chris
> > >
> > > -----Original Message-----
> > > From: David Ho [mailto:davidkwho@gmail.com]
> > > Sent: Thursday, June 30, 2005 6:22 PM
> > > To: openssl-dev@openssl.org; linuxppc-embedded@ozlabs.org
> > > Subject: Re: PPC bn_div_words routine rewrite
> > >
> > >
> > > The reason I had to redo this routine, in case anyone is wondering, i=
s
> > > because ssh-keygen  segfaults when this assembly routine returns junk
> > > to the BN_div_word function. On a ppc, if you issue the command
> > >
> > > ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N ""
> > >
> > > The program craps out when it tries to write the public key in ascii
> > > decimal.
> > >
> > > Regards,
> > > David
> > >
> > > On 6/30/05, David Ho <davidkwho@gmail.com> wrote:
> > > > Hi all,
> > > >
> > > > This is a rewrite of the bn_div_words routine for the PowerPC arch,
> > > > tested on a MPC8xx processor.
> > > > I initially thought there is maybe a small mistake in the code that
> > > > requires a one-liner change but it turns out I have to redo the
> > > > routine.
> > > > I guess this routine is not called very often as I see that most ot=
her
> > > > routines are hand-crafted, whereas this routine is compiled from a =
C
> > > > function that apparently has not gone through a whole lot of testin=
g.
> > > >
> > > > I wrote a C function to confirm correctness of the code.
> > > >
> > > > unsigned long div_words (unsigned long h,
> > > >                          unsigned long l,
> > > >                          unsigned long d)
> > > > {
> > > >   unsigned long i_h; /* intermediate dividend */
> > > >   unsigned long i_q; /* quotient of i_h/d */
> > > >   unsigned long i_r; /* remainder of i_h/d */
> > > >
> > > >   unsigned long i_cntr;
> > > >   unsigned long i_carry;
> > > >
> > > >   unsigned long ret_q; /* return quotient */
> > > >
> > > >   /* cannot divide by zero */
> > > >   if (d =3D=3D 0) return 0xffffffff;
> > > >
> > > >   /* do simple 32-bit divide */
> > > >   if (h =3D=3D 0) return l/d;
> > > >
> > > >   i_q =3D h/d;
> > > >   i_r =3D h - (i_q*d);
> > > >   ret_q =3D i_q;
> > > >
> > > >   i_cntr =3D 32;
> > > >
> > > >   while (i_cntr--)
> > > >   {
> > > >     i_carry =3D (l & 0x80000000) ? 1:0;
> > > >     l =3D l << 1;
> > > >
> > > >     i_h =3D (i_r << 1) | i_carry;
> > > >     i_q =3D i_h/d;
> > > >     i_r =3D i_h - (i_q*d);
> > > >
> > > >     ret_q =3D (ret_q << 1) | i_q;
> > > >   }
> > > >
> > > >   return ret_q;
> > > > }
> > > >
> > > >
> > > > Then I handcrafted the routine in PPC assembly.
> > > > The result is a 26 line assembly that is easy to understand and
> > > > predictable as opposed to a 81liner that I am still trying to
> > > > decipher...
> > > > If anyone is interested in incorporating this routine to the openss=
l
> > > > code I'll be happy to assist.
> > > > At this point I think I will be taking a bit of a break from this 3
> > > > day debugging/fixing marathon.
> > > >
> > > > Regards,
> > > > David Ho
> > > >
> > > >
> > > > #
> > > > #       Handcrafted version of bn_div_words
> > > > #
> > > > #       r3 =3D h
> > > > #       r4 =3D l
> > > > #       r5 =3D d
> > > >
> > > >         cmplwi  0,r5,0                  # compare r5 and 0
> > > >         bc      BO_IF_NOT,CR0_EQ,.Lppcasm_div1  # proceed if d!=3D0
> > > >         li      r3,-1                   # d=3D0 return -1
> > > >         bclr    BO_ALWAYS,CR0_LT
> > > > .Lppcasm_div1:
> > > >         cmplwi  0,r3,0                  # compare r3 and 0
> > > >         bc      BO_IF_NOT,CR0_EQ,.Lppcasm_div2  # proceed if h !=3D=
 0
> > > >         divwu   r3,r4,r5                # ret_q =3D l/d
> > > >         bclr    BO_ALWAYS,CR0_LT        # return result in r3
> > > > .Lppcasm_div2:
> > > >         divwu   r9,r3,r5                # i_q =3D h/d
> > > >         mullw   r10,r9,r5               # i_r =3D h - (i_q*d)
> > > >         subf    r10,r10,r3
> > > >         mr      r3,r9                   # req_q =3D i_q
> > > > .Lppcasm_set_ctr:
> > > >         li      r12,32                  # ctr =3D bitsizeof(d)
> > > >         mtctr   r12
> > > > .Lppcasm_div_loop:
> > > >         addc    r4,r4,r4                # l =3D l << 1 -> i_carry
> > > >         adde    r11,r10,r10             # i_h =3D (i_r << 1) | i_ca=
rry
> > > >         divwu   r9,r11,r5               # i_q =3D i_h/d
> > > >         mullw   r10,r9,r5               # i_r =3D i_h - (i_q*d)
> > > >         subf    r10,r10,r11
> > > >         add     r3,r3,r3                # ret_q =3D ret_q << 1 | i_=
q
> > > >         add     r3,r3,r9
> > > >         bc      BO_dCTR_NZERO,CR0_EQ,.Lppcasm_div_loop
> > > > .Lppc_div_end:
> > > >         bclr    BO_ALWAYS,CR0_LT        # return result in r3
> > > >         .long   0x00000000
> > > >
> > > _______________________________________________
> > > Linuxppc-embedded mailing list
> > > Linuxppc-embedded@ozlabs.org
> > > https://ozlabs.org/mailman/listinfo/linuxppc-embedded
> > >
> >
>

^ permalink raw reply

* Re: [PATCH] Set cpu explicitly in kernel compiles
From: Olaf Hering @ 2005-07-05 20:27 UTC (permalink / raw)
  To: Tom Rini; +Cc: linuxppc-dev
In-Reply-To: <20050705195819.GD6878@smtp.west.cox.net>

 On Tue, Jul 05, Tom Rini wrote:

> On Tue, Jul 05, 2005 at 09:54:41PM +0200, Olaf Hering wrote:
> >  On Tue, Jul 05, Tom Rini wrote:
> > 
> > > gcc info page says that -mcpu=powerpc won't work for 601.
> > 
> > -mcpu=common may work for everyone, after a quick grep in
> > gcc/config/rs6000
> 
> It does, and that's the code bloat you're trying to get rid of :)

3397494  579544  519704 4496742  449d66 ../O-ppc-cpucommon/vmlinux
3469857  579544  519704 4569105  45b811 ../O-ppc-default/vmlinux

-mcpu=powerpc reduces text size still more than -mcpu=750

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox