Skip to content

Conversation

robert-cheng-1127
Copy link

This PR adds support for the FT9001 fingerprint controller from FocalTech, which is specially designed for fingerprint sensor applications.

This PR includes initial support for the FT9001 evaluation board, with drivers as follows:

  • soc infrastructure
  • uart (register-based implementation)
  • clock control
  • reset
  • device tree bindings

Note: Current implementation uses direct register operations as the FocalTech HAL is not yet integrated into modules/hal.

@github-actions
Copy link

Hello @robert-cheng-1127, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

Copy link
Contributor

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

split into multiple comments before this gets reviewed e.g. one for soc, one for board

@robert-cheng-1127
Copy link
Author

split into multiple comments before this gets reviewed e.g. one for soc, one for board

Got it. I’ll split into multiple commits before review.

@robert-cheng-1127 robert-cheng-1127 force-pushed the soc-focaltech-ft9001-support branch 3 times, most recently from ebf7b84 to 33f5fdf Compare September 15, 2025 09:53
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason you can't use the generic reset driver?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed the stm32 pattern. I’ll try the generic reset driver first and see if it works for our case.
Thanks.

Copy link
Author

@robert-cheng-1127 robert-cheng-1127 Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @decsny,
I tried switching to reset-mmio, but I ran into two blockers:

  1. Binding mismatch
    The current reset-mmio.yaml doesn’t define reset-cells: [ id ] or include reset-controller.yaml.
    Because of that, DTS parsing fails with:

    unexpected 'reset-cells:' length in binding … 0 instead of 1

    whenever a peripheral uses resets = <&rst_xxx bit>.

  2. Init ordering
    Our UART driver is PRE_KERNEL_1, but reset-mmio gets POST_KERNEL priority, causing dependency validation to fail.

The reset-mmio driver works functionally (I tested with tests/drivers/reset/mmio), but these integration issues prevent using it on our platform.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this driver is using spinlocks is why someone made it post-kernel, and I don't know why the binding is like this. These things I guess were missed in review. So fair enough, I guess we need another generic one that is not like this

decsny
decsny previously approved these changes Sep 18, 2025
@robert-cheng-1127
Copy link
Author

Rebased onto main and resolved Kconfig conflict.

# SPDX-License-Identifier: Apache-2.0

config SOC_FT9001
bool "FocalTech FT9001 MCU"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kconfig uses tabs, also remove prompt from this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the oversight. I’ll review and fix all Kconfig files in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not fixed e54fa19

Copy link
Author

@robert-cheng-1127 robert-cheng-1127 Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed: removed prompt and used tabs.

Comment on lines 42 to 43
/****** Cortex-M4 Processor Exceptions Numbers ****************************************************************/
NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent here is wrong

Copy link
Contributor

@nordicjm nordicjm Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not fixed, I'm going to abandon this review, can you fix the issues everyone has commented, update the existing commits with the fixes, force push then ping people when the issues have been addressed and is it ready to review?
And before doing that, please read and ensure code complies with the coding standards available at:
https://docs.zephyrproject.org/latest/contribute/style/code.html
https://docs.zephyrproject.org/latest/contribute/style/cmake.html
https://docs.zephyrproject.org/latest/contribute/style/devicetree.html
https://docs.zephyrproject.org/latest/contribute/style/kconfig.html
And also the SoC/board porting guides available at:
https://docs.zephyrproject.org/latest/hardware/porting/soc_porting.html
https://docs.zephyrproject.org/latest/hardware/porting/board_porting.html
And finally details for submitting PRs including squashing of commits (have not looked in this PR to see if things need squashing but acquainting with this guide is good): https://docs.zephyrproject.org/latest/contribute/contributor_expectations.html#pr-requirements

  • Thanks!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed from SoC and moved to HAL module as requested.

bool "ft9001 MCU serial driver"
default y
depends on SERIAL
select SERIAL_HAS_DRIVER
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is the dt depends on?

Copy link
Author

@robert-cheng-1127 robert-cheng-1127 Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.
added DT dependency.

serial communication protocols.

if UART_FOCALTECH
config UART_INTERRUPT_DRIVEN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline line 18

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated config content.

bool "Runtime configuration for UART controllers"
default y
help
Enable runtime configuration of UART controllers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong ident and you are redeclaring an existing Kconfig

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks. done

};
};

status = "okay";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this here? What does this have to do with pinctrl?

