Page MenuHomeFreeBSD

Patch for Amlogic single core PIC
ClosedPublic

Authored by john-feith.com on May 3 2015, 3:14 AM.
Tags
Referenced Files
Unknown Object (File)
Fri, Dec 20, 11:49 AM
Unknown Object (File)
Thu, Dec 12, 10:17 AM
Unknown Object (File)
Tue, Dec 3, 1:57 AM
Unknown Object (File)
Nov 1 2024, 2:32 PM
Unknown Object (File)
Nov 1 2024, 2:32 PM
Unknown Object (File)
Nov 1 2024, 2:32 PM
Unknown Object (File)
Oct 6 2024, 8:14 AM
Unknown Object (File)
Sep 21 2024, 4:03 AM
Subscribers

Details

Reviewers
ganbold
andrew
Summary

Currently a kernel for the aml8726-m3 can't be built since the aml8726-m3 only has an amlogic PIC
(which is also present on the aml8726-m6 and can be used there instead of the GIC).

This patch facilitates the following kernel configs:

Single core using PIC (suitable for aml8726-m3 or -m6):

#options        SOC_AML_MULTICORE
#options        SMP

UP using GIC (suitable for aml8726-m6 and later):

options        SOC_AML_MULTICORE
#options        SMP

SMP using GIC (suitable for aml8726-m6 and later):

options        SOC_AML_MULTICORE
options        SMP
Test Plan

All three configuration have been smoke tested on the VSATV102-M6
(aml8726-m6 SoC) and the SMP configuration was also tested on the
ODROID-C1 (aml8726-m8b).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

john-feith.com retitled this revision from to Patch for Amlogic single core PIC.
john-feith.com updated this object.
john-feith.com edited the test plan for this revision. (Show Details)
john-feith.com added reviewers: andrew, ganbold.
john-feith.com set the repository for this revision to rS FreeBSD src repository - subversion.
john-feith.com added a project: ARM.

I would suggest you create two device options:

device gic
device aml_pic

The former will enable the gic driver, the later the Amlogic PIC.

If you need a macro to select on you can add DEV_GIC and DEV_AML_PIC to options.arm.

sys/arm/amlogic/aml8726/files.aml8726
13

This was correct, it should only be selected by smp as this file should only contain smp related code.

Simply including aml_pic shouldn't be sufficient to enable it as the interrupt controller
(some platforms may require it to correctly disable the PIC hardware so that GIC can
be used).

I'll rework things to use the two device options and use the exisistence of the DEV_GIC
macro to control the pic driver deferring interrupt control to the gic driver.

sys/arm/amlogic/aml8726/files.aml8726
13

My change made the file dependent on both SMP and GIC since SMP is not possible on Amlogic without
GIC.

The change causes a kernel configured for SMP without GIC to fail at build time which seems desirable.

Without the change a kernel build may succeed for a impossible configuration.

What's the downside of making aml8726_mp.c dependent on GIC?

john-feith.com edited edge metadata.

Reworked as suggested and retested.

I've looked but am unable to find any details on the pic in the -m6. The copies of Linux I found on the Amlogic site assume the pic is only in the -m3. This leads me to think they expect only the gic to be used on the -m6.

sys/arm/amlogic/aml8726/files.aml8726
8

I've added this to sys/conf/files.arm, you can remove it from here.

Typically you would use the gic on the -m6. However it does
also have a pic ... most of my initial development was done
on a -m6 using the pic.

I've regenerated the diff to reflect the recent changes to
HEAD and the fact that normally on the -m6 the firmware should
default to leaving the pic disabled meaning it shouldn't be
necessary to have the pic driver explicitly disable the
hardware in order to use the gic.

Tested on YYHD18 (aml8726-m3 SoC ... config files will be forth coming),
VSATV102 (aml8726-m6 SoC) and ODROID-C1 (aml8726-m8b SoC).

I'm planning on committing this soon.

ganbold edited edge metadata.
This revision is now accepted and ready to land.May 21 2015, 7:11 AM