aboutsummaryrefslogtreecommitdiff
path: root/src/soc/broadcom/cygnus/phy_reg_access.c
blob: ea82dde4df81d4a83386f519b3440429f97e12fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
* Copyright (C) 2015 Broadcom Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*/

#include "soc/shmoo_and28/phy_reg_access.h"

uint32 REGRD (uint32 address) {

	volatile unsigned long data;

	data = (* (volatile uint32 *) (((uint32)GLOBAL_REG_RBUS_START) | (address)));
	//printf("REGRD %08X=%08X\n", address, data);
	return data;
}

uint32 REGWR (uint32 address, uint32 data) {

	((* (volatile uint32 *) (((uint32)GLOBAL_REG_RBUS_START) | (address))) = data);
	//printf("REGWR %08X=%08X\n", address, data);
	//  return SOC_E_NONE;
	return 0;
}