Hello. I try to write video driver for Silicon motion SM750 for uboot. I copy the driver of sm501.c and add some code. And one sad moment stop me for done:
sample code:
`/* Setup */
pci_write_config_dword (devbusfn, PCI_COMMAND,
(PCI_COMMAND_MEMORY | PCI_COMMAND_IO));
pci_read_config_word (devbusfn, PCI_DEVICE_ID, &device_id);
pci_read_config_dword (devbusfn, PCI_REVISION_ID, &id);
pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_0, &pci_mem_base);
pci_read_config_dword (devbusfn, PCI_BASE_ADDRESS_1, &pci_mmio_base);
sm501.frameAdrs = pci_mem_to_phys (devbusfn, pci_mem_base);
sm501.isaBase = pci_mem_to_phys (devbusfn, pci_mmio_base);`
sm501.isaBase (0x42000000) is mapped ok, and its work great (i have worked i2c and other stuff, display has video signal and more), trouble with sm501.frameAdrs(0xfc000000) - pci_mem_to_phys failed with console output pci_hose_bus_to_phys: invalid physical address.
I add some printf and turn on debug in system pci functions and get this:
PCI Autoconfig: Bus Memory region: [0x42000000-0x43ffffff], Physical Memory [e2000000-e3ffffffx]
PCI Autoconfig: BAR 0, Mem, size=0x4000000, addr: 0x44000000, res->bus_start: 0x42000000, size: 67108864, res->size: 33554432 address=0x44000000 bus_lower=0x42000000 No room in resource
PCI Autoconfig: BAR 1, Mem, size=0x200000, addr: 0x42000000, res->bus_start: 0x42000000, size: 2097152, res->size: 33554432 address=0x42000000 bus_lower=0x42200000
as you can see, bar0 failed to allocating resources, and as a result we do not have access to framebuffer and can't draw on screen.
U-boot pci header 00.00.00:
`pci header 00.00.00
vendor ID = 0x126f
device ID = 0x0750
command register = 0x0007
status register = 0x0010
revision ID = 0xa1
class code = 0x03 (Display controller)
sub class code = 0x00
programming interface = 0x00
cache line = 0x08
latency time = 0x00
header type = 0x00
BIST = 0x00
base address 0 = 0xfc000000
base address 1 = 0x42000000
base address 2 = 0x00000000
base address 3 = 0x00000000
base address 4 = 0x00000000
base address 5 = 0x00000000
cardBus CIS pointer = 0x00000000
sub system vendor ID = 0x126f
sub system ID = 0x0750
expansion ROM base address = 0x00000000
interrupt line = 0xff
interrupt pin = 0x01
min Grant = 0x00
max Latency = 0x00`
In linux video card work perfectly. How i can fix this error?
Hello. I try to write video driver for Silicon motion SM750 for uboot. I copy the driver of sm501.c and add some code. And one sad moment stop me for done:
sample code:
`/* Setup */
pci_write_config_dword (devbusfn, PCI_COMMAND,
(PCI_COMMAND_MEMORY | PCI_COMMAND_IO));
sm501.isaBase (0x42000000) is mapped ok, and its work great (i have worked i2c and other stuff, display has video signal and more), trouble with sm501.frameAdrs(0xfc000000) - pci_mem_to_phys failed with console output
pci_hose_bus_to_phys: invalid physical address.I add some printf and turn on debug in system pci functions and get this:
PCI Autoconfig: Bus Memory region: [0x42000000-0x43ffffff], Physical Memory [e2000000-e3ffffffx]PCI Autoconfig: BAR 0, Mem, size=0x4000000, addr: 0x44000000, res->bus_start: 0x42000000, size: 67108864, res->size: 33554432 address=0x44000000 bus_lower=0x42000000 No room in resourcePCI Autoconfig: BAR 1, Mem, size=0x200000, addr: 0x42000000, res->bus_start: 0x42000000, size: 2097152, res->size: 33554432 address=0x42000000 bus_lower=0x42200000as you can see, bar0 failed to allocating resources, and as a result we do not have access to framebuffer and can't draw on screen.
U-boot pci header 00.00.00:
`pci header 00.00.00
vendor ID = 0x126f
device ID = 0x0750
command register = 0x0007
status register = 0x0010
revision ID = 0xa1
class code = 0x03 (Display controller)
sub class code = 0x00
programming interface = 0x00
cache line = 0x08
latency time = 0x00
header type = 0x00
BIST = 0x00
base address 0 = 0xfc000000
base address 1 = 0x42000000
base address 2 = 0x00000000
base address 3 = 0x00000000
base address 4 = 0x00000000
base address 5 = 0x00000000
cardBus CIS pointer = 0x00000000
sub system vendor ID = 0x126f
sub system ID = 0x0750
expansion ROM base address = 0x00000000
interrupt line = 0xff
interrupt pin = 0x01
min Grant = 0x00
max Latency = 0x00`
In linux video card work perfectly. How i can fix this error?