-
Notifications
You must be signed in to change notification settings - Fork 641
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[platform][vc4] fix time resolution, start genet driver, fix rpi2-tes…
…t build
- Loading branch information
1 parent
6177b60
commit 72e853b
Showing
5 changed files
with
52 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// based on drivers/net/ethernet/broadcom/genet/bcmgenet.c from linux | ||
// for PHY control, look at the cmd_bits variable in drivers/net/ethernet/broadcom/genet/bcmmii.c | ||
|
||
#include <lk/reg.h> | ||
#include <stdio.h> | ||
#include <lk/console_cmd.h> | ||
#include <platform/bcm28xx.h> | ||
#include <lk/debug.h> | ||
|
||
static int cmd_genet_dump(int argc, const cmd_args *argv); | ||
|
||
STATIC_COMMAND_START | ||
STATIC_COMMAND("dump_genet", "print genet information", &cmd_genet_dump) | ||
STATIC_COMMAND_END(genet); | ||
|
||
#define SYS_REV_CTRL (GENET_BASE + 0x0) | ||
|
||
static int cmd_genet_dump(int argc, const cmd_args *argv) { | ||
uint32_t reg = *REG32(SYS_REV_CTRL); | ||
uint8_t major = (reg >> 24 & 0x0f); | ||
if (major == 6) major = 5; | ||
else if (major == 5) major = 4; | ||
else if (major == 0) major = 1; | ||
|
||
dprintf(INFO, "found GENET controller version %d\n", major); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters