Skip to contentSkip to conversation

The question about the high memory support on MPC8360?

DISCUSSION 郭劲 3 participants 7 messages Nov 26, 2007 – Nov 28, 2007

lore
Share & tools
lore

郭劲

author
#0 lore raw

Hi,friends,
I plug in 1GB DDR-1 on my MPC8360 board, the u-boot-1.2.0 found the DDR storage
is 1GB, but the linux just found 773504k. please see follow information.
I think I need to config the kernel to support the high memory. but if I config
the kernel to select the "high memory support" under the "platform options" on "linux kernel configuration" during compile, the kernel is not to boot. if I cancel this options, the kernel is ok to run.
why? how to deal with this problem? there are two DIMM-184 slots on my MPC8360
board, I want to support total 2GB DDR-1 storage. now I want to try 1GB on one of DIMM-184 slots firstly.
please see follow information. Thanks.

~ # dmesg
Linux version 2.6.11 (olivia@bamboo) (gcc version 3.4.3) #1 Thu Jul 12 14:29:297 On node 0 totalpages: 196608
DMA zone: 196608 pages, LIFO batch:16
Normal zone: 0 pages, LIFO batch:1
HighMem zone: 0 pages, LIFO batch:1
Built 1 zonelists
Kernel command line: console=ttyS0,115200 root=/dev/ram0
IPIC (128 IRQ sources, 8 External IRQs) at fe000700
QE IC (64 IRQ sources) at fe100080
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: 773504k available (1724k kernel code, 432k data, 100k init, 0k highmem) Calibrating delay loop... 351.23 BogoMIPS (lpj=175616)
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
checking if image is initramfs...it isn't (no cpio magic); looks like an initrd Freeing initrd memory: 3120k freed
NET: Registered protocol family 16
Registering ipic with sysfs...
SCSI subsystem initialized
JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc.
Generic RTC Driver v1.07
Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled ttyS0 at MMIO 0xe0004500 (irq = 9) is a 16550A
ttyS1 at MMIO 0xe0004600 (irq = 10) is a 16550A
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize
loop: loaded (max 8 devices)
MPC8360E PB flash device: 2000000 at fe000000 Partition number 6 MPC8360E PB Flash Map Info: Found 1 x16 devices at 0x0 in 16-bit bank MPC8360E PB Flash Map Info: Found an alias at 0x1000000 for the chip at 0x0 Support for command set 0001 not present
gen_probe: No supported Vendor Command Set found
i2c /dev entries driver
eth0: Running with NAPI disabled
eth1: Running with NAPI disabled
NET: Registered protocol family 2
IP: routing cache hash table of 8192 buckets, 64Kbytes
TCP established hash table entries: 131072 (order: 8, 1048576 bytes) TCP bind hash table entries: 65536 (order: 6, 262144 bytes)
TCP: Hash tables configured (established 131072 bind 65536)
NET: Registered protocol family 1
NET: Registered protocol family 17
RAMDISK: Compressed image found at block 0
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 100k init
eth0: PHY is Marvell 88E11x1 (1410cc1)
eth0: Full Duplex
eth0: Speed 1000BT
eth0: Link is up

U-Boot 1.2.0 (Nov 21 2007 - 16:05:15) MPC83XX

CPU:   e300c1, MPC8360E, Rev: 20 at 528 MHz, CSB:  264 MHz                      
Board: Freescale MPC8360EMDS                                                    
I2C:   ready                                                                    
DRAM:                                                                           
DIMM type:                                                                      
SPD size:        128                                                            
EEPROM size:     256                                                            
Memory type:     7                                                              
Row addr:        13                                                             
Column addr:     11                                                             
# of rows:       2                                                              
Row density:     128                                                            
# of banks:      4                                                              
Data width:      64                                                             
Chip width:      8                                                              
Refresh rate:    82                                                             
CAS latencies:   1C                                                             
Write latencies: 02                                                             
tRP:             60                                                             
tRCD:            60                                                             

DDR DIMM: data bus width is 64 bit without ECC
DDRC ECC mode: OFF

SDRAM on Local Bus: 64 MB
DDR RAM: 1024 MB
FLASH: 16 MB
PCI clock is 66MHz
PCI 32bit bus on PMC1 & PMC2 & PMC3

In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Net:   UEC: PHY is Marvell 88E11x1 (1410cc1)                                    
FSL UEC0: Full Duplex                                                           
FSL UEC0: Speed 1000BT                                                          
FSL UEC0: Link is up                                                            

