Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0a9e6aa

Browse files
author
christinaa
committed
2 parents4948585 +14d365c commit0a9e6aa

File tree

4 files changed

+46
-16
lines changed

4 files changed

+46
-16
lines changed

‎arm_chainloader/loader.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Second stage bootloader.
2929
FATFS g_BootVolumeFs;
3030

3131
#defineROOT_VOLUME_PREFIX"0:"
32-
#defineDTB_LOAD_ADDRESS0x20000000
32+
#defineDTB_LOAD_ADDRESS0xF000000
3333
#defineKERNEL_LOAD_ADDRESS0x2000000
3434

3535
typedefvoid (*linux_t)(uint32_t,uint32_t,void*);

‎arm_chainloader/start.s

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ g_FirmwareData:
5151
movsp, #(MEM_STACK_END); \
5252
stmeasp, {r0-lr}^; \
5353
str lr,[sp, #60]; \
54-
mrs r0, spsr
55-
str r0,[sp, #64];
56-
54+
mrs r0, spsr; \
55+
str r0,[sp, #64]; \
56+
mov r0,sp
57+
5758
_fleh_undef:
5859
SaveRegisters()
5960
b sleh_undef

‎drivers/BCM2708UsbPhy.cc

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
*/
77

88
#include<drivers/IODevice.hpp>
9-
#include<drivers/BCM2708PowerManagement.hpp>
10-
9+
#include<drivers/BCM2708PowerManagement.hpp>
1110
#defineFLAG_BUSY (1 <<31)
1211

1312
structBCM2708UsbPhy : IODevice {
@@ -35,7 +34,7 @@ struct BCM2708UsbPhy : IODevice {
3534

3635
uint16_tusb_read(int reg) {
3736
write_bare(reg,0,0x60020000);
38-
return USB_MDIO_CSR &0x3FF;
37+
return USB_MDIO_CSR &0xFFFFF;
3938
}
4039

4140
virtualvoidusb_write(int reg,uint16_t value) {
@@ -46,24 +45,54 @@ struct BCM2708UsbPhy : IODevice {
4645
virtualvoidstart()override {
4746
IODriverLog("starting ...");
4847

48+
/* the LAN_RUN pin is GPIO6 according to the schematic*/
49+
/* edit: it's different between models.
50+
* see https://github.com/raspberrypi/firmware/blob/master/extra/dt-blob.dts#L711
51+
* e.g. on the RPi 2B it's pin 31
52+
*/
53+
54+
unsignedint ra = GP_FSEL3;
55+
ra &= ~(7 <<3);
56+
ra |=1 <<3;
57+
GP_FSEL3 = ra;
58+
59+
udelay(300);
60+
GP_CLR0 = (1 <<31);
61+
udelay(300);
62+
GP_SET0 = (1 <<31);
63+
udelay(300);
64+
65+
IODriverLog("LAN reset");
66+
4967
USB_GMDIOCSR = (1 <<18);
5068

51-
usb_write(0x15,4369/*cond ? 4569 : 272*/);
69+
usb_write(0x15,272/* devmode ? 4369 : 272*/);
5270
usb_write(0x19,0x4);
5371
usb_write(0x18,0x10);
5472
usb_write(0x1D,0x4);
5573
usb_write(0x17,5682);
5674

57-
while(!usb_read(0x1B) &0x7);
75+
while((usb_read(0x1B) & (1 <<7)) !=0);
76+
77+
USB_GVBUSDRV &= ~(1 <<7);
5878

59-
usb_write(0x1E,0x01);
79+
usb_write(0x1E,0x8000);
6080

6181
usb_write(0x1D,0x5000);
6282
usb_write(0x19,0xC004);
63-
usb_write(0x32,0x1C2F);
64-
usb_write(34,256);
65-
usb_write(36,0x10);
66-
usb_write(0x19,0x04);
83+
usb_write(0x20,0x1C2F);
84+
usb_write(0x22,0x0100);
85+
usb_write(0x24,0x0010);
86+
usb_write(0x19,0x0004);
87+
88+
USB_GVBUSDRV = USB_GVBUSDRV &0xFFF0FFFF |0xD0000;
89+
udelay(300);
90+
mmio_write32(0x7E980400 +3084,0x20402700);
91+
udelay(300);
92+
mmio_write32(0x7E980400,1);
93+
udelay(300);
94+
mmio_write32(0x7E980404,0xBB80);
95+
udelay(300);
6796

6897
IODriverLog("started");
6998

‎start.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ L_setup_hw_irq:
116116
mov r2,0x11111111
117117
mov r3, #(IC0_BASE+0x10+0x10)
118118

119-
unmask_all:
119+
/*unmask_all:
120120
st r2, (r0)
121121
st r2, (r1)
122122
add r0,4
123123
add r1,4
124-
ble r0, r3, unmask_all
124+
ble r0, r3, unmask_all*/
125125
126126
/* set interrupt vector bases*/
127127
mov r3, #0x1B000

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp