2 ** Copyright 2000, 2001 Broadcom Corporation
5 ** No portions of this material may be reproduced in any form
6 ** without the written permission of:
8 ** Broadcom Corporation
9 ** 5300 California Avenue
10 ** Irvine, California 92617
12 ** All information contained in this document is Broadcom
13 ** Corporation company private proprietary, and trade secret.
15 ** ----------------------------------------------------------
20 ** $Rev::file = : Global SVN Revision = 1780 $:
26 * Use those header files for the northstar build
37 #define CACHE_LINE_SIZE (32)
39 void flush_dcache_range(unsigned long start
, unsigned long stop
)
43 for (i
= start
; i
< stop
; i
+= CACHE_LINE_SIZE
) {
44 asm volatile("MCR p15, 0, %0, c7, c10, 1"::"r"(i
));
46 asm volatile("MCR p15, 0, r0, c7, c10, 4":::); /* DSB */
49 void invalidate_dcache_range(unsigned long start
, unsigned long stop
)
53 for (i
= start
; i
< stop
; i
+= CACHE_LINE_SIZE
) {
54 asm volatile("MCR p15, 0, %0, c7, c6, 1"::"r"(i
));
57 asm volatile("MCR p15, 0, r0, c7, c10, 4":::); /* DSB */
60 void SHMOO_FLUSH_DATA_TO_DRAM(ddr40_addr_t Address
, unsigned int bytes
)
62 unsigned long const EndAddress
= Address
+ bytes
;
63 flush_dcache_range(Address
, EndAddress
);
66 void SHMOO_INVALIDATE_DATA_FROM_DRAM(ddr40_addr_t Address
, unsigned int bytes
)
68 unsigned long const EndAddress
= Address
+ bytes
;
69 invalidate_dcache_range(Address
, EndAddress
);
72 void UART_OUT(unsigned int val
)
77 void plot_dec_number(unsigned int val
)
82 void plot_hex_number(unsigned int val
)
87 unsigned int tb_r(ddr40_addr_t Address
)
89 unsigned int const Data
= *(unsigned int *)Address
;
94 void tb_w(ddr40_addr_t Address
, unsigned int Data
)
96 *(unsigned int *)Address
= Data
;
99 unsigned int SHMOO_DRAM_READ_32(ddr40_addr_t Address
)
101 return (*(unsigned int *)Address
);
104 void SHMOO_DRAM_WRITE_32(ddr40_addr_t Address
, unsigned int Data
)
106 *(unsigned int *)Address
= Data
;
109 int rewrite_dram_mode_regs(void *sih
)
111 return rewrite_mode_registers(sih
);
115 * Functions for the PHY init
117 void PrintfLog(char * const ptFormatStr
, ...)
119 char __tmp_buf
[128] = {'L', 'o', 'g', ':', ' '};
122 va_start(arg
, ptFormatStr
);
123 vsprintf(&__tmp_buf
[5], ptFormatStr
, arg
);
129 void PrintfErr(char * const ptFormatStr
, ...)
131 char __tmp_buf
[128] = {'E', 'r', 'r', 'o', 'r', ':', ' '};
134 va_start(arg
, ptFormatStr
);
135 vsprintf(&__tmp_buf
[7], ptFormatStr
, arg
);
141 void PrintfFatal(char * const ptFormatStr
, ...)
143 char __tmp_buf
[128] = {'F', 'a', 't', 'a', 'l', ':', ' '};
146 va_start(arg
, ptFormatStr
);
147 vsprintf(&__tmp_buf
[7], ptFormatStr
, arg
);