FSL UEC0
Hit any key to stop autoboot: 0
=> bootm fed00000 fe900000
## Booting image at fed00000 ...

   Image Name:   Linux-2.6.11                                                   
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)                   
   Data Size:    1054435 Bytes =  1 MB                                          

Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
## Loading RAMDisk Image at fe900000 ...

   Image Name:   uboot ext2 ramdisk rootfs                                      
   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)                  
   Data Size:    3195657 Bytes =  3 MB                                          

Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Loading Ramdisk to 0fc9a000, end 0ffa6309 ... OK

#1 lore raw

Hi friends,

Kernel virtual space is divided into 3 different zones namely ZONE_DMA,=20 ZONE_NORMAL, ZONE_HIGHMEM.Remember that the kernel follows the 3GB/1GB=20 split ie 3 GB for user space and 1 GB for kernel space. Since your ram=20 is 1 GB, 896 MB will be mapped one to one with the kernel virtual space.=20 This one to one mapping will be done in the ZONE_NORMAL and ZONE_DMA of=20 kernel virtual space.Remaining 128 MB of kernel virtual address space=20 will be used for setting up kernel data structures and for ioremaps and=20 vmallocs that the kernel will need to perform during boot up. If u=20 configure high memory this 128 MB will be used for accessing unmapped=20 memory regions in the ram and there wont be sufficient virtual=20 addresses for ioremaps and vmallocs. Thats why your kernel did not boot=20 when high mem is configured.

Since u want to have 1 GB of ram an alternative to=20
this is that u can try 2 GB/ 2 GB split which is configurable ie 2 GB=20 for user space and 2 GB for kernel space in your kernel.

Thanks and Regards,
vijai

Quoted 2 lines · =E9=83=AD=E5=8A=B2 wrote:

Hi,friends,=20
I plug in 1GB DDR-1 on my MPC8360 board, the u-boot-1.2.0 found the DD=

R storage

Quoted 1 line

is 1GB, but the linux just found 773504k. please see follow information=

.

Quoted 1 line

I think I need to config the kernel to support the high memory. but i=

f I config

Quoted 1 line

the kernel to select the "high memory support" under the "platform optio=

ns" on

Quoted 1 line

"linux kernel configuration" during compile, the kernel is not to boot. =

if I

Quoted 2 lines

cancel this options, the kernel is ok to run.
why? how to deal with this problem? there are two DIMM-184 slots on m=

y MPC8360

Quoted 1 line

board, I want to support total 2GB DDR-1 storage. now I want to try 1GB =

on one of=20

Quoted 5 lines

DIMM-184 slots firstly.
please see follow information. Thanks.

~ # dmesg =

      =20
Quoted 1 line

Linux version 2.6.11 (olivia@bamboo) (gcc version 3.4.3) #1 Thu Jul 12 1=

4:29:297

Quoted 1 line

On node 0 totalpages: 196608 =

      =20
Quoted 1 line

DMA zone: 196608 pages, LIFO batch:16 =

      =20
Quoted 1 line

Normal zone: 0 pages, LIFO batch:1 =

      =20
Quoted 1 line

HighMem zone: 0 pages, LIFO batch:1 =

      =20
Quoted 1 line

Built 1 zonelists =

      =20
Quoted 1 line

Kernel command line: console=3DttyS0,115200 root=3D/dev/ram0 =

          =20
Quoted 1 line

IPIC (128 IRQ sources, 8 External IRQs) at fe000700 =

      =20
Quoted 1 line

QE IC (64 IRQ sources) at fe100080 =

      =20
Quoted 1 line

PID hash table entries: 4096 (order: 12, 65536 bytes) =

      =20
Quoted 1 line

Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) =

      =20
Quoted 1 line

Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) =

      =20
Quoted 1 line

Memory: 773504k available (1724k kernel code, 432k data, 100k init, 0k h=

ighmem)=20

Quoted 1 line

Calibrating delay loop... 351.23 BogoMIPS (lpj=3D175616) =

        =20
Quoted 1 line

Mount-cache hash table entries: 512 (order: 0, 4096 bytes) =

      =20
Quoted 1 line

checking if image is initramfs...it isn't (no cpio magic); looks like an=

initrd=20

Quoted 1 line

Freeing initrd memory: 3120k freed =

      =20
Quoted 1 line

NET: Registered protocol family 16 =

      =20
Quoted 1 line

Registering ipic with sysfs... =

      =20
Quoted 1 line

SCSI subsystem initialized =

      =20
Quoted 1 line

JFFS2 version 2.2. (C) 2001-2003 Red Hat, Inc. =

      =20
Quoted 1 line

Generic RTC Driver v1.07 =

      =20
Quoted 1 line

Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disable=

d =20

Quoted 1 line

