fix(rk3399): m0: Makefile: fix outside array bounds warning

Both GCC and clang actually complain about:

"""
In file included from src/dram.c:12:
src/dram.c: In function 'm0_main':
include/rk3399_mcu.h:15:34: warning: array subscript 0 is outside array bounds of 'volatile unsigned int[0]' [-Warray-bounds=]
   15 |                                 (*(volatile unsigned int *)(c)); __v; })
      |                                 ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/rk3399_mcu.h:16:69: note: in definition of macro 'mmio_write_32'
   16 | #define mmio_write_32(c, v)     ((*(volatile unsigned int *)(c)) = (v))
      |     ^
src/dram.c:67:23: note: in expansion of macro 'mmio_read_32'
   67 |                       mmio_read_32(PARAM_ADDR + PARAM_FREQ_SELECT));
      |                       ^~~~~~~~~~~~
cc1: note: source object is likely at address zero
In function 'ddr_set_pll',
    inlined from 'm0_main' at src/dram.c:71:2:
include/rk3399_mcu.h:14:40: warning: array subscript 0 is outside array bounds of 'volatile unsigned int[0]' [-Warray-bounds=]
   14 | #define mmio_read_32(c) ({unsigned int __v = \
      |                                        ^~~
include/rk3399_mcu.h:16:69: note: in definition of macro 'mmio_write_32'
   16 | #define mmio_write_32(c, v)     ((*(volatile unsigned int *)(c)) = (v))
      |     ^
src/dram.c:47:23: note: in expansion of macro 'mmio_read_32'
   47 |                       mmio_read_32(PARAM_ADDR + PARAM_DPLL_CON0));
      |                       ^~~~~~~~~~~~
In function 'm0_main':
cc1: note: source object is likely at address zero
In function 'ddr_set_pll',
    inlined from 'm0_main' at src/dram.c:71:2:
include/rk3399_mcu.h:14:40: warning: array subscript 0 is outside array bounds of 'volatile unsigned int[0]' [-Warray-bounds=]
   14 | #define mmio_read_32(c) ({unsigned int __v = \
      |                                        ^~~
include/rk3399_mcu.h:16:69: note: in definition of macro 'mmio_write_32'
   16 | #define mmio_write_32(c, v)     ((*(volatile unsigned int *)(c)) = (v))
      |     ^
src/dram.c:49:23: note: in expansion of macro 'mmio_read_32'
   49 |                       mmio_read_32(PARAM_ADDR + PARAM_DPLL_CON1));
      |                       ^~~~~~~~~~~~
In function 'm0_main':
cc1: note: source object is likely at address zero
include/rk3399_mcu.h:16:35: warning: array subscript 0 is outside array bounds of 'volatile unsigned int[0]' [-Warray-bounds=]
   16 | #define mmio_write_32(c, v)     ((*(volatile unsigned int *)(c)) = (v))
      |                                  ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/dram.c:80:9: note: in expansion of macro 'mmio_write_32'
   80 |         mmio_write_32(PARAM_ADDR + PARAM_M0_DONE, M0_DONE_FLAG);
      |         ^~~~~~~~~~~~~
cc1: note: source object is likely at address zero
"""

The global Makefile defines --param=min-pagesize=0 already, so let's
just apply the same fix for the m0 part of the RK3399 binary.

Suggested-by: Boyan Karatotev <boyan.karatotev@arm.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Change-Id: I4f29a579b9e4b01aa2540746ef46e2a382f0012e
1 file changed