Skip to content

Commit

Permalink
Revert "arm: mediatek: retrieve ram_base from dts node for armv8 plat…
Browse files Browse the repository at this point in the history
…form"

This reverts commit 5fd6d4c.

The revert fixes bootup on mt7622/BPI-R64 since 2023.10
  • Loading branch information
frank-w committed May 23, 2024
1 parent d3eda95 commit c1c29d9
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 68 deletions.
5 changes: 0 additions & 5 deletions arch/arm/dts/mt7981-emmc-rfb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
tick-timer = &timer0;
};

memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x10000000>;
};

reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/dts/mt7981-rfb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
stdout-path = &uart0;
tick-timer = &timer0;
};

memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x10000000>;
};
};

&uart0 {
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/dts/mt7981-sd-rfb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
tick-timer = &timer0;
};

memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x10000000>;
};

reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/dts/mt7986a-bpi-r3-sd.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
tick-timer = &timer0;
};

memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x80000000>;
};

reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/dts/mt7986a-rfb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
tick-timer = &timer0;
};

memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x10000000>;
};

reg_1p8v: regulator-1p8v {
compatible = "regulator-fixed";
regulator-name = "fixed-1.8V";
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/dts/mt7986a-sd-rfb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
tick-timer = &timer0;
};

memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x10000000>;
};

reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/dts/mt7986b-rfb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
tick-timer = &timer0;
};

memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x10000000>;
};

reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/dts/mt7986b-sd-rfb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@
tick-timer = &timer0;
};

memory@40000000 {
device_type = "memory";
reg = <0x40000000 0x10000000>;
};

reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
Expand Down
14 changes: 4 additions & 10 deletions arch/arm/mach-mediatek/mt7622/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@
* Author: Sam Shih <sam.shih@mediatek.com>
*/

#include <common.h>
#include <fdtdec.h>
#include <init.h>
#include <asm/armv8/mmu.h>
#include <asm/system.h>
#include <asm/global_data.h>
#include <asm/u-boot.h>
#include <linux/sizes.h>

DECLARE_GLOBAL_DATA_PTR;
#include <asm/cache.h>

int print_cpuinfo(void)
{
Expand All @@ -24,13 +20,11 @@ int dram_init(void)
{
int ret;

ret = fdtdec_setup_mem_size_base();
ret = fdtdec_setup_memory_banksize();
if (ret)
return ret;
return fdtdec_setup_mem_size_base();

gd->ram_size = get_ram_size((void *)gd->ram_base, SZ_2G);

return 0;
}

void reset_cpu(void)
Expand Down
11 changes: 2 additions & 9 deletions arch/arm/mach-mediatek/mt7981/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,18 @@
* Author: Sam Shih <sam.shih@mediatek.com>
*/

#include <fdtdec.h>
#include <cpu_func.h>
#include <init.h>
#include <asm/armv8/mmu.h>
#include <asm/system.h>
#include <asm/global_data.h>
#include <asm/u-boot.h>
#include <linux/sizes.h>

DECLARE_GLOBAL_DATA_PTR;

int dram_init(void)
{
int ret;

ret = fdtdec_setup_mem_size_base();
if (ret)
return ret;

gd->ram_size = get_ram_size((void *)gd->ram_base, SZ_1G);
gd->ram_size = get_ram_size((void *)CFG_SYS_SDRAM_BASE, SZ_2G);

return 0;
}
Expand Down
11 changes: 2 additions & 9 deletions arch/arm/mach-mediatek/mt7986/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,18 @@
* Author: Sam Shih <sam.shih@mediatek.com>
*/

#include <fdtdec.h>
#include <cpu_func.h>
#include <init.h>
#include <asm/armv8/mmu.h>
#include <asm/system.h>
#include <asm/global_data.h>
#include <asm/u-boot.h>
#include <linux/sizes.h>

DECLARE_GLOBAL_DATA_PTR;

int dram_init(void)
{
int ret;

ret = fdtdec_setup_mem_size_base();
if (ret)
return ret;

gd->ram_size = get_ram_size((void *)gd->ram_base, SZ_2G);
gd->ram_size = get_ram_size((void *)CFG_SYS_SDRAM_BASE, SZ_2G);

return 0;
}
Expand Down
1 change: 1 addition & 0 deletions board/mediatek/mt7622/mt7622_rfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ DECLARE_GLOBAL_DATA_PTR;

int board_init(void)
{
gd->bd->bi_boot_params = CFG_SYS_SDRAM_BASE + 0x100;
return 0;
}

Expand Down
10 changes: 10 additions & 0 deletions include/configs/mt7622.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,14 @@
#ifndef __MT7622_H
#define __MT7622_H

/* Uboot definition */
#define CFG_SYS_UBOOT_BASE CONFIG_TEXT_BASE

/* SPL -> Uboot */
#define CFG_SYS_UBOOT_START CONFIG_TEXT_BASE
/* DRAM */
#define CFG_SYS_SDRAM_BASE 0x40000000

/* Ethernet */

#endif
9 changes: 9 additions & 0 deletions include/configs/mt7981.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@
#ifndef __MT7981_H
#define __MT7981_H

/* Uboot definition */
#define CFG_SYS_UBOOT_BASE CONFIG_TEXT_BASE

/* SPL -> Uboot */
#define CFG_SYS_UBOOT_START CONFIG_TEXT_BASE

/* DRAM */
#define CFG_SYS_SDRAM_BASE 0x40000000

#endif
9 changes: 9 additions & 0 deletions include/configs/mt7986.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,13 @@
#ifndef __MT7986_H
#define __MT7986_H

/* Uboot definition */
#define CFG_SYS_UBOOT_BASE CONFIG_TEXT_BASE

/* SPL -> Uboot */
#define CFG_SYS_UBOOT_START CONFIG_TEXT_BASE

/* DRAM */
#define CFG_SYS_SDRAM_BASE 0x40000000

#endif

0 comments on commit c1c29d9

Please sign in to comment.