Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 566800 Details for
Bug 678994
dev-libs/pigpio add support for arm64 architecture
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
pigpio.c.patch
pigpio.c.patch (text/plain), 2.40 KB, created by
Martin Zwicknagl
on 2019-02-27 20:33:52 UTC
(
hide
)
Description:
pigpio.c.patch
Filename:
MIME Type:
Creator:
Martin Zwicknagl
Created:
2019-02-27 20:33:52 UTC
Size:
2.40 KB
patch
obsolete
>--- pigpio/pigpio.c 2019-02-27 20:24:18.389655115 +0100 >+++ pigpio-v68/pigpio.c 2019-02-27 20:19:07.712302977 +0100 >@@ -1511,6 +1511,47 @@ > return valid; > } > >+ >+ >+static unsigned get_dt_ranges(const char *filename, unsigned offset) >+{ >+ unsigned address = ~0; >+ FILE *fp = fopen(filename, "rb"); >+ if (fp) >+ { >+ unsigned char buf[4]; >+ fseek(fp, offset, SEEK_SET); >+ if (fread(buf, 1, sizeof buf, fp) == sizeof buf) >+ address = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3] << 0; >+ fclose(fp); >+ } >+ return address; >+} >+ >+unsigned bcm_host_get_peripheral_address(void) >+{ >+ unsigned address = get_dt_ranges("/proc/device-tree/soc/ranges", 4); >+ return address == ~0 ? 0x20000000 : address; >+} >+ >+unsigned bcm_host_get_peripheral_size(void) >+{ >+ unsigned address = get_dt_ranges("/proc/device-tree/soc/ranges", 8); >+ return address == ~0 ? 0x01000000 : address; >+} >+ >+unsigned bcm_host_get_sdram_address(void) >+{ >+ unsigned address = get_dt_ranges("/proc/device-tree/axi/vc_mem/reg", 8); >+ return address == ~0 ? 0x40000000 : address; >+} >+ >+ >+ >+ >+ >+ >+ > /* ----------------------------------------------------------------------- */ > > static char * myTimeStamp() >@@ -13338,6 +13379,54 @@ > } > > fclose(filp); >+ >+ >+ if ( piCores == 0) >+ { >+ if ( !strncasecmp("processor\t: 0", buf, 10) ) >+ { >+ piCores=1; >+ piCores = 1; >+ pi_peri_phys = 0x20000000; >+ pi_dram_bus = 0x40000000; >+ pi_mem_flag = 0x0C; >+ } >+ >+ else if ( strncasecmp( "processor\t: 3", buf, 10) ) >+ { >+ piCores=4; >+ pi_peri_phys = bcm_host_get_peripheral_address(); >+ pi_dram_bus = bcm_host_get_sdram_address(); >+ pi_mem_flag = 0x04; >+ } >+ } >+ >+printf("peripheral address %x\n", pi_peri_phys); >+printf("sdram_address %x\n", pi_dram_bus); >+ printf("piCores: %d\n", piCores); >+ >+ if ( rev == 0 ) >+ { >+ filp = fopen( "/proc/device-tree/system/linux,revision", "r" ); >+ if (filp != NULL) >+ { >+ while (fgets(buf, sizeof(buf), filp) != NULL) >+ { >+ rev = (unsigned)buf[0]; >+ rev <<= 8; >+ rev |= (unsigned)buf[1]; >+ rev <<= 8; >+ rev |= (unsigned)buf[2]; >+ rev <<= 8; >+ rev |= (unsigned)buf[3]; >+ } >+ } >+ fclose( filp ); >+ } >+ >+ printf("revision: %8x\n", rev ); >+ >+ > } > return rev; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 678994
: 566800