Comment on lines 36 to 38
&pinctrl {
status = "disabled";
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my mistake. I removed the wrong status and fixed it.

# Copyright (c) 2025, FocalTech Systems CO.,Ltd
# SPDX-License-Identifier: Apache-2.0

board:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this file?

# Copyright (c) 2025, FocalTech Systems CO.,Ltd
# SPDX-License-Identifier: Apache-2.0

CONFIG_FLASH_LOAD_OFFSET=0x1000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this set here line 4?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @nordicjm,
This is required by our MCU’s secure boot. The ROM checks the first 4 KB of flash for configuration, and only after that it jumps to the application. That’s why the application needs to start at 0x1000, so we set CONFIG_FLASH_LOAD_OFFSET=0x1000 in the defconfig.
Do you think this is the right place to set it, or would you recommend another location?

Copy link
Contributor

@nordicjm nordicjm Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put it into dts as a partition with a chosen node for code partition and set the CONFIG_USE_DT_CODE_PARTITION Kconfig

CONFIG_FLASH_LOAD_OFFSET=0x1000
CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y
CONFIG_LOG=y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging is not a default option

@nordicjm nordicjm requested a review from kartben September 23, 2025 10:34
@@ -0,0 +1,129 @@
/*
* Copyright (c) 2025, FocalTech Systems CO.,Ltd
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file needs to be removed from in-tree; it contains much redundant stuff (like IRQ definitions, addresses, etc.)

Copy link
Author

@robert-cheng-1127 robert-cheng-1127 Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed from soc

@nordicjm nordicjm requested a review from decsny October 2, 2025 06:38
# SPDX-License-Identifier: Apache-2.0

config SOC_FT9001
bool "FocalTech FT9001 MCU"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not fixed e54fa19

Comment on lines 42 to 43
/****** Cortex-M4 Processor Exceptions Numbers ****************************************************************/
NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
Copy link
Contributor

@nordicjm nordicjm Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not fixed, I'm going to abandon this review, can you fix the issues everyone has commented, update the existing commits with the fixes, force push then ping people when the issues have been addressed and is it ready to review?
And before doing that, please read and ensure code complies with the coding standards available at:
https://docs.zephyrproject.org/latest/contribute/style/code.html
https://docs.zephyrproject.org/latest/contribute/style/cmake.html
https://docs.zephyrproject.org/latest/contribute/style/devicetree.html
https://docs.zephyrproject.org/latest/contribute/style/kconfig.html
And also the SoC/board porting guides available at:
https://docs.zephyrproject.org/latest/hardware/porting/soc_porting.html
https://docs.zephyrproject.org/latest/hardware/porting/board_porting.html
And finally details for submitting PRs including squashing of commits (have not looked in this PR to see if things need squashing but acquainting with this guide is good): https://docs.zephyrproject.org/latest/contribute/contributor_expectations.html#pr-requirements

  • Thanks!

@decsny decsny removed their request for review October 2, 2025 12:49
@robert-cheng-1127 robert-cheng-1127 force-pushed the soc-focaltech-ft9001-support branch from fdfe2f8 to 44c5aa9 Compare October 14, 2025 16:20
@github-actions
Copy link

github-actions bot commented Oct 14, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@github-actions github-actions bot added manifest manifest-hal_focaltech DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Oct 14, 2025
@robert-cheng-1127 robert-cheng-1127 force-pushed the soc-focaltech-ft9001-support branch 2 times, most recently from 7294461 to cf5d947 Compare October 15, 2025 07:48
@github-actions github-actions bot removed manifest manifest-hal_focaltech DNM (manifest) This PR should not be merged (controlled by action-manifest) labels Oct 15, 2025
@robert-cheng-1127 robert-cheng-1127 force-pushed the soc-focaltech-ft9001-support branch from a3576b7 to fefd013 Compare October 17, 2025 02:35
@robert-cheng-1127 robert-cheng-1127 force-pushed the soc-focaltech-ft9001-support branch from fefd013 to 47fb90f Compare October 20, 2025 03:31
@robert-cheng-1127
Copy link
Author

Hi @nordicjm, @decsny, @gmarull and @nordic-krch — thanks for the feedback so far.

I’ve addressed most comments and updated the commits; a few items are still under review.
When you have a moment, could you take another look?

Much appreciated!

Changes since last review

  • Formatting cleanups across Kconfig/CMake/DTS/bindings to follow Zephyr style.
  • Device-tree & bindings layout clarified.
  • Removed files that are not recommended to live in-tree.

@robert-cheng-1127 robert-cheng-1127 force-pushed the soc-focaltech-ft9001-support branch from 47fb90f to dadd691 Compare October 21, 2025 01:53
Add devicetree bindings for the FocalTech FT9001 SoC:
- Clock controller
- Reset controller
- UART

These bindings are required by the SoC and drivers added in subsequent
commits. Headers are placed under include/zephyr/dt-bindings/.

Signed-off-by: Robert Cheng <[email protected]>
@robert-cheng-1127 robert-cheng-1127 force-pushed the soc-focaltech-ft9001-support branch from dadd691 to fb49b8c Compare October 21, 2025 02:38
@robert-cheng-1127
Copy link
Author

Hi @kartben - thanks again for running the tests earlier.
I’ve addressed the issues reported by Twister, Documentation, Compliance, and Scancode.
Could you please re-run the checks when you have a moment?
Much appreciated!

Add initial support for the FocalTech FT9001 ARM Cortex-M SoC including:
- SoC Kconfig and dtsi integration points
- Early init and core setup
- Pinctrl base definitions

This prepares the tree for the FT9001 board and drivers.

Signed-off-by: Robert Cheng <[email protected]>
Add support for the FocalTech FT9001 evaluation board:
- Board dts/dtsi and pinmux
- defconfig and board.cmake
- Basic documentation

The board has been tested with the following Zephyr sample:
– samples/hello_world

Signed-off-by: Robert Cheng <[email protected]>
Introduce the base devicetree description for the FT9001 SoC.

Signed-off-by: Robert Cheng <[email protected]>
Add clock control driver for the FocalTech FT9001 SoC.

Signed-off-by: Robert Cheng <[email protected]>
Add reset controller driver for the FocalTech FT9001 SoC.

Signed-off-by: Robert Cheng <[email protected]>
Add the UART driver for the FocalTech FT9001 SoC.

Signed-off-by: Robert Cheng <[email protected]>
@robert-cheng-1127 robert-cheng-1127 force-pushed the soc-focaltech-ft9001-support branch from fb49b8c to 03fd8d3 Compare October 21, 2025 03:23
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants