static void print_pre_console_buffer(void)
{
	unsigned long i = 0;
	char *buffer = (char *)CONFIG_PRE_CON_BUF_ADDR;

	if (gd->precon_buf_idx > CONFIG_PRE_CON_BUF_SZ)
		i = gd->precon_buf_idx - CONFIG_PRE_CON_BUF_SZ;

	while (i < gd->precon_buf_idx)
		putc(buffer[CIRC_BUF_IDX(i++)]);
}
static void pre_console_putc(const char c)
{
#ifdef CONFIG_PRE_CONSOLE_BUFFER
	char *buffer = (char *)CONFIG_PRE_CON_BUF_ADDR;

	buffer[CIRC_BUF_IDX(gd->precon_buf_idx++)] = c;
#endif
#ifdef CONFIG_PRE_CONSOLE_PUTC
	board_pre_console_putc(c);
#endif
}
static void pre_console_putc(const char c)
{
	char *buffer = (char *)CONFIG_PRE_CON_BUF_ADDR;

	buffer[CIRC_BUF_IDX(gd->precon_buf_idx++)] = c;
}