ttyS0 at MMIO 0xe0004500 (irq =3D 9) is a 16550A =

        =20
Quoted 1 line

ttyS1 at MMIO 0xe0004600 (irq =3D 10) is a 16550A =

        =20
Quoted 1 line

io scheduler noop registered =

      =20
Quoted 1 line

io scheduler anticipatory registered =

      =20
Quoted 1 line

io scheduler deadline registered =

      =20
Quoted 1 line

io scheduler cfq registered =

      =20
Quoted 1 line

RAMDISK driver initialized: 16 RAM disks of 16384K size 1024 blocksize =

      =20
Quoted 1 line

loop: loaded (max 8 devices) =

      =20
Quoted 1 line

MPC8360E PB flash device: 2000000 at fe000000 Partition number 6 =

      =20
Quoted 1 line

MPC8360E PB Flash Map Info: Found 1 x16 devices at 0x0 in 16-bit bank =

      =20
Quoted 1 line

MPC8360E PB Flash Map Info: Found an alias at 0x1000000 for the chip at =

0x0 =20

Quoted 1 line

Support for command set 0001 not present =

      =20
Quoted 1 line

gen_probe: No supported Vendor Command Set found =

      =20
Quoted 1 line

i2c /dev entries driver =

      =20
Quoted 1 line

eth0: Running with NAPI disabled =

      =20
Quoted 1 line

eth1: Running with NAPI disabled =

      =20
Quoted 1 line

NET: Registered protocol family 2 =

      =20
Quoted 1 line

IP: routing cache hash table of 8192 buckets, 64Kbytes =

      =20
Quoted 1 line

TCP established hash table entries: 131072 (order: 8, 1048576 bytes) =

      =20
Quoted 1 line

TCP bind hash table entries: 65536 (order: 6, 262144 bytes) =

      =20
Quoted 1 line

TCP: Hash tables configured (established 131072 bind 65536) =

      =20
Quoted 1 line

NET: Registered protocol family 1 =

      =20
Quoted 1 line

NET: Registered protocol family 17 =

      =20
Quoted 1 line

RAMDISK: Compressed image found at block 0 =

      =20
Quoted 1 line

VFS: Mounted root (ext2 filesystem) readonly. =

      =20
Quoted 1 line

Freeing unused kernel memory: 100k init =

      =20
Quoted 1 line

eth0: PHY is Marvell 88E11x1 (1410cc1) =

      =20
Quoted 1 line

eth0: Full Duplex =

      =20
Quoted 1 line

eth0: Speed 1000BT =

      =20
Quoted 4 lines

eth0: Link is up

U-Boot 1.2.0 (Nov 21 2007 - 16:05:15) MPC83XX =

      =20
Quoted 1 line
                                                                       =
      =20
Quoted 1 line

CPU: e300c1, MPC8360E, Rev: 20 at 528 MHz, CSB: 264 MHz =

      =20
Quoted 1 line

Board: Freescale MPC8360EMDS =

      =20
Quoted 1 line

I2C: ready =

      =20
Quoted 1 line

DRAM: =

      =20
Quoted 1 line

DIMM type: =

      =20
Quoted 1 line

SPD size: 128 =

      =20
Quoted 1 line

EEPROM size: 256 =

      =20
Quoted 1 line

Memory type: 7 =

      =20
Quoted 1 line

Row addr: 13 =

      =20
Quoted 1 line

Column addr: 11 =

      =20
Quoted 1 line
# of rows:       2                                                      =
      =20
Quoted 1 line

Row density: 128 =

      =20
Quoted 1 line
# of banks:      4                                                      =
      =20
Quoted 1 line

Data width: 64 =

      =20
Quoted 1 line

Chip width: 8 =

      =20
Quoted 1 line

Refresh rate: 82 =

      =20
Quoted 1 line

CAS latencies: 1C =

      =20
Quoted 1 line

Write latencies: 02 =

      =20
Quoted 1 line

tRP: 60 =

      =20
Quoted 1 line

tRCD: 60 =

      =20
Quoted 1 line
                                                                       =
      =20
Quoted 1 line
                                                                       =
      =20
Quoted 1 line

DDR DIMM: data bus width is 64 bit without ECC =

      =20
Quoted 1 line

DDRC ECC mode: OFF =

      =20
Quoted 1 line
                                                                       =
      =20
Quoted 1 line

SDRAM on Local Bus: 64 MB =

      =20
Quoted 1 line

DDR RAM: 1024 MB =

      =20
Quoted 1 line

FLASH: 16 MB =

      =20
Quoted 1 line

PCI clock is 66MHz =

      =20
Quoted 1 line

PCI 32bit bus on PMC1 & PMC2 & PMC3 =

      =20
