src: Use PCI_BASE_ADDRESS_* macros instead of magic numbers

Change-Id: Id3390c5ac6a9517ffc2d202f41802e6f4d2e314c
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44371
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Elyes HAOUAS
2020-08-11 09:39:43 +02:00
committed by Patrick Georgi
parent a3022056a2
commit a4dd33cc8b
12 changed files with 35 additions and 24 deletions

View File

@@ -4,6 +4,7 @@
*/
#include <delay.h>
#include <device/pci_def.h>
#include "ast_drv.h"
#include "ast_dram_tables.h"
@@ -329,7 +330,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
ast->dev = dev;
/* PCI BAR 1 */
res = find_resource(dev->pdev, 0x14);
res = find_resource(dev->pdev, PCI_BASE_ADDRESS_1);
if (!res) {
dev_err(dev->pdev, "BAR1 resource not found.\n");
ret = -EIO;
@@ -343,7 +344,7 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
/* PCI BAR 2 */
ast->io_space_uses_mmap = false;
res = find_resource(dev->pdev, 0x18);
res = find_resource(dev->pdev, PCI_BASE_ADDRESS_2);
if (!res) {
dev_err(dev->pdev, "BAR2 resource not found.\n");
ret = -EIO;

View File

@@ -3,6 +3,7 @@
* Copied from Linux drivers/gpu/drm/ast/ast_mode.c
*/
#include <edid.h>
#include <device/pci_def.h>
#include "ast_drv.h"
@@ -18,7 +19,7 @@ int ast_crtc_do_set_base(struct drm_crtc *crtc)
struct drm_framebuffer *fb = crtc->primary->fb;
/* PCI BAR 0 */
struct resource *res = find_resource(crtc->dev->pdev, 0x10);
struct resource *res = find_resource(crtc->dev->pdev, PCI_BASE_ADDRESS_0);
if (!res) {
printk(BIOS_ERR, "BAR0 resource not found.\n");
return -EIO;

View File

@@ -12,7 +12,7 @@ static void oxford_oxpcie_enable(struct device *dev)
{
printk(BIOS_DEBUG, "Initializing Oxford OXPCIe952\n");
struct resource *res = find_resource(dev, 0x10);
struct resource *res = find_resource(dev, PCI_BASE_ADDRESS_0);
if (!res) {
printk(BIOS_WARNING, "OXPCIe952: No UART resource found.\n");
return;