firmware: cleanup duplicated DM320 LCD memory defines

Move the rather large block of code that's been copied
in three separate linker scripts into the CPU header.

Change-Id: I9f38e4901fa4ff699f00d97064a9cdaf7cfd6aab
This commit is contained in:
Aidan MacDonald 2026-03-06 10:55:51 +00:00 committed by Solomon Peachy
parent 99dd797169
commit a24142b234
4 changed files with 27 additions and 73 deletions

View file

@ -20,27 +20,6 @@ OUTPUT_FORMAT(elf32-littlemips)
- CODEC_SIZE - QHARRAY_SIZE - FRAME_SIZE - TTB_SIZE)
#elif CONFIG_CPU==DM320
#ifndef LCD_NATIVE_WIDTH
#define LCD_NATIVE_WIDTH LCD_WIDTH
#endif
#ifndef LCD_NATIVE_HEIGHT
#define LCD_NATIVE_HEIGHT LCD_HEIGHT
#endif
#ifdef MROBE_500
/* Give this 1 meg to allow it to align to the MMU boundary */
#define LCD_FUDGE LCD_NATIVE_WIDTH%32
#define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
#define LCD_TTB_AREA 0x100000*((LCD_BUFFER_SIZE>>19)+1)
#else
/* must be 16Kb (0x4000) aligned */
#define TTB_SIZE (0x4000)
#define LCD_BUFFER_SIZE (LCD_NATIVE_WIDTH*LCD_NATIVE_HEIGHT*2)
#define LCD_TTB_AREA (TTB_SIZE + LCD_BUFFER_SIZE)
#endif
#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA
#elif CONFIG_CPU==S3C2440

View file

@ -46,6 +46,27 @@ extern unsigned long _ttbstart;
#define FRAME2 ((short *) (&_lcdbuf2)) /* Right after FRAME */
#endif
#ifndef LCD_NATIVE_WIDTH
#define LCD_NATIVE_WIDTH LCD_WIDTH
#endif
#ifndef LCD_NATIVE_HEIGHT
#define LCD_NATIVE_HEIGHT LCD_HEIGHT
#endif
/* must be 16Kb (0x4000) aligned */
#define TTB_SIZE (0x4000)
#ifdef MROBE_500
/* Give this 1 meg to allow it to align to the MMU boundary */
#define LCD_FUDGE (LCD_NATIVE_WIDTH%32)
#define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
#define LCD_TTB_AREA (0x100000*((LCD_BUFFER_SIZE>>19)+1))
#else
#define LCD_BUFFER_SIZE (LCD_NATIVE_WIDTH*LCD_NATIVE_HEIGHT*2)
#define LCD_TTB_AREA (TTB_SIZE + LCD_BUFFER_SIZE)
#endif
#define PHY_IO_BASE 0x00030000
#define DM320_REG(addr) (*(volatile unsigned short *)(PHY_IO_BASE + (addr)))
#define PHY_IO_BASE2 0x00060000

View file

@ -1,4 +1,6 @@
#define __ASSEMBLER__
#include "config.h"
#include "cpu.h"
ENTRY(_start)
@ -6,34 +8,9 @@ OUTPUT_FORMAT(elf32-littlearm)
OUTPUT_ARCH(arm)
STARTUP(target/arm/tms320dm320/crt0.o)
#ifndef LCD_NATIVE_WIDTH
#define LCD_NATIVE_WIDTH LCD_WIDTH
#endif
#ifndef LCD_NATIVE_HEIGHT
#define LCD_NATIVE_HEIGHT LCD_HEIGHT
#endif
/* must be 16Kb (0x4000) aligned */
#define TTB_SIZE 0x4000
#define DRAMSIZE (MEMORYSIZE * 0x100000)
#define DRAMORIG CONFIG_SDRAM_START
#ifdef MROBE_500
#define LCD_FUDGE LCD_NATIVE_WIDTH%32
#define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
/* Give this some memory to allow it to align to the MMU boundary.
* Note that since there are two buffers (YUV/RGB) it calculates the approximate
* memory needed in steps of 1 Meg.
*/
#define LCD_TTB_AREA (0x100000*((LCD_BUFFER_SIZE>>19)+1))
#else
#define LCD_BUFFER_SIZE (LCD_NATIVE_WIDTH*LCD_NATIVE_HEIGHT*2)
#define LCD_TTB_AREA (TTB_SIZE + LCD_BUFFER_SIZE)
#endif
/* End of the audio buffer, where the codec buffer starts */
#define ENDAUDIOADDR \
(DRAMORIG + DRAMSIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA)

View file

@ -1,4 +1,6 @@
#define __ASSEMBLER__
#include "config.h"
#include "cpu.h"
ENTRY(_vectors)
@ -6,36 +8,11 @@ OUTPUT_FORMAT(elf32-littlearm)
OUTPUT_ARCH(arm)
STARTUP(target/arm/tms320dm320/crt0.o)
#ifndef LCD_NATIVE_WIDTH
#define LCD_NATIVE_WIDTH LCD_WIDTH
#endif
#ifndef LCD_NATIVE_HEIGHT
#define LCD_NATIVE_HEIGHT LCD_HEIGHT
#endif
/* must be 16Kb (0x4000) aligned */
#define TTB_SIZE (0x4000)
/* Bootloader only uses/knows about the upper 32 M */
#define DRAMSIZE (MEMORYSIZE * 0x100000 / 2)
#define DRAMORIG CONFIG_SDRAM_START+DRAMSIZE
#ifdef MROBE_500
#define LCD_FUDGE LCD_NATIVE_WIDTH%32
#define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
/* Give this some memory to allow it to align to the MMU boundary.
* Note that since there are two buffers (YUV/RGB) it calculates the approximate
* memory needed in steps of 1 Meg.
*/
#define LCD_TTB_AREA (0x100000*((LCD_BUFFER_SIZE>>19)+1))
/* End of the audio buffer, where the codec buffer starts */
#define TTB_BEGIN (DRAMORIG + DRAMSIZE - LCD_TTB_AREA)
#else
#define LCD_BUFFER_SIZE (LCD_NATIVE_WIDTH*LCD_NATIVE_HEIGHT*2)
#define LCD_TTB_AREA (TTB_SIZE + LCD_BUFFER_SIZE)
#define LCD_BEGIN (DRAMORIG + DRAMSIZE - LCD_TTB_AREA)
#endif
#define LCD_BEGIN (DRAMORIG + DRAMSIZE - LCD_TTB_AREA)
#define IRAMORIG 0x00000000
#define IRAMSIZE 0x4000
@ -191,7 +168,7 @@ SECTIONS
} > IRAM
#ifdef MROBE_500
.ttbtable TTB_BEGIN (NOLOAD) :
.ttbtable LCD_BEGIN (NOLOAD) :
{
. = ALIGN (0x4000);
_ttbstart = .;