smp8634 add memory at dram1
After study about the memory configuration of sigma smp8634, i found some difficult to accomplish the task.
so my question is if have two 128MB ram separately under dram0 and dram1 controller, where dram0 for linux and dram1 for video decoding. Now the situation is the memory for linux is not enough and video decoding can not use all of it's 128MB at dram1, what we plan to do is to share 64MB at dram1 to the linux kernel as high memory, and only reserved 64MB at dram1 for the video decoding.
first, in MIPS architecture, we found that the kseg0 and kseg1 are mapped to 0x00000000-0x20000000, which include only dram0 controller, so we wish to add the dram1 memory manually to the kernel using function add_memory_region at setup.c , after booting up result the warning that the memory larger than 512 need to configured the kernel support high memory.
then when we configure the kernel to support high memory at menu configure, the kernel when booting up will remind us our CPU do not support high memory due to cache aliases.
Both way will lead the linux can not boot up normally, so what should we do, is there any mis-understanding about the hardware implementation or MIPS design? \
Quoted 17 lines · David Kuk
After study about the memory configuration of sigma smp8634, i found some difficult to accomplish the task.
so my question is if have two 128MB ram separately under dram0 and dram1 controller, where dram0 for linux and dram1 for video decoding. Now the situation is the memory for linux is not enough and video decoding can not use all of it's 128MB at dram1, what we plan to do is to share 64MB at dram1 to the linux kernel as high memory, and only reserved 64MB at dram1 for the video decoding.
first, in MIPS architecture, we found that the kseg0 and kseg1 are mapped to 0x00000000-0x20000000, which include only dram0 controller, so we wish to add the dram1 memory manually to the kernel using function
add_memory_regionatsetup.c, after booting up result the warning that the memory larger than 512 need to configured the kernel support high memory.
Quoted 3 lines
then when we configure the kernel to support high memory at menu configure, the kernel when booting up will remind us our CPU do not support high memory due to cache aliases.
This is really a software restriction. I originally developped highmem for MIPS on a Sibyte SB1250 which doesn't suffer from aliases so I didn't even attempt to solve the cache aliasing issue. The other platforms on whic highmem used to be used was the E9000 family but it seem by now the users of these platforms have all moved to full 64-bit kernels, so aside fo the implementation restrictions has also started to bitrot a little.
What would be necessary to get it to work is to flush the page from cache at kunmap() rsp. kunmap_atomic() time. That should do the trick though there are significant further optimizations possible.
An alterantive to solve the aliasing issue would be to increase the page size to 16K. Again, the combination of highmem and 16K pages is untested.
I don't know what processor core Sigma is using in this SOC. In case its a 64-bit core, don't waste even a nanosecond on highmem, just go for a 64-bit kernel, it's much less painful than highmem.
Ralf
Quoting Ralf Baechle <[email protected]>:
Quoted 8 lines
I don't know what processor core Sigma is using in this SOC. In case its a 64-bit core, don't waste even a nanosecond on highmem, just go for a 64-bit kernel, it's much less painful than highmem.
Ralf
It is a MIPS 4KEc core.
Quoted 9 lines · David Kuk
After study about the memory configuration of sigma smp8634, i found some difficult to accomplish the task.
so my question is if have two 128MB ram separately under dram0 and dram1 controller, where dram0 for linux and dram1 for video decoding. Now the situation is the memory for linux is not enough and video decoding can not use all of it's 128MB at dram1, what we plan to do is to share 64MB at dram1 to the linux kernel as high memory, and only reserved 64MB at dram1 for the video decoding.
first, in MIPS architecture, we found that the kseg0 and kseg1 are mapped to 0x00000000-0x20000000, which include only dram0 controller, so we wish to add the dram1 memory manually to the kernel using function
add_memory_regionatsetup.c, after booting up result the warning that the memory larger than 512 need to configured the kernel support high memory.then when we configure the kernel to support high memory at menu configure, the kernel when booting up will remind us our CPU do not support high memory due to cache aliases.
Both way will lead the linux can not boot up normally, so what should we do, is there any mis-understanding about the hardware implementation or MIPS design?
I think your understanding of the 8634 is at least close to correct.
It may be possible (but I have not tried it yet) to use the remapping registers to move dram1 into the first 512MB of the memory space. If it is possible, you would then have to modify the gbus access functions accordingly. Also the 8634 media drivers would probably have to be changed as well. I am not sure about the microcode for the media DSPs, but if it is dependent on the mapping of the DRAM, then you would probably have to get the vendor's help.
Let me know if you are successful.
Thanks,
David Daney
David Daney wrote
Quoted 11 lines
I think your understanding of the 8634 is at least close to correct.
It may be possible (but I have not tried it yet) to use the remapping registers to move dram1 into the first 512MB of the memory space. If it is possible, you would then have to modify the gbus access functions accordingly. Also the 8634 media drivers would probably have to be changed as well. I am not sure about the microcode for the media DSPs, but if it is dependent on the mapping of the DRAM, then you would probably have to get the vendor's help.
Quoted 1 line
Let me know if you are successful.
AFAIK the memory bandwith available is not enough for supporting video decoding and Linux usage at the same dram controller.
/Marcus Gustafsson
Thanks you all for helping.
AS Daney suggested, I have map the dram1's first 64 MB memory (total 128) to remap register 3,
and add the remap register 3 into the BOOT_MEMROY_RAM use the method add_memory_region.
When i bootup the linux kernel print out that it have totally 176MB ram , which is 06fe0000@10020000(dram0) and 04000000@08000000(64mb dram1 at remap register3). How ever, This mapping shows that the total memory in the linux kernel is not contiguous. the OS can run, but as i see the source code, when the kernel divided these memory into pages, it did not consider if the memory is contiguous or not, is it ok ? and how should i allocate the memories into ZONE[DMA] and ZONE[NORMAL], is it possible if I wish all the 176MB memory can be allocate as ZONE[DMA]?
Best wishes
David
Quoted 43 lines · David Daney
Quoted 17 lines · David Kuk
After study about the memory configuration of sigma smp8634, i found some difficult to accomplish the task.
so my question is if have two 128MB ram separately under dram0 and dram1 controller, where dram0 for linux and dram1 for video decoding. Now the situation is the memory for linux is not enough and video decoding can not use all of it's 128MB at dram1, what we plan to do is to share 64MB at dram1 to the linux kernel as high memory, and only reserved 64MB at dram1 for the video decoding.
first, in MIPS architecture, we found that the kseg0 and kseg1 are mapped to 0x00000000-0x20000000, which include only dram0 controller, so we wish to add the dram1 memory manually to the kernel using function
add_memory_regionatsetup.c, after booting up result the warning that the memory larger than 512 need to configured the kernel support high memory.Quoted 7 lines
then when we configure the kernel to support high memory at menu configure, the kernel when booting up will remind us our CPU do not support high memory due to cache aliases.
Both way will lead the linux can not boot up normally, so what should we do, is there any mis-understanding about the hardware implementation or MIPS design?
I think your understanding of the 8634 is at least close to correct.
It may be possible (but I have not tried it yet) to use the remapping registers to move dram1 into the first 512MB of the memory space. If it is possible, you would then have to modify the gbus access functions accordingly. Also the 8634 media drivers would probably have to be changed as well. I am not sure about the microcode for the media DSPs, but if it is dependent on the mapping of the DRAM, then you would probably have to get the vendor's help.
Let me know if you are successful.
Thanks,
David Daney