mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
remaining fixes for log2. Simple prototype added to spd_ddr2.h
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://coreboot.org/repository/coreboot-v3@853 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
3b384ce2a2
commit
c24361eba7
3 changed files with 12 additions and 3 deletions
|
@ -446,10 +446,10 @@ void compute_allocate_resource(struct bus *bus, struct resource *bridge,
|
|||
* resource type specific.
|
||||
*/
|
||||
if (bridge->flags & IORESOURCE_IO) {
|
||||
min_align = log2(DEVICE_IO_ALIGN);
|
||||
min_align = log2c(DEVICE_IO_ALIGN);
|
||||
}
|
||||
if (bridge->flags & IORESOURCE_MEM) {
|
||||
min_align = log2(DEVICE_MEM_ALIGN);
|
||||
min_align = log2c(DEVICE_MEM_ALIGN);
|
||||
}
|
||||
|
||||
/* Make certain we have read in all of the resources. */
|
||||
|
|
|
@ -28,7 +28,13 @@
|
|||
*/
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
|
||||
int log2(unsigned int n);
|
||||
/* you have to explicity pick logc2 (ceiling) or log2f (floor)
|
||||
* it is a no-op if you KNOW that your number is a power of 2.
|
||||
* It is important to know what you are doing otherwise.
|
||||
* example: log2c(72) is 7, log2f(72) is 6!
|
||||
*/
|
||||
int log2c(unsigned int n);
|
||||
int log2f(unsigned int n);
|
||||
|
||||
void udelay(unsigned int usecs);
|
||||
void mdelay(unsigned int msecs);
|
||||
|
|
|
@ -86,3 +86,6 @@
|
|||
#define SPD_TRFC 42 /* add byte 0x40 bit [6:4] , so final val42+ table[((val40>>4) & 0x7)] + (val40 & 1)*256*/
|
||||
|
||||
#define SPD_TREF 12
|
||||
|
||||
/* prototypes for dealing with spd */
|
||||
u8 spd_read_byte(u16 device, u8 address);
|
||||
|
|
Loading…
Add table
Reference in a new issue