sram_printch('\r');
}
- void __sramfunc sram_printascii(const char *s)
-{
- while (*s) {
- if (*s == '\n')
- {
- sram_printch('\r');
- }
- sram_printch(*s);
- s++;
- }
-}
void print(const char *s)
{
sram_printascii(s);
print_Dec(value);
}
-static void /* inline*/ __sramfunc printhex(unsigned int hex)
-{
- int i = 8;
- sram_printch('0');
- sram_printch('x');
- while (i--) {
- unsigned char c = (hex & 0xF0000000) >> 28;
- sram_printch(c < 0xa ? c + '0' : c - 0xa + 'a');
- hex <<= 4;
- }
-}
#else
static void inline sram_printch(char byte) {}
static void inline sram_printascii(const char *s) {}
if(nMHz < 100)
nMHz = 100;
nMHz = ddr_change_freq(nMHz);
- printhex(nMHz);
+ sram_printhex(nMHz);
sram_printch(' ');
- printhex(n++);
+ sram_printhex(n++);
sram_printch(' ');
g_crc2 = calc_crc32((u32)_stext, (size_t)(_etext-_stext));
if (g_crc1!=g_crc2)
ddr_suspend();
delayus(nMHz);
ddr_resume();
- printhex(nMHz);
+ sram_printhex(nMHz);
sram_printch(' ');
- printhex(n++);
+ sram_printhex(n++);
g_crc2 = calc_crc32((u32)_stext, (size_t)(_etext-_stext));
if (g_crc1!=g_crc2)
{
u32 en = readl(RK29_GPIO##ID##_BASE + GPIO_INTEN); \
if (en) { \
sram_printascii("GPIO" #ID "_INTEN: "); \
- printhex(en); \
+ sram_printhex(en); \
sram_printch('\n'); \
} \
} while (0)
do { \
u32 state = readl(RK29_GRF_BASE + GRF_GPIO0_PULL + (ID<<2)); \
sram_printascii("GPIO" #ID "_PULL: "); \
- printhex(state); \
+ sram_printhex(state); \
sram_printch('\n'); \
} while (0)
/* Tag function inside SRAM called from inside SRAM with this */
#define __sramlocalfunc __section(.sram.text)
-void __init rk29_sram_init(void);
+int __init rk29_sram_init(void);
static inline unsigned long ddr_save_sp(unsigned long new_sp)
{
#define DDR_SAVE_SP(save_sp) do { save_sp = ddr_save_sp((SRAM_DATA_END&(~7))); } while (0)
#define DDR_RESTORE_SP(save_sp) do { ddr_save_sp(save_sp); } while (0)
+extern void __sramfunc sram_printch(char byte);
+extern void __sramfunc sram_printascii(const char *s);
+extern void __sramfunc sram_printhex(unsigned int hex);
+
#endif /* CONFIG_PLAT_RK */
#endif
#include <asm/tlbflush.h>
#include <asm/cacheflush.h>
#include <mach/memory.h>
+#include <plat/sram.h>
/* SRAM section definitions from the linker */
return 0;
}
+
+void __sramfunc sram_printascii(const char *s)
+{
+ while (*s) {
+ sram_printch(*s);
+ s++;
+ }
+}
+
+void __sramfunc sram_printhex(unsigned int hex)
+{
+ int i = 8;
+ sram_printch('0');
+ sram_printch('x');
+ while (i--) {
+ unsigned char c = (hex & 0xF0000000) >> 28;
+ sram_printch(c < 0xa ? c + '0' : c - 0xa + 'a');
+ hex <<= 4;
+ }
+}