Quoted 1 line

In: serial =

      =20
Quoted 1 line

Out: serial =

      =20
Quoted 1 line

Err: serial =

      =20
Quoted 1 line

Net: UEC: PHY is Marvell 88E11x1 (1410cc1) =

      =20
Quoted 1 line

FSL UEC0: Full Duplex =

      =20
Quoted 1 line

FSL UEC0: Speed 1000BT =

      =20
Quoted 1 line

FSL UEC0: Link is up =

      =20
Quoted 1 line

FSL UEC0 =

      =20
Quoted 1 line

Hit any key to stop autoboot: 0 =

      =20
Quoted 1 line

=3D> bootm fed00000 fe900000 =

        =20
Quoted 1 line

## Booting image at fed00000 ... =

      =20
Quoted 1 line

Image Name: Linux-2.6.11 =

      =20
Quoted 1 line

Image Type: PowerPC Linux Kernel Image (gzip compressed) =

      =20
Quoted 1 line

Data Size: 1054435 Bytes =3D 1 MB =

        =20
Quoted 1 line

Load Address: 00000000 =

      =20
Quoted 1 line

Entry Point: 00000000 =

      =20
Quoted 1 line

Verifying Checksum ... OK =

      =20
Quoted 1 line

Uncompressing Kernel Image ... OK =

      =20
Quoted 1 line

## Loading RAMDisk Image at fe900000 ... =

      =20
Quoted 1 line

Image Name: uboot ext2 ramdisk rootfs =

      =20
Quoted 1 line

Image Type: PowerPC Linux RAMDisk Image (gzip compressed) =

      =20
Quoted 1 line

Data Size: 3195657 Bytes =3D 3 MB =

        =20
Quoted 1 line

Load Address: 00000000 =

      =20
Quoted 1 line

Entry Point: 00000000 =

      =20
Quoted 1 line

Verifying Checksum ... OK =

      =20
Quoted 11 lines

Loading Ramdisk to 0fc9a000, end 0ffa6309 ... OK

_______________________________________________
Linuxppc-embedded mailing list
[email protected]
https://ozlabs.org/mailman/listinfo/linuxppc-embedded

=20

#2 lore raw
Quoted 14 lines · vijay baskar

Hi friends,

Kernel virtual space is divided into 3 different zones namely ZONE_DMA, ZONE_NORMAL, ZONE_HIGHMEM.Remember that the kernel follows the 3GB/1GB split ie 3 GB for user space and 1 GB for kernel space. Since your ram is 1 GB, 896 MB will be mapped one to one with the kernel virtual space. This one to one mapping will be done in the ZONE_NORMAL and ZONE_DMA of kernel virtual space.Remaining 128 MB of kernel virtual address space will be used for setting up kernel data structures and for ioremaps and vmallocs that the kernel will need to perform during boot up. If u configure high memory this 128 MB will be used for accessing unmapped memory regions in the ram and there wont be sufficient virtual addresses for ioremaps and vmallocs. Thats why your kernel did not boot when high mem is configured.

1. The split is 768/256 on powerpc, not 896/128.
2. Why do you think this is insufficient?

Quoted 3 lines

Since u want to have 1 GB of ram an alternative to
this is that u can try 2 GB/ 2 GB split which is configurable ie 2 GB for user space and 2 GB for kernel space in your kernel.

1. He said he wanted 2GB of RAM, not 1.
2. I don't think this mode of operation has been tested very well on powerpc.

Quoted 9 lines
Quoted 9 lines

=> bootm fed00000 fe900000
## Booting image at fed00000 ...

  Image Name:   Linux-2.6.11                                                   
  Image Type:   PowerPC Linux Kernel Image (gzip compressed)                   
  Data Size:    1054435 Bytes =  1 MB                                          

Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK

Quoted 8 lines
Quoted 8 lines

## Loading RAMDisk Image at fe900000 ...

  Image Name:   uboot ext2 ramdisk rootfs                                      
  Image Type:   PowerPC Linux RAMDisk Image (gzip compressed)                  
  Data Size:    3195657 Bytes =  3 MB                                          

Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Loading Ramdisk to 0fc9a000, end 0ffa6309 ... OK

Could you try with a more recent, arch/powerpc kernel?

-Scott

#3 lore raw

