Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

software: remove redundant clk_frequency

  • Loading branch information...
commit 028c9f6cda80a8834450c86286b55cea0077efc5 1 parent 0f65527
Sébastien Bourdeauducq sbourdeauducq authored
4 software/bios/main.c
View
@@ -476,7 +476,7 @@ static int test_user_abort()
puts("I: Press Q or ESC to abort boot");
CSR_TIMER0_COUNTER = 0;
- CSR_TIMER0_COMPARE = 2*brd_desc->clk_frequency;
+ CSR_TIMER0_COMPARE = 2*CSR_FREQUENCY;
CSR_TIMER0_CONTROL = TIMER_ENABLE;
while(CSR_TIMER0_CONTROL & TIMER_ENABLE) {
if(readchar_nonblock()) {
@@ -596,7 +596,7 @@ static void readstr(char *s, int size)
static void ethreset_delay()
{
CSR_TIMER0_COUNTER = 0;
- CSR_TIMER0_COMPARE = brd_desc->clk_frequency >> 2;
+ CSR_TIMER0_COMPARE = CSR_FREQUENCY >> 2;
CSR_TIMER0_CONTROL = TIMER_ENABLE;
while(CSR_TIMER0_CONTROL & TIMER_ENABLE);
}
7 software/demo/memstats.c
View
@@ -1,6 +1,6 @@
/*
* Milkymist SoC (Software)
- * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
+ * Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq
*
* 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
@@ -17,9 +17,8 @@
#include <board.h>
-#include <hal/brd.h>
-
#include <hw/fmlmeter.h>
+#include <hw/sysctl.h>
static unsigned int last_stb_count;
static unsigned int last_ack_count;
@@ -41,7 +40,7 @@ void memstats_tick()
unsigned int memstat_occupancy()
{
- return last_stb_count/(brd_desc->clk_frequency/100);
+ return last_stb_count/(CSR_FREQUENCY/100);
}
unsigned int memstat_net_bandwidth()
3  software/include/base/board.h
View
@@ -1,6 +1,6 @@
/*
* Milkymist SoC (Software)
- * Copyright (C) 2007, 2008, 2009, 2010 Sebastien Bourdeauducq
+ * Copyright (C) 2007, 2008, 2009, 2010, 2011 Sebastien Bourdeauducq
*
* 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
@@ -23,7 +23,6 @@
struct board_desc {
unsigned short int id;
char name[BOARD_NAME_LEN];
- unsigned int clk_frequency;
unsigned int ethernet_phyadr;
};
3  software/libbase/board.c
View
@@ -1,6 +1,6 @@
/*
* Milkymist SoC (Software)
- * Copyright (C) 2007, 2008, 2009 Sebastien Bourdeauducq
+ * Copyright (C) 2007, 2008, 2009, 2011 Sebastien Bourdeauducq
*
* 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
@@ -25,7 +25,6 @@ static const struct board_desc boards[1] = {
{
.id = 0x4D31, /* M1 */
.name = "Milkymist One",
- .clk_frequency = 80000000,
.ethernet_phyadr = 1
},
};
7 software/libhal/time.c
View
@@ -23,7 +23,6 @@
#include <hw/sysctl.h>
#include <hw/interrupts.h>
-#include <hal/brd.h>
#include <hal/time.h>
static int sec;
@@ -33,7 +32,7 @@ void time_init()
unsigned int mask;
CSR_TIMER0_COUNTER = 0;
- CSR_TIMER0_COMPARE = brd_desc->clk_frequency;
+ CSR_TIMER0_COMPARE = CSR_FREQUENCY;
CSR_TIMER0_CONTROL = TIMER_AUTORESTART|TIMER_ENABLE;
irq_ack(IRQ_TIMER0);
@@ -64,7 +63,7 @@ void time_get(struct timestamp *ts)
irq_setmask(oldmask);
ts->sec = sec2;
- ts->usec = counter/(brd_desc->clk_frequency/1000000);
+ ts->usec = counter/(CSR_FREQUENCY/1000000);
/*
* If the counter is less than half a second, we consider that
@@ -72,7 +71,7 @@ void time_get(struct timestamp *ts)
* value.
*/
if(pending) {
- if(counter < (brd_desc->clk_frequency/2))
+ if(counter < (CSR_FREQUENCY/2))
ts->sec++;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.