Changeset e27e36e in mainline for uspace/drv/platform/mac/mac.c
- Timestamp:
- 2017-10-04T17:39:48Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c188c62
- Parents:
- 7e55bed7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/platform/mac/mac.c
r7e55bed7 re27e36e 41 41 #include <ops/hw_res.h> 42 42 #include <stdio.h> 43 #include <sysinfo.h> 43 44 44 45 #define NAME "mac" … … 47 48 hw_resource_list_t hw_resources; 48 49 } mac_fun_t; 50 51 static hw_resource_t adb_regs[] = { 52 { 53 .type = IO_RANGE, 54 .res.io_range = { 55 .address = 0, 56 .size = 0x2000, 57 .relative = false, 58 .endianness = BIG_ENDIAN 59 } 60 }, 61 }; 62 63 static mac_fun_t adb_data = { 64 .hw_resources = { 65 1, 66 adb_regs 67 } 68 }; 49 69 50 70 static hw_resource_t pci_conf_regs[] = { … … 88 108 { 89 109 ddf_msg(LVL_DEBUG, "Adding new function '%s'.", name); 110 printf("mac: Adding new function '%s'.\n", name); 90 111 91 112 ddf_fun_t *fnode = NULL; … … 114 135 } 115 136 137 printf("mac: Added new function '%s' (str=%s).\n", name, str_match_id); 116 138 return true; 117 139 … … 135 157 static int mac_dev_add(ddf_dev_t *dev) 136 158 { 159 int rc; 160 uintptr_t cuda_physical; 137 161 #if 0 138 162 /* Register functions */ 139 if (!mac_add_fun(dev, "pci0", "intel_pci", &pci_data)) 140 ddf_msg(LVL_ERROR, "Failed to add functions for Mac platform."); 163 if (!mac_add_fun(dev, "pci0", "intel_pci", &pci_data)) { 164 ddf_msg(LVL_ERROR, "Failed to add PCI function for Mac platform."); 165 return EIO; 166 } 141 167 #else 142 168 (void)pci_data; 143 (void)mac_add_fun;144 169 #endif 145 170 rc = sysinfo_get_value("cuda.address.physical", &cuda_physical); 171 if (rc != EOK) 172 return EIO; 173 174 adb_regs[0].res.io_range.address = cuda_physical; 175 176 if (!mac_add_fun(dev, "adb", "cuda_adb", &adb_data)) { 177 ddf_msg(LVL_ERROR, "Failed to add ADB function for Mac platform."); 178 return EIO; 179 } 180 146 181 return EOK; 147 182 }
Note:
See TracChangeset
for help on using the changeset viewer.