/* make sure u-boot and kernel use the same GPBR !  */
int rtc_get(struct rtc_time *tmp)
/* make sure u-boot and kernel use the same GPBR !  */
int rtc_get(struct rtc_time *tmp)
{
	at91_rtt_t *rtt = (at91_rtt_t *) ATMEL_BASE_RTT;
	at91_gpbr_t *gpbr = (at91_gpbr_t *) ATMEL_BASE_GPBR;
	ulong tim;
	ulong tim2;
	ulong off;
	do {
		tim = readl(&rtt->vr);
		tim2 = readl(&rtt->vr);
	} while (tim!=tim2);
	off = readl(&gpbr->reg[AT91_GPBR_INDEX_TIMEOFF]);
	rtc_to_tm(tim+off, tmp);
	return 0;
}