Scott Wood wrote: On Mon, Nov 26, 2007 at 11:41:38AM +0530, vijay baskar w= rote: Hi friends, Kernel virtual space is divided into 3 different zones namely ZONE_DMA,=20 ZONE_NORMAL, ZONE_HIGHMEM.Remember that the kernel follows the 3GB/1GB=20 split ie 3 GB for user space and 1 GB for kernel space. Since your ram=20 is 1 GB, 896 MB will be mapped one to one with the kernel virtual space.=20 This one to one mapping will be done in the ZONE_NORMAL and ZONE_DMA of=20 kernel virtual space.Remaining 128 MB of kernel virtual address space=20 will be used for setting up kernel data structures and for ioremaps and=20 vmallocs that the kernel will need to perform during boot up. If u=20 configure high memory this 128 MB will be used for accessing unmapped=20 memory regions in the ram and there wont be sufficient virtual=20 addresses for ioremaps and vmallocs. Thats why your kernel did not boot=20 when high mem is configured.

#4 lore raw
Quoted 2 lines · vijay baskar

The kernel maps the last 1 GB of the virtual address space one to one to the physical memory.

No, it maps 768MB of RAM in this manner.

Quoted 3 lines

This is called the kernel space. After the one
to one mapping is done for the available physical memory, the remaining virtual addresses are used for vmalloc and ioremap.

And highmem mappings.

Quoted 3 lines

The kernel also allows hardcoded mapping
of IO regions into its virtual address space through the io_block_mapping interface.

Not in current arch/powerpc kernels.

Quoted 5 lines

Many boards use the block IO mapping to
map the CCSRBAR/IMMR into the kernel address space, such that the physical address and the virutal address is the same. Virtual addresses beyond these hardcoded mappings cannot be used by vmalloc/ioremap.

And this is why.

Quoted 3 lines

Now as more and more memory is added to the system the addresses available for vmalloc and ioremap gets reduced, and memory allocations start to fail, due to the lack of availability of virtual addresses.

How so? The size of lowmem is constant once you reach the threshold, as is the size of the highmem mapping area.

What *does* start to fail eventually, if you have a *lot* of highmem, is that you run out of lowmem for pagetables and such.

-Scott

#5 lore raw

Hi,
"The kernel also allows hardcoded mapping
of IO regions into its virtual address space through the io_block_mapping interface."

Can u tell me how this is in current arch/powerpc. Also does it mean that whatever be the size of the ram > 768 MB there is not going to be much improvement in performance in kernel space irrespective of invoking CONFIG_HIGHMEM or not?

Also do you think this low mem be enough if i have lots of kernel space processes each invoking lots of kmallocs. Will there be bottle necks?? Also what alternative do we have if low mem of 768 MB is not enough??

Quoted 43 lines · Scott Wood
Quoted 2 lines · vijay baskar

The kernel maps the last 1 GB of the virtual address space one to one to the physical memory.

No, it maps 768MB of RAM in this manner.

Quoted 3 lines

This is called the kernel space. After the one
to one mapping is done for the available physical memory, the remaining virtual addresses are used for vmalloc and ioremap.

And highmem mappings.

Quoted 3 lines

The kernel also allows hardcoded mapping
of IO regions into its virtual address space through the io_block_mapping interface.

Not in current arch/powerpc kernels.

Quoted 5 lines

Many boards use the block IO mapping to
map the CCSRBAR/IMMR into the kernel address space, such that the physical address and the virutal address is the same. Virtual addresses beyond these hardcoded mappings cannot be used by vmalloc/ioremap.

And this is why.

Quoted 3 lines

Now as more and more memory is added to the system the addresses available for vmalloc and ioremap gets reduced, and memory allocations start to fail, due to the lack of availability of virtual addresses.

How so? The size of lowmem is constant once you reach the threshold, as is the size of the highmem mapping area.

What *does* start to fail eventually, if you have a *lot* of highmem, is that you run out of lowmem for pagetables and such.

-Scott

#6 lore raw
Quoted 3 lines · vijay baskar

Hi, "The kernel also allows hardcoded mapping of IO regions into its virtual address space through the io_block_mapping interface."

Can u tell me how this is in current arch/powerpc.

Everything is explicitly ioremapped.

Quoted 3 lines

Also does it mean that whatever be the size of the ram > 768 MB there
is not going to be much improvement in performance in kernel space
irrespective of invoking CONFIG_HIGHMEM or not?

Well, the kernel can use highmem for cache... I'm not sure what you mean by "in kernel space".

Quoted 1 line

Also do you think this low mem be enough if i have lots of kernel space processes each invoking lots of kmallocs.

That depends on what you mean by "lots". :-)

You'll have 768MB of lowmem, and kmallocs can only use lowmem.

Quoted 2 lines

Will there be bottle necks?? Also what alternative do we have if low mem of 768 MB is not enough??

You'll need to change the user/kernel split, and deal with anything that breaks in the process.

Or get a 64-bit chip. :-)

-Scott