init: add dsm gpl source

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-07-05 18:00:04 +02:00
parent 11fe69a171
commit 5fa3ea047a
1993 changed files with 475779 additions and 4517 deletions

View File

@ -1,6 +1,6 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# #
# clang-format configuration file. Intended for clang-format >= 4. # clang-format configuration file. Intended for clang-format >= 11.
# #
# For more information, see: # For more information, see:
# #
@ -13,7 +13,7 @@ AccessModifierOffset: -4
AlignAfterOpenBracket: Align AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false AlignConsecutiveDeclarations: false
#AlignEscapedNewlines: Left # Unknown to clang-format-4.0 AlignEscapedNewlines: Left
AlignOperands: true AlignOperands: true
AlignTrailingComments: false AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false
@ -37,24 +37,24 @@ BraceWrapping:
AfterObjCDeclaration: false AfterObjCDeclaration: false
AfterStruct: false AfterStruct: false
AfterUnion: false AfterUnion: false
#AfterExternBlock: false # Unknown to clang-format-5.0 AfterExternBlock: false
BeforeCatch: false BeforeCatch: false
BeforeElse: false BeforeElse: false
IndentBraces: false IndentBraces: false
#SplitEmptyFunction: true # Unknown to clang-format-4.0 SplitEmptyFunction: true
#SplitEmptyRecord: true # Unknown to clang-format-4.0 SplitEmptyRecord: true
#SplitEmptyNamespace: true # Unknown to clang-format-4.0 SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom BreakBeforeBraces: Custom
#BreakBeforeInheritanceComma: false # Unknown to clang-format-4.0 BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: false BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false BreakConstructorInitializersBeforeComma: false
#BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0 BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false BreakStringLiterals: false
ColumnLimit: 80 ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:' CommentPragmas: '^ IWYU pragma:'
#CompactNamespaces: false # Unknown to clang-format-4.0 CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 8 ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8 ContinuationIndentWidth: 8
@ -62,39 +62,56 @@ Cpp11BracedListStyle: false
DerivePointerAlignment: false DerivePointerAlignment: false
DisableFormat: false DisableFormat: false
ExperimentalAutoDetectBinPacking: false ExperimentalAutoDetectBinPacking: false
#FixNamespaceComments: false # Unknown to clang-format-4.0 FixNamespaceComments: false
# Taken from: # Taken from:
# git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' include/ \ # git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' include/ tools/ \
# | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \ # | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \
# | sort | uniq # | LC_ALL=C sort -u
ForEachMacros: ForEachMacros:
- '__ata_qc_for_each'
- '__bio_for_each_bvec'
- '__bio_for_each_segment'
- '__evlist__for_each_entry'
- '__evlist__for_each_entry_continue'
- '__evlist__for_each_entry_from'
- '__evlist__for_each_entry_reverse'
- '__evlist__for_each_entry_safe'
- '__for_each_mem_range'
- '__for_each_mem_range_rev'
- '__for_each_thread'
- '__hlist_for_each_rcu'
- '__map__for_each_symbol_by_name'
- '__perf_evlist__for_each_entry'
- '__perf_evlist__for_each_entry_reverse'
- '__perf_evlist__for_each_entry_safe'
- '__rq_for_each_bio'
- '__shost_for_each_device'
- 'apei_estatus_for_each_section' - 'apei_estatus_for_each_section'
- 'ata_for_each_dev' - 'ata_for_each_dev'
- 'ata_for_each_link' - 'ata_for_each_link'
- '__ata_qc_for_each'
- 'ata_qc_for_each' - 'ata_qc_for_each'
- 'ata_qc_for_each_raw' - 'ata_qc_for_each_raw'
- 'ata_qc_for_each_with_internal' - 'ata_qc_for_each_with_internal'
- 'ax25_for_each' - 'ax25_for_each'
- 'ax25_uid_for_each' - 'ax25_uid_for_each'
- '__bio_for_each_bvec'
- 'bio_for_each_bvec' - 'bio_for_each_bvec'
- 'bio_for_each_bvec_all' - 'bio_for_each_bvec_all'
- 'bio_for_each_folio_all'
- 'bio_for_each_integrity_vec' - 'bio_for_each_integrity_vec'
- '__bio_for_each_segment'
- 'bio_for_each_segment' - 'bio_for_each_segment'
- 'bio_for_each_segment_all' - 'bio_for_each_segment_all'
- 'bio_list_for_each' - 'bio_list_for_each'
- 'bip_for_each_vec' - 'bip_for_each_vec'
- 'bitmap_for_each_clear_region'
- 'bitmap_for_each_set_region'
- 'blkg_for_each_descendant_post'
- 'blkg_for_each_descendant_pre'
- 'blk_queue_for_each_rl'
- 'bond_for_each_slave' - 'bond_for_each_slave'
- 'bond_for_each_slave_rcu' - 'bond_for_each_slave_rcu'
- 'bpf__perf_for_each_map'
- 'bpf__perf_for_each_map_named'
- 'bpf_for_each_spilled_reg' - 'bpf_for_each_spilled_reg'
- 'bpf_object__for_each_map'
- 'bpf_object__for_each_program'
- 'bpf_object__for_each_safe'
- 'bpf_perf_object__for_each'
- 'btree_for_each_safe128' - 'btree_for_each_safe128'
- 'btree_for_each_safe32' - 'btree_for_each_safe32'
- 'btree_for_each_safe64' - 'btree_for_each_safe64'
@ -102,6 +119,7 @@ ForEachMacros:
- 'card_for_each_dev' - 'card_for_each_dev'
- 'cgroup_taskset_for_each' - 'cgroup_taskset_for_each'
- 'cgroup_taskset_for_each_leader' - 'cgroup_taskset_for_each_leader'
- 'cpufreq_for_each_efficient_entry_idx'
- 'cpufreq_for_each_entry' - 'cpufreq_for_each_entry'
- 'cpufreq_for_each_entry_idx' - 'cpufreq_for_each_entry_idx'
- 'cpufreq_for_each_valid_entry' - 'cpufreq_for_each_valid_entry'
@ -109,8 +127,22 @@ ForEachMacros:
- 'css_for_each_child' - 'css_for_each_child'
- 'css_for_each_descendant_post' - 'css_for_each_descendant_post'
- 'css_for_each_descendant_pre' - 'css_for_each_descendant_pre'
- 'damon_for_each_region'
- 'damon_for_each_region_safe'
- 'damon_for_each_scheme'
- 'damon_for_each_scheme_safe'
- 'damon_for_each_target'
- 'damon_for_each_target_safe'
- 'data__for_each_file'
- 'data__for_each_file_new'
- 'data__for_each_file_start'
- 'device_for_each_child_node' - 'device_for_each_child_node'
- 'displayid_iter_for_each'
- 'dma_fence_array_for_each'
- 'dma_fence_chain_for_each' - 'dma_fence_chain_for_each'
- 'dma_fence_unwrap_for_each'
- 'dma_resv_for_each_fence'
- 'dma_resv_for_each_fence_unlocked'
- 'do_for_each_ftrace_op' - 'do_for_each_ftrace_op'
- 'drm_atomic_crtc_for_each_plane' - 'drm_atomic_crtc_for_each_plane'
- 'drm_atomic_crtc_state_for_each_plane' - 'drm_atomic_crtc_state_for_each_plane'
@ -122,6 +154,7 @@ ForEachMacros:
- 'drm_for_each_bridge_in_chain' - 'drm_for_each_bridge_in_chain'
- 'drm_for_each_connector_iter' - 'drm_for_each_connector_iter'
- 'drm_for_each_crtc' - 'drm_for_each_crtc'
- 'drm_for_each_crtc_reverse'
- 'drm_for_each_encoder' - 'drm_for_each_encoder'
- 'drm_for_each_encoder_mask' - 'drm_for_each_encoder_mask'
- 'drm_for_each_fb' - 'drm_for_each_fb'
@ -133,14 +166,37 @@ ForEachMacros:
- 'drm_mm_for_each_node' - 'drm_mm_for_each_node'
- 'drm_mm_for_each_node_in_range' - 'drm_mm_for_each_node_in_range'
- 'drm_mm_for_each_node_safe' - 'drm_mm_for_each_node_safe'
- 'dsa_switch_for_each_available_port'
- 'dsa_switch_for_each_cpu_port'
- 'dsa_switch_for_each_port'
- 'dsa_switch_for_each_port_continue_reverse'
- 'dsa_switch_for_each_port_safe'
- 'dsa_switch_for_each_user_port'
- 'dsa_tree_for_each_user_port'
- 'dso__for_each_symbol'
- 'dsos__for_each_with_build_id'
- 'elf_hash_for_each_possible'
- 'elf_section__for_each_rel'
- 'elf_section__for_each_rela'
- 'elf_symtab__for_each_symbol'
- 'evlist__for_each_cpu'
- 'evlist__for_each_entry'
- 'evlist__for_each_entry_continue'
- 'evlist__for_each_entry_from'
- 'evlist__for_each_entry_reverse'
- 'evlist__for_each_entry_safe'
- 'flow_action_for_each' - 'flow_action_for_each'
- 'for_each_acpi_dev_match'
- 'for_each_active_dev_scope' - 'for_each_active_dev_scope'
- 'for_each_active_drhd_unit' - 'for_each_active_drhd_unit'
- 'for_each_active_iommu' - 'for_each_active_iommu'
- 'for_each_aggr_pgid' - 'for_each_aggr_pgid'
- 'for_each_available_child_of_node' - 'for_each_available_child_of_node'
- 'for_each_bench'
- 'for_each_bio' - 'for_each_bio'
- 'for_each_board_func_rsrc' - 'for_each_board_func_rsrc'
- 'for_each_btf_ext_rec'
- 'for_each_btf_ext_sec'
- 'for_each_bvec' - 'for_each_bvec'
- 'for_each_card_auxs' - 'for_each_card_auxs'
- 'for_each_card_auxs_safe' - 'for_each_card_auxs_safe'
@ -156,20 +212,24 @@ ForEachMacros:
- 'for_each_child_of_node' - 'for_each_child_of_node'
- 'for_each_clear_bit' - 'for_each_clear_bit'
- 'for_each_clear_bit_from' - 'for_each_clear_bit_from'
- 'for_each_clear_bitrange'
- 'for_each_clear_bitrange_from'
- 'for_each_cmd'
- 'for_each_cmsghdr' - 'for_each_cmsghdr'
- 'for_each_collection'
- 'for_each_comp_order'
- 'for_each_compatible_node' - 'for_each_compatible_node'
- 'for_each_component_dais' - 'for_each_component_dais'
- 'for_each_component_dais_safe' - 'for_each_component_dais_safe'
- 'for_each_comp_order'
- 'for_each_console' - 'for_each_console'
- 'for_each_cpu' - 'for_each_cpu'
- 'for_each_cpu_and' - 'for_each_cpu_and'
- 'for_each_cpu_not' - 'for_each_cpu_not'
- 'for_each_cpu_wrap' - 'for_each_cpu_wrap'
- 'for_each_dapm_widgets' - 'for_each_dapm_widgets'
- 'for_each_dedup_cand'
- 'for_each_dev_addr' - 'for_each_dev_addr'
- 'for_each_dev_scope' - 'for_each_dev_scope'
- 'for_each_displayid_db'
- 'for_each_dma_cap_mask' - 'for_each_dma_cap_mask'
- 'for_each_dpcm_be' - 'for_each_dpcm_be'
- 'for_each_dpcm_be_rollback' - 'for_each_dpcm_be_rollback'
@ -183,6 +243,8 @@ ForEachMacros:
- 'for_each_element_extid' - 'for_each_element_extid'
- 'for_each_element_id' - 'for_each_element_id'
- 'for_each_endpoint_of_node' - 'for_each_endpoint_of_node'
- 'for_each_event'
- 'for_each_event_tps'
- 'for_each_evictable_lru' - 'for_each_evictable_lru'
- 'for_each_fib6_node_rt_rcu' - 'for_each_fib6_node_rt_rcu'
- 'for_each_fib6_walker_rt' - 'for_each_fib6_walker_rt'
@ -191,31 +253,35 @@ ForEachMacros:
- 'for_each_free_mem_range' - 'for_each_free_mem_range'
- 'for_each_free_mem_range_reverse' - 'for_each_free_mem_range_reverse'
- 'for_each_func_rsrc' - 'for_each_func_rsrc'
- 'for_each_group_evsel'
- 'for_each_group_member'
- 'for_each_hstate' - 'for_each_hstate'
- 'for_each_if' - 'for_each_if'
- 'for_each_inject_fn'
- 'for_each_insn'
- 'for_each_insn_prefix'
- 'for_each_intid'
- 'for_each_iommu' - 'for_each_iommu'
- 'for_each_ip_tunnel_rcu' - 'for_each_ip_tunnel_rcu'
- 'for_each_irq_nr' - 'for_each_irq_nr'
- 'for_each_lang'
- 'for_each_link_codecs' - 'for_each_link_codecs'
- 'for_each_link_cpus' - 'for_each_link_cpus'
- 'for_each_link_platforms' - 'for_each_link_platforms'
- 'for_each_lru' - 'for_each_lru'
- 'for_each_matching_node' - 'for_each_matching_node'
- 'for_each_matching_node_and_match' - 'for_each_matching_node_and_match'
- 'for_each_member'
- 'for_each_mem_region'
- 'for_each_memblock_type'
- 'for_each_memcg_cache_index'
- 'for_each_mem_pfn_range' - 'for_each_mem_pfn_range'
- '__for_each_mem_range'
- 'for_each_mem_range' - 'for_each_mem_range'
- '__for_each_mem_range_rev'
- 'for_each_mem_range_rev' - 'for_each_mem_range_rev'
- 'for_each_mem_region'
- 'for_each_member'
- 'for_each_memory'
- 'for_each_migratetype_order' - 'for_each_migratetype_order'
- 'for_each_msi_entry' - 'for_each_missing_reg'
- 'for_each_msi_entry_safe'
- 'for_each_net' - 'for_each_net'
- 'for_each_net_continue_reverse' - 'for_each_net_continue_reverse'
- 'for_each_net_rcu'
- 'for_each_netdev' - 'for_each_netdev'
- 'for_each_netdev_continue' - 'for_each_netdev_continue'
- 'for_each_netdev_continue_rcu' - 'for_each_netdev_continue_rcu'
@ -225,12 +291,13 @@ ForEachMacros:
- 'for_each_netdev_rcu' - 'for_each_netdev_rcu'
- 'for_each_netdev_reverse' - 'for_each_netdev_reverse'
- 'for_each_netdev_safe' - 'for_each_netdev_safe'
- 'for_each_net_rcu'
- 'for_each_new_connector_in_state' - 'for_each_new_connector_in_state'
- 'for_each_new_crtc_in_state' - 'for_each_new_crtc_in_state'
- 'for_each_new_mst_mgr_in_state' - 'for_each_new_mst_mgr_in_state'
- 'for_each_new_plane_in_state' - 'for_each_new_plane_in_state'
- 'for_each_new_plane_in_state_reverse'
- 'for_each_new_private_obj_in_state' - 'for_each_new_private_obj_in_state'
- 'for_each_new_reg'
- 'for_each_node' - 'for_each_node'
- 'for_each_node_by_name' - 'for_each_node_by_name'
- 'for_each_node_by_type' - 'for_each_node_by_type'
@ -246,20 +313,20 @@ ForEachMacros:
- 'for_each_old_connector_in_state' - 'for_each_old_connector_in_state'
- 'for_each_old_crtc_in_state' - 'for_each_old_crtc_in_state'
- 'for_each_old_mst_mgr_in_state' - 'for_each_old_mst_mgr_in_state'
- 'for_each_old_plane_in_state'
- 'for_each_old_private_obj_in_state'
- 'for_each_oldnew_connector_in_state' - 'for_each_oldnew_connector_in_state'
- 'for_each_oldnew_crtc_in_state' - 'for_each_oldnew_crtc_in_state'
- 'for_each_oldnew_mst_mgr_in_state' - 'for_each_oldnew_mst_mgr_in_state'
- 'for_each_oldnew_plane_in_state' - 'for_each_oldnew_plane_in_state'
- 'for_each_oldnew_plane_in_state_reverse' - 'for_each_oldnew_plane_in_state_reverse'
- 'for_each_oldnew_private_obj_in_state' - 'for_each_oldnew_private_obj_in_state'
- 'for_each_old_plane_in_state'
- 'for_each_old_private_obj_in_state'
- 'for_each_online_cpu' - 'for_each_online_cpu'
- 'for_each_online_node' - 'for_each_online_node'
- 'for_each_online_pgdat' - 'for_each_online_pgdat'
- 'for_each_path'
- 'for_each_pci_bridge' - 'for_each_pci_bridge'
- 'for_each_pci_dev' - 'for_each_pci_dev'
- 'for_each_pci_msi_entry'
- 'for_each_pcm_streams' - 'for_each_pcm_streams'
- 'for_each_physmem_range' - 'for_each_physmem_range'
- 'for_each_populated_zone' - 'for_each_populated_zone'
@ -267,22 +334,33 @@ ForEachMacros:
- 'for_each_present_cpu' - 'for_each_present_cpu'
- 'for_each_prime_number' - 'for_each_prime_number'
- 'for_each_prime_number_from' - 'for_each_prime_number_from'
- 'for_each_probe_cache_entry'
- 'for_each_process' - 'for_each_process'
- 'for_each_process_thread' - 'for_each_process_thread'
- 'for_each_prop_codec_conf'
- 'for_each_prop_dai_codec'
- 'for_each_prop_dai_cpu'
- 'for_each_prop_dlc_codecs'
- 'for_each_prop_dlc_cpus'
- 'for_each_prop_dlc_platforms'
- 'for_each_property_of_node' - 'for_each_property_of_node'
- 'for_each_reg'
- 'for_each_reg_filtered'
- 'for_each_registered_fb' - 'for_each_registered_fb'
- 'for_each_requested_gpio' - 'for_each_requested_gpio'
- 'for_each_requested_gpio_in_range' - 'for_each_requested_gpio_in_range'
- 'for_each_reserved_mem_range' - 'for_each_reserved_mem_range'
- 'for_each_reserved_mem_region' - 'for_each_reserved_mem_region'
- 'for_each_rtd_codec_dais' - 'for_each_rtd_codec_dais'
- 'for_each_rtd_codec_dais_rollback'
- 'for_each_rtd_components' - 'for_each_rtd_components'
- 'for_each_rtd_cpu_dais' - 'for_each_rtd_cpu_dais'
- 'for_each_rtd_cpu_dais_rollback'
- 'for_each_rtd_dais' - 'for_each_rtd_dais'
- 'for_each_script'
- 'for_each_sec'
- 'for_each_set_bit' - 'for_each_set_bit'
- 'for_each_set_bit_from' - 'for_each_set_bit_from'
- 'for_each_set_bitrange'
- 'for_each_set_bitrange_from'
- 'for_each_set_clump8' - 'for_each_set_clump8'
- 'for_each_sg' - 'for_each_sg'
- 'for_each_sg_dma_page' - 'for_each_sg_dma_page'
@ -291,17 +369,25 @@ ForEachMacros:
- 'for_each_sgtable_dma_sg' - 'for_each_sgtable_dma_sg'
- 'for_each_sgtable_page' - 'for_each_sgtable_page'
- 'for_each_sgtable_sg' - 'for_each_sgtable_sg'
- 'for_each_shell_test'
- 'for_each_sibling_event' - 'for_each_sibling_event'
- 'for_each_subelement' - 'for_each_subelement'
- 'for_each_subelement_extid' - 'for_each_subelement_extid'
- 'for_each_subelement_id' - 'for_each_subelement_id'
- '__for_each_thread' - 'for_each_sublist'
- 'for_each_subsystem'
- 'for_each_supported_activate_fn'
- 'for_each_supported_inject_fn'
- 'for_each_test'
- 'for_each_thread' - 'for_each_thread'
- 'for_each_token'
- 'for_each_unicast_dest_pgid' - 'for_each_unicast_dest_pgid'
- 'for_each_vsi'
- 'for_each_wakeup_source' - 'for_each_wakeup_source'
- 'for_each_zone' - 'for_each_zone'
- 'for_each_zone_zonelist' - 'for_each_zone_zonelist'
- 'for_each_zone_zonelist_nodemask' - 'for_each_zone_zonelist_nodemask'
- 'func_for_each_insn'
- 'fwnode_for_each_available_child_node' - 'fwnode_for_each_available_child_node'
- 'fwnode_for_each_child_node' - 'fwnode_for_each_child_node'
- 'fwnode_graph_for_each_endpoint' - 'fwnode_graph_for_each_endpoint'
@ -315,7 +401,13 @@ ForEachMacros:
- 'hash_for_each_possible_safe' - 'hash_for_each_possible_safe'
- 'hash_for_each_rcu' - 'hash_for_each_rcu'
- 'hash_for_each_safe' - 'hash_for_each_safe'
- 'hashmap__for_each_entry'
- 'hashmap__for_each_entry_safe'
- 'hashmap__for_each_key_entry'
- 'hashmap__for_each_key_entry_safe'
- 'hctx_for_each_ctx' - 'hctx_for_each_ctx'
- 'hists__for_each_format'
- 'hists__for_each_sort_list'
- 'hlist_bl_for_each_entry' - 'hlist_bl_for_each_entry'
- 'hlist_bl_for_each_entry_rcu' - 'hlist_bl_for_each_entry_rcu'
- 'hlist_bl_for_each_entry_safe' - 'hlist_bl_for_each_entry_safe'
@ -330,7 +422,7 @@ ForEachMacros:
- 'hlist_for_each_entry_rcu_bh' - 'hlist_for_each_entry_rcu_bh'
- 'hlist_for_each_entry_rcu_notrace' - 'hlist_for_each_entry_rcu_notrace'
- 'hlist_for_each_entry_safe' - 'hlist_for_each_entry_safe'
- '__hlist_for_each_rcu' - 'hlist_for_each_entry_srcu'
- 'hlist_for_each_safe' - 'hlist_for_each_safe'
- 'hlist_nulls_for_each_entry' - 'hlist_nulls_for_each_entry'
- 'hlist_nulls_for_each_entry_from' - 'hlist_nulls_for_each_entry_from'
@ -338,9 +430,6 @@ ForEachMacros:
- 'hlist_nulls_for_each_entry_safe' - 'hlist_nulls_for_each_entry_safe'
- 'i3c_bus_for_each_i2cdev' - 'i3c_bus_for_each_i2cdev'
- 'i3c_bus_for_each_i3cdev' - 'i3c_bus_for_each_i3cdev'
- 'ide_host_for_each_port'
- 'ide_port_for_each_dev'
- 'ide_port_for_each_present_dev'
- 'idr_for_each_entry' - 'idr_for_each_entry'
- 'idr_for_each_entry_continue' - 'idr_for_each_entry_continue'
- 'idr_for_each_entry_continue_ul' - 'idr_for_each_entry_continue_ul'
@ -348,7 +437,12 @@ ForEachMacros:
- 'in_dev_for_each_ifa_rcu' - 'in_dev_for_each_ifa_rcu'
- 'in_dev_for_each_ifa_rtnl' - 'in_dev_for_each_ifa_rtnl'
- 'inet_bind_bucket_for_each' - 'inet_bind_bucket_for_each'
- 'inet_lhash2_for_each_icsk'
- 'inet_lhash2_for_each_icsk_continue'
- 'inet_lhash2_for_each_icsk_rcu' - 'inet_lhash2_for_each_icsk_rcu'
- 'intlist__for_each_entry'
- 'intlist__for_each_entry_safe'
- 'kcore_copy__for_each_phdr'
- 'key_for_each' - 'key_for_each'
- 'key_for_each_safe' - 'key_for_each_safe'
- 'klp_for_each_func' - 'klp_for_each_func'
@ -359,7 +453,9 @@ ForEachMacros:
- 'klp_for_each_object_static' - 'klp_for_each_object_static'
- 'kunit_suite_for_each_test_case' - 'kunit_suite_for_each_test_case'
- 'kvm_for_each_memslot' - 'kvm_for_each_memslot'
- 'kvm_for_each_memslot_in_gfn_range'
- 'kvm_for_each_vcpu' - 'kvm_for_each_vcpu'
- 'libbpf_nla_for_each_attr'
- 'list_for_each' - 'list_for_each'
- 'list_for_each_codec' - 'list_for_each_codec'
- 'list_for_each_codec_safe' - 'list_for_each_codec_safe'
@ -378,6 +474,8 @@ ForEachMacros:
- 'list_for_each_entry_safe_continue' - 'list_for_each_entry_safe_continue'
- 'list_for_each_entry_safe_from' - 'list_for_each_entry_safe_from'
- 'list_for_each_entry_safe_reverse' - 'list_for_each_entry_safe_reverse'
- 'list_for_each_entry_srcu'
- 'list_for_each_from'
- 'list_for_each_prev' - 'list_for_each_prev'
- 'list_for_each_prev_safe' - 'list_for_each_prev_safe'
- 'list_for_each_safe' - 'list_for_each_safe'
@ -385,11 +483,18 @@ ForEachMacros:
- 'llist_for_each_entry' - 'llist_for_each_entry'
- 'llist_for_each_entry_safe' - 'llist_for_each_entry_safe'
- 'llist_for_each_safe' - 'llist_for_each_safe'
- 'map__for_each_symbol'
- 'map__for_each_symbol_by_name'
- 'map_for_each_event'
- 'map_for_each_metric'
- 'maps__for_each_entry'
- 'maps__for_each_entry_safe'
- 'mci_for_each_dimm' - 'mci_for_each_dimm'
- 'media_device_for_each_entity' - 'media_device_for_each_entity'
- 'media_device_for_each_intf' - 'media_device_for_each_intf'
- 'media_device_for_each_link' - 'media_device_for_each_link'
- 'media_device_for_each_pad' - 'media_device_for_each_pad'
- 'msi_for_each_desc'
- 'nanddev_io_for_each_page' - 'nanddev_io_for_each_page'
- 'netdev_for_each_lower_dev' - 'netdev_for_each_lower_dev'
- 'netdev_for_each_lower_private' - 'netdev_for_each_lower_private'
@ -411,7 +516,23 @@ ForEachMacros:
- 'of_property_for_each_string' - 'of_property_for_each_string'
- 'of_property_for_each_u32' - 'of_property_for_each_u32'
- 'pci_bus_for_each_resource' - 'pci_bus_for_each_resource'
- 'pcl_for_each_chunk'
- 'pcl_for_each_segment'
- 'pcm_for_each_format' - 'pcm_for_each_format'
- 'perf_config_items__for_each_entry'
- 'perf_config_sections__for_each_entry'
- 'perf_config_set__for_each_entry'
- 'perf_cpu_map__for_each_cpu'
- 'perf_evlist__for_each_entry'
- 'perf_evlist__for_each_entry_reverse'
- 'perf_evlist__for_each_entry_safe'
- 'perf_evlist__for_each_evsel'
- 'perf_evlist__for_each_mmap'
- 'perf_hpp_list__for_each_format'
- 'perf_hpp_list__for_each_format_safe'
- 'perf_hpp_list__for_each_sort_list'
- 'perf_hpp_list__for_each_sort_list_safe'
- 'perf_pmu__for_each_hybrid_pmu'
- 'ping_portaddr_for_each_entry' - 'ping_portaddr_for_each_entry'
- 'plist_for_each' - 'plist_for_each'
- 'plist_for_each_continue' - 'plist_for_each_continue'
@ -426,10 +547,12 @@ ForEachMacros:
- 'queue_for_each_hw_ctx' - 'queue_for_each_hw_ctx'
- 'radix_tree_for_each_slot' - 'radix_tree_for_each_slot'
- 'radix_tree_for_each_tagged' - 'radix_tree_for_each_tagged'
- 'rb_for_each'
- 'rbtree_postorder_for_each_entry_safe' - 'rbtree_postorder_for_each_entry_safe'
- 'rdma_for_each_block' - 'rdma_for_each_block'
- 'rdma_for_each_port' - 'rdma_for_each_port'
- 'rdma_umem_for_each_dma_block' - 'rdma_umem_for_each_dma_block'
- 'resort_rb__for_each_entry'
- 'resource_list_for_each_entry' - 'resource_list_for_each_entry'
- 'resource_list_for_each_entry_safe' - 'resource_list_for_each_entry_safe'
- 'rhl_for_each_entry_rcu' - 'rhl_for_each_entry_rcu'
@ -443,15 +566,18 @@ ForEachMacros:
- 'rht_for_each_from' - 'rht_for_each_from'
- 'rht_for_each_rcu' - 'rht_for_each_rcu'
- 'rht_for_each_rcu_from' - 'rht_for_each_rcu_from'
- '__rq_for_each_bio'
- 'rq_for_each_bvec' - 'rq_for_each_bvec'
- 'rq_for_each_segment' - 'rq_for_each_segment'
- 'rq_list_for_each'
- 'rq_list_for_each_safe'
- 'scsi_for_each_prot_sg' - 'scsi_for_each_prot_sg'
- 'scsi_for_each_sg' - 'scsi_for_each_sg'
- 'sctp_for_each_hentry' - 'sctp_for_each_hentry'
- 'sctp_skb_for_each' - 'sctp_skb_for_each'
- 'sec_for_each_insn'
- 'sec_for_each_insn_continue'
- 'sec_for_each_insn_from'
- 'shdma_for_each_chan' - 'shdma_for_each_chan'
- '__shost_for_each_device'
- 'shost_for_each_device' - 'shost_for_each_device'
- 'sk_for_each' - 'sk_for_each'
- 'sk_for_each_bound' - 'sk_for_each_bound'
@ -468,7 +594,13 @@ ForEachMacros:
- 'snd_soc_dapm_widget_for_each_path_safe' - 'snd_soc_dapm_widget_for_each_path_safe'
- 'snd_soc_dapm_widget_for_each_sink_path' - 'snd_soc_dapm_widget_for_each_sink_path'
- 'snd_soc_dapm_widget_for_each_source_path' - 'snd_soc_dapm_widget_for_each_source_path'
- 'strlist__for_each_entry'
- 'strlist__for_each_entry_safe'
- 'sym_for_each_insn'
- 'sym_for_each_insn_continue_reverse'
- 'symbols__for_each_entry'
- 'tb_property_for_each' - 'tb_property_for_each'
- 'tcf_act_for_each_action'
- 'tcf_exts_for_each_action' - 'tcf_exts_for_each_action'
- 'udp_portaddr_for_each_entry' - 'udp_portaddr_for_each_entry'
- 'udp_portaddr_for_each_entry_rcu' - 'udp_portaddr_for_each_entry_rcu'
@ -492,15 +624,17 @@ ForEachMacros:
- 'xbc_node_for_each_array_value' - 'xbc_node_for_each_array_value'
- 'xbc_node_for_each_child' - 'xbc_node_for_each_child'
- 'xbc_node_for_each_key_value' - 'xbc_node_for_each_key_value'
- 'xbc_node_for_each_subkey'
- 'zorro_for_each_dev' - 'zorro_for_each_dev'
#IncludeBlocks: Preserve # Unknown to clang-format-5.0 IncludeBlocks: Preserve
IncludeCategories: IncludeCategories:
- Regex: '.*' - Regex: '.*'
Priority: 1 Priority: 1
IncludeIsMainRegex: '(Test)?$' IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false IndentCaseLabels: false
#IndentPPDirectives: None # Unknown to clang-format-5.0 IndentGotoLabels: false
IndentPPDirectives: None
IndentWidth: 8 IndentWidth: 8
IndentWrappedFunctionNames: false IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave JavaScriptQuotes: Leave
@ -510,13 +644,13 @@ MacroBlockBegin: ''
MacroBlockEnd: '' MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1 MaxEmptyLinesToKeep: 1
NamespaceIndentation: None NamespaceIndentation: None
#ObjCBinPackProtocolList: Auto # Unknown to clang-format-5.0 ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 8 ObjCBlockIndentWidth: 8
ObjCSpaceAfterProperty: true ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true ObjCSpaceBeforeProtocolList: true
# Taken from git's rules # Taken from git's rules
#PenaltyBreakAssignment: 10 # Unknown to clang-format-4.0 PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30 PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10 PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0 PenaltyBreakFirstLessLess: 0
@ -527,14 +661,14 @@ PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right PointerAlignment: Right
ReflowComments: false ReflowComments: false
SortIncludes: false SortIncludes: false
#SortUsingDeclarations: false # Unknown to clang-format-4.0 SortUsingDeclarations: false
SpaceAfterCStyleCast: false SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true SpaceBeforeAssignmentOperators: true
#SpaceBeforeCtorInitializerColon: true # Unknown to clang-format-5.0 SpaceBeforeCtorInitializerColon: true
#SpaceBeforeInheritanceColon: true # Unknown to clang-format-5.0 SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements SpaceBeforeParens: ControlStatementsExceptForEachMacros
#SpaceBeforeRangeBasedForLoopColon: true # Unknown to clang-format-5.0 SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1 SpacesBeforeTrailingComments: 1
SpacesInAngles: false SpacesInAngles: false

View File

@ -0,0 +1,55 @@
What: /debug/aufs/si_<id>/
Date: March 2009
Contact: J. R. Okajima <hooanon05g@gmail.com>
Description:
Under /debug/aufs, a directory named si_<id> is created
per aufs mount, where <id> is a unique id generated
internally.
What: /debug/aufs/si_<id>/plink
Date: Apr 2013
Contact: J. R. Okajima <hooanon05g@gmail.com>
Description:
It has three lines and shows the information about the
pseudo-link. The first line is a single number
representing a number of buckets. The second line is a
number of pseudo-links per buckets (separated by a
blank). The last line is a single number representing a
total number of psedo-links.
When the aufs mount option 'noplink' is specified, it
will show "1\n0\n0\n".
What: /debug/aufs/si_<id>/xib
Date: March 2009
Contact: J. R. Okajima <hooanon05g@gmail.com>
Description:
It shows the consumed blocks by xib (External Inode Number
Bitmap), its block size and file size.
When the aufs mount option 'noxino' is specified, it
will be empty. About XINO files, see the aufs manual.
What: /debug/aufs/si_<id>/xi<branch-index>
Date: March 2009
Contact: J. R. Okajima <hooanon05g@gmail.com>
Description:
It shows the consumed blocks by xino (External Inode Number
Translation Table), its link count, block size and file
size.
Due to the file size limit, there may exist multiple
xino files per branch. In this case, "-N" is added to
the filename and it corresponds to the index of the
internal xino array. "-0" is omitted.
When the aufs mount option 'noxino' is specified, Those
entries won't exist. About XINO files, see the aufs
manual.
What: /debug/aufs/si_<id>/xigen
Date: March 2009
Contact: J. R. Okajima <hooanon05g@gmail.com>
Description:
It shows the consumed blocks by xigen (External Inode
Generation Table), its block size and file size.
If CONFIG_AUFS_EXPORT is disabled, this entry will not
be created.
When the aufs mount option 'noxino' is specified, it
will be empty. About XINO files, see the aufs manual.

View File

@ -0,0 +1,31 @@
What: /sys/fs/aufs/si_<id>/
Date: March 2009
Contact: J. R. Okajima <hooanon05g@gmail.com>
Description:
Under /sys/fs/aufs, a directory named si_<id> is created
per aufs mount, where <id> is a unique id generated
internally.
What: /sys/fs/aufs/si_<id>/br<idx>
Date: March 2009
Contact: J. R. Okajima <hooanon05g@gmail.com>
Description:
It shows the abolute path of a member directory (which
is called branch) in aufs, and its permission.
What: /sys/fs/aufs/si_<id>/brid<idx>
Date: July 2013
Contact: J. R. Okajima <hooanon05g@gmail.com>
Description:
It shows the id of a member directory (which is called
branch) in aufs.
What: /sys/fs/aufs/si_<id>/xi_path
Date: March 2009
Contact: J. R. Okajima <hooanon05g@gmail.com>
Description:
It shows the abolute path of XINO (External Inode Number
Bitmap, Translation Table and Generation Table) file
even if it is the default path.
When the aufs mount option 'noxino' is specified, it
will be empty. About XINO files, see the aufs manual.

View File

@ -1,3 +1,46 @@
What: /sys/firmware/acpi/firmware_performance_data/
Date: Aug 2019
Contact: Zhang Rui <rui.zhang@intel.com>
Description:
ACPI Firmware Performance Data Table (FPDT) provides
information for firmware performance data for system boot,
S3 suspend and S3 resume. This sysfs entry contains the
performance data retrieved from the FPDT.
boot_performance:
firmware_start_ns: Timer value logged at the beginning
of firmware image execution. In nanoseconds.
bootloader_load_ns: Timer value logged just prior to
loading the OS boot loader into memory.
In nanoseconds.
bootloader_launch_ns: Timer value logged just prior to
launching the currently loaded OS boot loader
image. In nanoseconds.
exitbootservice_start_ns: Timer value logged at the
point when the OS loader calls the
ExitBootServices function for UEFI compatible
firmware. In nanoseconds.
exitbootservice_end_ns: Timer value logged at the point
just prior to the OS loader gaining control
back from the ExitBootServices function for
UEFI compatible firmware. In nanoseconds.
suspend_performance:
suspend_start_ns: Timer value recorded at the previous
OS write to SLP_TYP upon entry to S3. In
nanoseconds.
suspend_end_ns: Timer value recorded at the previous
firmware write to SLP_TYP used to trigger
hardware entry to S3. In nanoseconds.
resume_performance:
resume_count: A count of the number of S3 resume cycles
since the last full boot sequence.
resume_avg_ns: Average timer value of all resume cycles
logged since the last full boot sequence,
including the most recent resume. In nanoseconds.
resume_prev_ns: Timer recorded at the end of the previous
platform runtime firmware S3 resume, just prior to
handoff to the OS waking vector. In nanoseconds.
What: /sys/firmware/acpi/bgrt/ What: /sys/firmware/acpi/bgrt/
Date: January 2012 Date: January 2012
Contact: Matthew Garrett <mjg@redhat.com> Contact: Matthew Garrett <mjg@redhat.com>

View File

@ -40,6 +40,7 @@ Currently, these files are in /proc/sys/vm:
- extfrag_threshold - extfrag_threshold
- highmem_is_dirtyable - highmem_is_dirtyable
- hugetlb_shm_group - hugetlb_shm_group
- kswapd_threads
- laptop_mode - laptop_mode
- legacy_va_layout - legacy_va_layout
- lowmem_reserve_ratio - lowmem_reserve_ratio
@ -314,6 +315,29 @@ hugetlb_shm_group contains group id that is allowed to create SysV
shared memory segment using hugetlb page. shared memory segment using hugetlb page.
kswapd_threads
==============
Available only when CONFIG_SYNO_MULTI_KSWAPD is set.
kswapd_threads allows you to control the number of kswapd threads per node
running on the system. This provides the ability to devote additional CPU
resources toward proactive page replacement with the goal of reducing
direct reclaims. When direct reclaims are prevented, the CPU consumed
by them is prevented as well. Depending on the workload, the result can
cause aggregate CPU usage on the system to go up, down or stay the same.
More aggressive page replacement can reduce direct reclaims which cause
latency for tasks and decrease throughput when doing filesystem IO through
the pagecache. Direct reclaims are recorded using the allocstall counter
in /proc/vmstat.
The default value is 1 and the range of acceptible values are 1-16.
Always start with lower values in the 2-6 range. Higher values should
be justified with testing. If direct reclaims occur in spite of high
values, the cost of direct reclaims (in latency) that occur can be
higher due to increased lock contention.
laptop_mode laptop_mode
=========== ===========

View File

@ -55,6 +55,20 @@ properties:
- realtek,mjolnir # Realtek Mjolnir EVB - realtek,mjolnir # Realtek Mjolnir EVB
- const: realtek,rtd1619 - const: realtek,rtd1619
#if defined(CONFIG_SYNO_LSP_RTD1619B)
# RTD1319 SoC based boards
- items:
- enum:
- realtek,pym-particles # Realtek Pym Particles EVB
- const: realtek,rtd1319
# RTD1619B SoC based boards
- items:
- enum:
- realtek,bleeding-edge # Realtek Bleeding Edge EVB
- const: realtek,rtd1619b
#endif /* CONFIG_SYNO_LSP_RTD1619B */
additionalProperties: true additionalProperties: true
... ...

View File

@ -0,0 +1,76 @@
Realtek Clock/Reset Controller
==============================
Clock/Reset controllers for Realtek Platform
Platform Controllers
--------------------
These device tree node should be placed in a syscon.
Required properties :
- compatible :
should contain only one of the following:
"realtek,rtd1195-crt-clk" for RTD1195 CRT clock controller,
"realtek,rtd1195-iso-clk" for RTD1195 ISO clock controller,
"realtek,rtd1295-crt-clk" for RTD1295 CRT clock controller,
"realtek,rtd1295-iso-clk" for RTD1295 ISO clock controller,
"realtek,rtd1395-crt-clk" for RTD1395 CRT clock controller,
"realtek,rtd1395-iso-clk" for RTD1395 ISO clock controller,
"realtek,rtd1619-crt-clk" for RTD1619 CRT clock controller,
"realtek,rtd1611-crt-clk" for RTD1611 CRT clock controller,
"realtek,rtd1619-iso-clk" for RTD1619 ISO clock controller,
"realtek,rtd1319-crt-clk" for RTD1319 CRT clock controller,
"realtek,rtd1319-crt-clk-n" for RTD1319 CRT clock controller of non-protected clocks,
"realtek,rtd1311-crt-clk" for RTD1311 CRT clock controller,
"realtek,rtd1319-iso-clk" for RTD1319 ISO clock controller,
"realtek,rtd1619b-crt-clk" for RTD1319 CRT clock controller,
"realtek,rtd1619b-crt-clk-n" for RTD1319 CRT clock controller of non-protected clocks,
"realtek,rtd1619b-iso-clk" for RTD1319 ISO clock controller.
- #clock-cells : should be 1.
- #reset-cells : should be 1.
Example:
syscon@98000000 {
...
cc: clock-controller {
compatible = "realtek,rtd1295-cc";
#clock-cells = <1>;
#reset-cells = <1>;
};
};
consumer {
clocks = <&cc CC_CKE_GSPI>;
};
TEE Clock Controller
--------------------
Required properties :
- compatible :
should contain only one of the following:
"realtek,tee-clock-controller" for TEE Clock Controller
- #clock-cells : should be 0.
Example:
tcc: tee-clocks {
compatible = "realtek,tee-clock-controller";
#clock-cells = <0>;
};
See "clock-bindings.txt"

View File

@ -0,0 +1,57 @@
Realtek Low-speed Analog to Digital Converter
This LSADC has 2 pads with 6-bits resolution for 0 ~ 3.3V.
Required properties:
- compatible: should be one of
"realtek,rtk-lsadc0"
"realtek,rtk-lsadc"
- interrupt-parent: phandle to the parent interrupt controller
see: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
- interrupts: IRQ line for the LSADC
- reg: Offset and length of the LSADC block register set.
- clk_gating_en: clock gating for LSADC is used for power saving.
0: disable
1: enable
- clocks: Clock used for this block.
- resets: phandle to reset this block.
Sub-nodes:
Each LSADC pad is configured as a subnode.
Required properties for subnodes:
- activate: 0:in-activate, 1:activate
- ctrl_mode: 0:voltage mode, 1:current mode
- sw_idx: 0:External input pin 0, 1:External input pin 1
- voltage_threshold: voltage threshold to trigger interrupt
- adc_val_baseline: absolute baseline to reset adc_val
Example node:
lsadc@7900 {
compatible = "realtek,rtk-lsadc0";
interrupt-parent = <&iso_irq_mux>;
interrupts = <3>;
reg = <0x7900 0x200>,
<0x34c 0x4>;
clk_gating_en = <1>;
clocks = <&ic IC_CKE_LSADC_ECOA2>;
resets = <&ic IC_RSTN_LSADC_ECOA2>;
lsadc0-pad0 {
activate = <1>;
ctrl_mode = <0>;
sw_idx = <0>;
voltage_threshold = <32>;
adc_val_baseline = <63>;
};
lsadc0-pad1 {
activate = <0>;
ctrl_mode = <0>;
sw_idx = <1>;
voltage_threshold = <63>;
adc_val_baseline = <63>;
};
};

View File

@ -0,0 +1,18 @@
Realrek Interrupt Controller
Required properties:
- compatible : "realtek,rtd13xx-iso-irq-mux" for rtd1319 SoCs
"realtek,rtd13xx-misc-irq-mux" for rtd1319 SoCs
"realtek,rtd16xxb-iso-irq-mux" for rtd1619b SoCs
"realtek,rtd16xxb-misc-irq-mux" for rtd1619b SoCs
Example:
iso_irq_mux: iso_irq_mux {
compatible = "realtek,rtd13xx-iso-irq-mux";
syscon = <&iso>;
interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
interrupt-controller;
#interrupt-cells = <1>;
};

View File

@ -0,0 +1,54 @@
Anpec APW888X series PMIC DT-bindings
Required properties:
* compatible: shall contains one of the following
"anpec,apw8889",
"anpec,apw8886", or
"anpec,apw7899".
=====================================
Anpec APW888X serise PMIC contains the following sub devices:
g22xx-powerkey,
apw8889-regulator for Anpec APW8889,
apw8886-regulator for Anper APW8886.
Sub nodes:
regulators
----------
Required properties:
* compatible: shall contains one of the following
"anpec,apw8889-regulator",
"anpec,apw8886-regulator".
See also Documentation/devicetree/bindings/regulator/regulator.txt.
Properties for sub nodes
Optional properties:
* apw888x-discharge-disable: disable discharge when suspend state is configured
to regulator-off-in-suspend in the sub nodes
regulator-state-mem/regulator-state-coldboot.
Example:
&i2c_0 {
status = "okay";
apw8889: apw8889@12 {
compatible = "anpec,apw8889";
reg = <0x12>;
status = "okay";
regulators: regulators {
compatible = "anpec,apw8889-regulator";
status = "okay";
};
};
};

View File

@ -49,7 +49,11 @@ properties:
description: description:
Reference to an nvmem node for the MAC address Reference to an nvmem node for the MAC address
#if defined(CONFIG_SYNO_LSP_RTD1619B)
nvmem-cells-names:
#else /* CONFIG_SYNO_LSP_RTD1619B */
nvmem-cell-names: nvmem-cell-names:
#endif /* CONFIG_SYNO_LSP_RTD1619B */
const: mac-address const: mac-address
phy-connection-type: phy-connection-type:

View File

@ -0,0 +1,56 @@
Realtek r8169soc Ethernet driver
Required properties:
- compatible: should be one of below strings
"realtek,rtd119x-r8169soc" for Phoenix (RTD1195) SoC
"realtek,rtd129x-r8169soc" for Kylin (RTD1293, RTD1295, RTD1296) SoC
"realtek,rtd139x-r8169soc" for Hercules (RTD1395) SoC
"realtek,rtd16xx-r8169soc" for Thor (RTD1619) SoC
"realtek,rtd13xx-r8169soc" for Hank (RTD1319) SoC
"realtek,rtd16xxb-r8169soc" for Stark (RTD1619B) SoC
- reg: Address and length of the register set for the device
- interrupts: Should contain the MAC interrupts
- pinctrl-names: names of pinmux set of corresponding output mode
- pinctrl-0: the default pinmux set
- local-mac-address: See ethernet-controller.yaml in the same directory.
This property is overwrited by bootloader.
- output-mode: 0:embedded PHY (default),
1:RGMII to MAC (valid for RTD1295, and RTD1319),
2:RGMII to PHY (valid for RTD1319),
3:SGMII to MAC (valid for RTD1395, and RTD1619),
4:SGMII to PHY (valid for RTD1395, and RTD1619),
5:RMII (valid for RTD1319),
6:forced link (valid for RTD1319)
- acp: support ACP (Accelerator Coherence Port) or not
- eee: support EEE (Energy-Efficient Ethernet) or not
- clocks: Must contain a handle for each entry in clock-names.
- clock-names: The name of the clock listed in the clocks property.
- resets: Must contain a handle for each entry in reset-names.
- reset-names: The name of the reset listed in the resets property.
Optional properties:
- bypass: valid for RTD1395
1: ETN MAC bypasses efuse update flow. SW needs to take this sequence.
0: ETN MAC sets efuse update and efuse_rdy setting
- wol-enable: enable WoL or not
BIT 0: WoL enable
BIT 1: CRC match (up to 16 match patterns)
BIT 2: WPD (Wake Packet Detection)
- led-cfg: customized LED setting
- pinctrl-1: the extra pinmux set of of corresponding output mode
- ext-phy-id: 0 ~ 31, only valid when output-mode = "SGMII to PHY"
- sgmii-swing: 0:640mV, 1:380mV, 2:250mV, 3:190mV,
only valid when output-mode = "SGMII to MAC" or "SGMII to PHY"
- voltage: 1:1.8V, 2:2.5V, 3: 3.3V;
only valid when output-mode = "RGMII to MAC", "RGMII to PHY", or "RMII"
- tx-delay: 0:0ns, 1:2ns;
only valid when output-mode = "RGMII to MAC", "RGMII to PHY", or "RMII"
- rx-delay: 0:0ns, 1:2ns;
only valid when output-mode = "RGMII to MAC", "RGMII to PHY", or "RMII"
- force-Gb-off: disable gigabit feature if defined
- wake-mask[0-15]: pattern mask of a packet (for WoL via CRC match)
- wake-crc[0-15]: CRC value of a masked packet (for WoL via CRC match)
- wake-mask[0-31]: pattern mask of a packet (for WoL via exactly pattern match)
- wake-crc[0-31]: CRC value of a masked packet (for WoL via exactly pattern match)
- wake-pattern[0-31]: pattern content for corresponding masked bytes (for WoL via exactly pattern match)
- wake-offset[0-31]: start offset of pattern (for WoL via exactly pattern match)

View File

@ -0,0 +1,12 @@
Realtek eFuse DT-bindings
=========================
See also 'Documentation/devicetree/bindings/nvmem/nvmem.txt'
Requried properties :
- compatible : shall contain one of the followings :
"realtek,efuse",
"realtek,rtd1619-otp"
Optional properties:
- realtek,sb2-lock : a hw lock for synchronization

View File

@ -0,0 +1,29 @@
Simple Regmap Poweroff
======================
This is a simple regmap poweroff driver, which gets regmap from the parent
device and sets a register with value.
Required properties:
- compatible: should contain "regmap-poweroff"
- poweroff,offset: offset in the register map for the poweroff register
- poweroff,mask: the mask written to the poweroff register
- poweroff,value the value written to the poweroff register
Optional properties:
- system-power-controller: to indicate pm_power_off is set by this device.
See also ../power-controller.txt
Examples:
parent {
poweroff {
compatible = "regmap-poweroff";
poweroff,offset = <0x04>;
poweroff,mask = <0x80>;
poweroff,value = <0x80>
system-power-controller;
};
};

View File

@ -0,0 +1,15 @@
Realtek reboot mode driver
Required propertise:
- compatible: should contain "realtek,reboot-mode".
- reg: register to fill reboot command
Exmaple:
reboot-mode {
compatible = "realtek,reboot-mode";
reg = <0x0 0x98007640 0x0 0x4>;
status = "okay";
};

View File

@ -0,0 +1,20 @@
Realtek reboot driver
Required properties:
- compatible: should be "realtek,reboot"
Optional properties:
- rst-oe: an unsigned int for value of oe to be configured
- rst-oe-for-init: an unsigned int for init value of oe
Example:
reboot {
compatible = "realtek,reboot";
rst-oe = <0>;
rst-oe-for-init = <1>;
status = "okay";
};

View File

@ -0,0 +1,19 @@
Realtek PWM controller
This PWM controller provides 4 PWM outputs as sub-nodes and each one can be
enabled individually.
Required properties:
- compatible: should be one of below strings
"realtek,rtk-pwm" for PWM V1 mode (rtd129x, rtd139x, rtd16xx, rtd13xx, rtd16xxb)
"realtek,rtk-pwm-v2" for PWM V2 mode (rtd1312c)
- #pwm-cells: should be 2. See pwm.yaml in this directory for a description
of the cells format
- reg: physical base address and length for this controller
Required properties of each sub-node:
- enable: turn on/off this PWM output
- clkout_div: PWM output clock divisor.
- clksrc_div: PWM clock source divisor.
- duty_rate: crest-to-trough ratio of this PWM output

View File

@ -0,0 +1,4 @@
* Realtek DHC platforms reserved-memory binding
- compatible:
compatible = "ringbuf", "audio_heap", "media_heap";

View File

@ -0,0 +1,14 @@
Realtek Reset Controller DT-bindings
------------------------------------
1. M2TMX reset controller
Required properties
- compatible: shall contain
"realtek,rtd1319-m2tmx-reset".
- #reset-cells: shall be 1.
- realtek,m2tmx: shall contain a phandle to m2tmx syscon

View File

@ -0,0 +1,24 @@
Realtek real time clock driver dt-bindings
==========================================
Required properties:
- compatible: must contains one of the following
"realtek,rtd1195-rtc",
"realtek,rtd1295-rtc",
"realtek,rtd1619-rtc",
"realtek,rtd1319-rtc".
- reg: contain the base of rtc register
- realtek,iso: a phandle to iso syscon
Optional properties:
- clocks: only required by rtd1195-rtc and rtd1295-rtc
- resets: only required by rtd1195-rtc
- rtc-base-year: should contain a integer for base year
- rtc-bias: should contain a integer for bias

View File

@ -0,0 +1,8 @@
Realtek Software-emulated Real-time Clock Driver DT-bindings
============================================================
Required properties:
* compatible: shoull be "realtek,emulated-rtc".

View File

@ -0,0 +1,58 @@
Realtek BSV Controller for CPU DVFS dt-bindings
===============================================
Required properties:
- compatible: should be "realtek,bsv-controller".
- #clock-cells: should be 0.
- clocks: cpu clock
- cpu-supply: cpu supply
- nvmem-cells: bsv data in otp
- nvmem-cell-names: should be "bsv"
See regulator/regulator.yaml for regulator bindings.
Example:
/ {
bsvc: bsv-ctrl {
compatible = "realtek,bsv-controller";
#clock-cells = <0>;
regulator-name = "bsv_cpudvs";
regulator-min-microvolt = <750000>;
regulator-max-microvolt = <1200000>;
regulator-boot-on;
regulator-always-on;
clocks = <&cc RTD1619B_CRT_PLL_SCPU>;
cpu-supply = <&cpu_supp>;
nvmem-cells = <&otp_bsv>;
nvmem-cell-names = "bsv";
};
};
&cpu0 {
clocks = <&bsvc>;
cpu-supply = <&bsvc>;
};
&cpu1 {
clocks = <&bsvc>;
cpu-supply = <&bsvc>;
};
&cpu2 {
clocks = <&bsvc>;
cpu-supply = <&bsvc>;
};
&cpu3 {
clocks = <&bsvc>;
cpu-supply = <&bsvc>;
};

View File

@ -0,0 +1,24 @@
Realtek CRT Driver DT-binding document
======================================
Required properties:
- compatible: should contain "syscon", "simple-mfd" and one of the following,
"realtek,rtd1295-crt",
"realtek,rtd1395-crt",
"realtek,rtd1619-crt",
"realtek,rtd1319-crt".
- reg: address of CRT.
Example:
crt: crt@98000000 {
reg = <0x0 0x98000000 0x0 0x1000>;
compatible = "realtek,rtd1319-crt", "syscon", "simple-mfd";
ranges = <0x0 0x0 0x0 0x98000000 0x0 0x1000>;
#address-cells = <2>;
#size-cells = <2>;
};

View File

@ -0,0 +1,42 @@
Realtek Dbus (DC-SYS) PMU dt-bindings
=====================================
Required properties:
- compatible:
"realtek,rtd-16xxb-dbus-pmu" for rtd16xxb family
- reg: address range of Dbus PMU
Performance Counters Subnode
----------------------------
Each subnode of Dbus PMU represents a set of PMC groups which has its own
counter groups and controlling mechanism, but will be enabled and disabled
together with Dbus PMU.
Required properties:
- compatible:
"dbus-sysh"
"dbus-sys"
"dbus-ch"
Optional properties:
- nr_defects: the number of counters which may work incorrectly
- defects: array of the index of problematic counters
Example:
dbus-pmu: rtk-dbus-pmu@8000 {
compatible = "realtek,rtk-16xxb-dbus-pmu";
#address-cells = <1>;
#size-cells = <1>;
reg = <0x0 0x8000 0x0 0x0d00>;
dbus-sysh: dbus-sysh {
nr_defects = <2>;
defects = <1 3>;
};
dbus-sys: dbus-sys {
nr_defects = <1>;
defects = <0>;
};
};

View File

@ -0,0 +1,36 @@
Realtek DDRC PMU dt-bindings
============================
Required properties:
- compatible:
"realtek,rtd-16xxb-ddrc-pmu" for rtd16xxb family
- reg: address range of DDRC PMU
Performance Counters Subnode
----------------------------
Each subnode of Dbus PMU represents a set of PMC groups which has its own
counter groups and controlling mechanism, but will be enabled and disabled
together with Dbus PMU.
Required properties:
- compatible:
"ddrc-"
"ddrc-total"
Optional properties:
- nr_defects: the number of counters which may work incorrectly
- defects: array of the index of problematic counters
Example:
ddrc-pmu: rtk-ddrc-pmu@94000 {
compatible = "realtek,rtk-16xxb-ddrc-pmu";
#address-cells = <1>;
#size-cells = <1>;
reg = <0x0 0x94000 0x0 0x0800>;
ddrc: ddrc {
nr_defects = <2>;
defects = <1 3>;
};
};

View File

@ -0,0 +1,16 @@
Realtek Information provider DT-bindings
========================================
1. pll
required properties:
* compatible: should be one of the followings:
"realtek,rtd139x-pll-info", or
"realtek,rtd161x-pll-info", or
"realtek,rtd161xb-pll-info".
* realtek,crt: a phandle to crt syscon.
* realtek,scpu-wrapper: a phandle to scpu wrapper syscon.

View File

@ -0,0 +1,14 @@
Realtek Power Domain DT-bindings
================================
required propertise:
- compatible : shall contain the one of followings :
"realtek,rtd1295-power",
"realtek,rtd1395-power",
"realtek,rtd1619-power",
"realtek,rtd1319-power",
"realtek,rtd1619b-power".
- #power-domain-cells : shall contain unsigned int 1

View File

@ -0,0 +1,16 @@
Realtek Rbus PMU dt-bindings
============================
Required properties:
- compatible:
"realtek,rtd-16xxb-rbus-pmu" for rtd16xxb family
- reg: Address range of Rbus PMU
Example:
rbus-pmu: rtk-rbus-pmu@1af00 {
compatible = "realtek,rtk-16xxb-rbus-pmu";
#address-cells = <1>;
#size-cells = <1>;
reg = <0x0 0x1af00 0x0 0x0080>;
};

View File

@ -0,0 +1,16 @@
Realtek Watchdog Status Driver DT-bindings
==========================================
Required properties:
- reg: address and size of the device.
- compatible: shall be "realtek,rtd1619b-watchdog-status".
Example:
watchdog5: watchdog-st@aa0 {
reg = <0xaa0 0x20>;
compatible = "realtek,rtd1619b-watchdog-status";
};

View File

@ -0,0 +1,27 @@
Realtek Sound Pinmux Driver.
Required properties:
- compatible : "adc"
"analog-in"
"adc-amic"
"earc-combo"
"realtek,audio-in"
"realtek,audio-out"
"realtek,audio"
- reg : The register base for the controller.
- interrupts : One interrupt, used by the controller.
- #address-cells : <1>, as required by generic sound device binding.
- #size-cells : <0>, also as required by generic sound device binding.
- pinctrl-names : Names of pinmux set of corresponding output mode.
- pinctrl-0 : The default pinmux set.
- num-chipselect : The number of chipselects. It should be 1.
- bus-num : The bus number of this sound device controller.
- clock-frequency : The max. frequency of this sound device controller.
- clocks : phandles for the clocks
- resets : phandles for the resets
Child nodes as per the generic sound device binding.
Example:

View File

@ -0,0 +1,27 @@
Realtek ALSA Driver.
Required properties:
- compatible : "realtek,rtk-alsa-pcm"
- reg : The register base for the clock enable.
- interrupts : One interrupt, used by the controller.
- #address-cells : <1>, as required by generic alsa binding.
- #size-cells : <0>, also as required by generic alsa binding.
- pinctrl-names : Names of pinmux set of corresponding output mode.
- pinctrl-0 : The default pinmux set.
- num-chipselect : The number of chipselects. It should be 1.
- bus-num : The bus number of this alsa controller.
- clock-frequency : The max. frequency of this alsa controller.
- clocks : phandles for the clocks
- resets : phandles for the resets
Child nodes as per the generic alsa binding.
Example:
sound: sound@10 {
compatible = "realtek,rtk-alsa-pcm";
reg = <0x10 0x1000>; /* CLK_EN2 */
realtek,refclk = <&refclk>;
status = "okay";
};

View File

@ -0,0 +1,38 @@
Realtek Synchronous Serial Interface based on DesignWare SPI core.
Required properties:
- compatible : "realtek,rtk-dw-apb-ssi"
- reg : The register base for the controller.
The 1st one is for DW SPI core, and the 2nd one is for wrapper.
- interrupts : One interrupt, used by the controller.
- #address-cells : <1>, as required by generic SPI binding.
- #size-cells : <0>, also as required by generic SPI binding.
- pinctrl-names : Names of pinmux set of corresponding output mode.
- pinctrl-0 : The default pinmux set.
- num-chipselect : The number of chipselects. It should be 1.
- bus-num : The bus number of this SPI controller.
- clock-frequency : The max. frequency of this SPI controller.
- clocks : phandles for the clocks
- resets : phandles for the resets
Child nodes as per the generic SPI binding.
Example:
spi_0: spi@1BD00 {
compatible = "realtek,rtk-dw-apb-ssi";
#address-cells = <1>;
#size-cells = <0>;
interrupt-parent = <&misc_irq_mux>;
interrupts = <27>; /* SPI_INT */
reg = <0x1BD00 0x100>, /* DW SPI */
<0x1B300 0x18>; /* SPI wrapper */
pinctrl-names = "default";
pinctrl-0 = <&gspi_pins_0>;
num-chipselect = <1>;
bus-num = <0>;
clocks = <&cc CC_CKE_GSPI>;
clock-frequency = <256000000>;
resets = <&cc CC_RSTN_GSPI>;
};

View File

@ -0,0 +1,41 @@
Realtek Thermal Driver DT-bindings
==================================
* Sensor node
-------------
Required properties :
- compatible : shall contain one of the following :
"realtek,rtd119x-thermal-sensor",
"realtek,rtd129x-thermal-sensor",
"realtek,rtd139x-thermal-sensor",
"realtek,rtd161x-thermal-sensor",
"realtek,rtd131x-thermal-sensor",
"realtek,rtd1619b-thermal-sensor",
"realtek,rtd1312c-thermal-sensor".
- #thermal-sensor-cells : shall contain 0.
Optional properties:
- eoh-restore-ms: shall contain a interger, lock-freq time in ms for eoh,
only vaild if eoh configured.
See also 'Documentation/devicetree/bindings/thermal/thermal.txt'
Exmaple :
cpu-tsensor {
tible = "realtek,rtd129x-thermal-sensor";
reg = <0x9801D150 0x1C>;
#thermal-sensor-cells = <0>;
status = "okay";
};
* CPU Core cooling
------------------
Required properties :
- compatible : should be "realtek,cpu-core-cooling"
- #cooling-cells : should be 2

View File

@ -0,0 +1,30 @@
Realtek watchdog DT-bindings
============================
Required properties:
- compatible : should be "realtek,watchdog".
- reg : should contains 1 or 2 base physical address and size of registers
the first address/size is for watchdog registers,
the second address/size is optional and for watchdog ov-rstb registers.
Optional properties:
- timeout-sec: contains the watchdog timeout in seconds
- restart_priority: contains a value for restart_priority
- ov-rstb-oe-init: initial value of ov-rstb-oe
- ov-rstb-oe: value of ov-rstb-oe to be set during reboot
Example:
watchdog@10000000 {
compatible = "realtek,watchdog";
reg = <0x10000000 0x100>;
timeout-sec = <20>;
};

View File

@ -0,0 +1,401 @@
Aufs5 -- advanced multi layered unification filesystem version 5.x
http://aufs.sf.net
Junjiro R. Okajima
0. Introduction
----------------------------------------
In the early days, aufs was entirely re-designed and re-implemented
Unionfs Version 1.x series. Adding many original ideas, approaches,
improvements and implementations, it became totally different from
Unionfs while keeping the basic features.
Later, Unionfs Version 2.x series began taking some of the same
approaches to aufs1's.
Unionfs was being developed by Professor Erez Zadok at Stony Brook
University and his team.
Aufs5 supports linux-v5.0 and later, If you want older kernel version
support,
- for linux-v4.x series, try aufs4-linux.git or aufs4-standalone.git
- for linux-v3.x series, try aufs3-linux.git or aufs3-standalone.git
- for linux-v2.6.16 and later, try aufs2-2.6.git, aufs2-standalone.git
or aufs1 from CVS on SourceForge.
Note: it becomes clear that "Aufs was rejected. Let's give it up."
According to Christoph Hellwig, linux rejects all union-type
filesystems but UnionMount.
<http://marc.info/?l=linux-kernel&m=123938533724484&w=2>
PS. Al Viro seems have a plan to merge aufs as well as overlayfs and
UnionMount, and he pointed out an issue around a directory mutex
lock and aufs addressed it. But it is still unsure whether aufs will
be merged (or any other union solution).
<http://marc.info/?l=linux-kernel&m=136312705029295&w=1>
1. Features
----------------------------------------
- unite several directories into a single virtual filesystem. The member
directory is called as a branch.
- you can specify the permission flags to the branch, which are 'readonly',
'readwrite' and 'whiteout-able.'
- by upper writable branch, internal copyup and whiteout, files/dirs on
readonly branch are modifiable logically.
- dynamic branch manipulation, add, del.
- etc...
Also there are many enhancements in aufs, such as:
- test only the highest one for the directory permission (dirperm1)
- copyup on open (coo=)
- 'move' policy for copy-up between two writable branches, after
checking free space.
- xattr, acl
- readdir(3) in userspace.
- keep inode number by external inode number table
- keep the timestamps of file/dir in internal copyup operation
- seekable directory, supporting NFS readdir.
- whiteout is hardlinked in order to reduce the consumption of inodes
on branch
- do not copyup, nor create a whiteout when it is unnecessary
- revert a single systemcall when an error occurs in aufs
- remount interface instead of ioctl
- maintain /etc/mtab by an external command, /sbin/mount.aufs.
- loopback mounted filesystem as a branch
- kernel thread for removing the dir who has a plenty of whiteouts
- support copyup sparse file (a file which has a 'hole' in it)
- default permission flags for branches
- selectable permission flags for ro branch, whether whiteout can
exist or not
- export via NFS.
- support <sysfs>/fs/aufs and <debugfs>/aufs.
- support multiple writable branches, some policies to select one
among multiple writable branches.
- a new semantics for link(2) and rename(2) to support multiple
writable branches.
- no glibc changes are required.
- pseudo hardlink (hardlink over branches)
- allow a direct access manually to a file on branch, e.g. bypassing aufs.
including NFS or remote filesystem branch.
- userspace wrapper for pathconf(3)/fpathconf(3) with _PC_LINK_MAX.
- and more...
Currently these features are dropped temporary from aufs5.
See design/08plan.txt in detail.
- nested mount, i.e. aufs as readonly no-whiteout branch of another aufs
(robr)
- statistics of aufs thread (/sys/fs/aufs/stat)
Features or just an idea in the future (see also design/*.txt),
- reorder the branch index without del/re-add.
- permanent xino files for NFSD
- an option for refreshing the opened files after add/del branches
- light version, without branch manipulation. (unnecessary?)
- copyup in userspace
- inotify in userspace
- readv/writev
2. Download
----------------------------------------
There are three GIT trees for aufs5, aufs5-linux.git,
aufs5-standalone.git, and aufs-util.git. Note that there is no "5" in
"aufs-util.git."
While the aufs-util is always necessary, you need either of aufs5-linux
or aufs5-standalone.
The aufs5-linux tree includes the whole linux mainline GIT tree,
git://git.kernel.org/.../torvalds/linux.git.
And you cannot select CONFIG_AUFS_FS=m for this version, eg. you cannot
build aufs5 as an external kernel module.
Several extra patches are not included in this tree. Only
aufs5-standalone tree contains them. They are described in the later
section "Configuration and Compilation."
On the other hand, the aufs5-standalone tree has only aufs source files
and necessary patches, and you can select CONFIG_AUFS_FS=m.
But you need to apply all aufs patches manually.
You will find GIT branches whose name is in form of "aufs5.x" where "x"
represents the linux kernel version, "linux-5.x". For instance,
"aufs5.0" is for linux-5.0. For latest "linux-5.x-rcN", use
"aufs5.x-rcN" branch.
o aufs5-linux tree
$ git clone --reference /your/linux/git/tree \
git://github.com/sfjro/aufs5-linux.git aufs5-linux.git
- if you don't have linux GIT tree, then remove "--reference ..."
$ cd aufs5-linux.git
$ git checkout origin/aufs5.0
Or You may want to directly git-pull aufs into your linux GIT tree, and
leave the patch-work to GIT.
$ cd /your/linux/git/tree
$ git remote add aufs5 git://github.com/sfjro/aufs5-linux.git
$ git fetch aufs5
$ git checkout -b my5.0 v5.0
$ (add your local change...)
$ git pull aufs5 aufs5.0
- now you have v5.0 + your_changes + aufs5.0 in you my5.0 branch.
- you may need to solve some conflicts between your_changes and
aufs5.0. in this case, git-rerere is recommended so that you can
solve the similar conflicts automatically when you upgrade to 5.1 or
later in the future.
o aufs5-standalone tree
$ git clone git://github.com/sfjro/aufs5-standalone.git aufs5-standalone.git
$ cd aufs5-standalone.git
$ git checkout origin/aufs5.0
o aufs-util tree
$ git clone git://git.code.sf.net/p/aufs/aufs-util aufs-util.git
- note that the public aufs-util.git is on SourceForge instead of
GitHUB.
$ cd aufs-util.git
$ git checkout origin/aufs5.0
Note: The 5.x-rcN branch is to be used with `rc' kernel versions ONLY.
The minor version number, 'x' in '5.x', of aufs may not always
follow the minor version number of the kernel.
Because changes in the kernel that cause the use of a new
minor version number do not always require changes to aufs-util.
Since aufs-util has its own minor version number, you may not be
able to find a GIT branch in aufs-util for your kernel's
exact minor version number.
In this case, you should git-checkout the branch for the
nearest lower number.
For (an unreleased) example:
If you are using "linux-5.10" and the "aufs5.10" branch
does not exist in aufs-util repository, then "aufs5.9", "aufs5.8"
or something numerically smaller is the branch for your kernel.
Also you can view all branches by
$ git branch -a
3. Configuration and Compilation
----------------------------------------
Make sure you have git-checkout'ed the correct branch.
For aufs5-linux tree,
- enable CONFIG_AUFS_FS.
- set other aufs configurations if necessary.
For aufs5-standalone tree,
There are several ways to build.
1.
- apply ./aufs5-kbuild.patch to your kernel source files.
- apply ./aufs5-base.patch too.
- apply ./aufs5-mmap.patch too.
- apply ./aufs5-standalone.patch too, if you have a plan to set
CONFIG_AUFS_FS=m. otherwise you don't need ./aufs5-standalone.patch.
- copy ./{Documentation,fs,include/uapi/linux/aufs_type.h} files to your
kernel source tree. Never copy $PWD/include/uapi/linux/Kbuild.
- enable CONFIG_AUFS_FS, you can select either
=m or =y.
- and build your kernel as usual.
- install the built kernel.
- install the header files too by "make headers_install" to the
directory where you specify. By default, it is $PWD/usr.
"make help" shows a brief note for headers_install.
- and reboot your system.
2.
- module only (CONFIG_AUFS_FS=m).
- apply ./aufs5-base.patch to your kernel source files.
- apply ./aufs5-mmap.patch too.
- apply ./aufs5-standalone.patch too.
- build your kernel, don't forget "make headers_install", and reboot.
- edit ./config.mk and set other aufs configurations if necessary.
Note: You should read $PWD/fs/aufs/Kconfig carefully which describes
every aufs configurations.
- build the module by simple "make".
- you can specify ${KDIR} make variable which points to your kernel
source tree.
- install the files
+ run "make install" to install the aufs module, or copy the built
$PWD/aufs.ko to /lib/modules/... and run depmod -a (or reboot simply).
+ run "make install_headers" (instead of headers_install) to install
the modified aufs header file (you can specify DESTDIR which is
available in aufs standalone version's Makefile only), or copy
$PWD/usr/include/linux/aufs_type.h to /usr/include/linux or wherever
you like manually. By default, the target directory is $PWD/usr.
- no need to apply aufs5-kbuild.patch, nor copying source files to your
kernel source tree.
Note: The header file aufs_type.h is necessary to build aufs-util
as well as "make headers_install" in the kernel source tree.
headers_install is subject to be forgotten, but it is essentially
necessary, not only for building aufs-util.
You may not meet problems without headers_install in some older
version though.
And then,
- read README in aufs-util, build and install it
- note that your distribution may contain an obsoleted version of
aufs_type.h in /usr/include/linux or something. When you build aufs
utilities, make sure that your compiler refers the correct aufs header
file which is built by "make headers_install."
- if you want to use readdir(3) in userspace or pathconf(3) wrapper,
then run "make install_ulib" too. And refer to the aufs manual in
detail.
There several other patches in aufs5-standalone.git. They are all
optional. When you meet some problems, they will help you.
- aufs5-loopback.patch
Supports a nested loopback mount in a branch-fs. This patch is
unnecessary until aufs produces a message like "you may want to try
another patch for loopback file".
- proc_mounts.patch
When there are many mountpoints and many mount(2)/umount(2) are
running, then /proc/mounts may not show the all mountpoints. This
patch makes /proc/mounts always show the full mountpoints list.
If you don't want to apply this patch and meet such problem, then you
need to increase the value of 'ProcMounts_Times' make-variable in
aufs-util.git as a second best solution.
- vfs-ino.patch
Modifies a system global kernel internal function get_next_ino() in
order to stop assigning 0 for an inode-number. Not directly related to
aufs, but recommended generally.
- tmpfs-idr.patch
Keeps the tmpfs inode number as the lowest value. Effective to reduce
the size of aufs XINO files for tmpfs branch. Also it prevents the
duplication of inode number, which is important for backup tools and
other utilities. When you find aufs XINO files for tmpfs branch
growing too much, try this patch.
- lockdep-debug.patch
Because aufs is not only an ordinary filesystem (callee of VFS), but
also a caller of VFS functions for branch filesystems, subclassing of
the internal locks for LOCKDEP is necessary. LOCKDEP is a debugging
feature of linux kernel. If you enable CONFIG_LOCKDEP, then you will
need to apply this debug patch to expand several constant values.
If you don't know what LOCKDEP is, then you don't have apply this
patch.
4. Usage
----------------------------------------
At first, make sure aufs-util are installed, and please read the aufs
manual, aufs.5 in aufs-util.git tree.
$ man -l aufs.5
And then,
$ mkdir /tmp/rw /tmp/aufs
# mount -t aufs -o br=/tmp/rw:${HOME} none /tmp/aufs
Here is another example. The result is equivalent.
# mount -t aufs -o br=/tmp/rw=rw:${HOME}=ro none /tmp/aufs
Or
# mount -t aufs -o br:/tmp/rw none /tmp/aufs
# mount -o remount,append:${HOME} /tmp/aufs
Then, you can see whole tree of your home dir through /tmp/aufs. If
you modify a file under /tmp/aufs, the one on your home directory is
not affected, instead the same named file will be newly created under
/tmp/rw. And all of your modification to a file will be applied to
the one under /tmp/rw. This is called the file based Copy on Write
(COW) method.
Aufs mount options are described in aufs.5.
If you run chroot or something and make your aufs as a root directory,
then you need to customize the shutdown script. See the aufs manual in
detail.
Additionally, there are some sample usages of aufs which are a
diskless system with network booting, and LiveCD over NFS.
See sample dir in CVS tree on SourceForge.
5. Contact
----------------------------------------
When you have any problems or strange behaviour in aufs, please let me
know with:
- /proc/mounts (instead of the output of mount(8))
- /sys/module/aufs/*
- /sys/fs/aufs/* (if you have them)
- /debug/aufs/* (if you have them)
- linux kernel version
if your kernel is not plain, for example modified by distributor,
the url where i can download its source is necessary too.
- aufs version which was printed at loading the module or booting the
system, instead of the date you downloaded.
- configuration (define/undefine CONFIG_AUFS_xxx)
- kernel configuration or /proc/config.gz (if you have it)
- LSM (linux security module, if you are using)
- behaviour which you think to be incorrect
- actual operation, reproducible one is better
- mailto: aufs-users at lists.sourceforge.net
Usually, I don't watch the Public Areas(Bugs, Support Requests, Patches,
and Feature Requests) on SourceForge. Please join and write to
aufs-users ML.
6. Acknowledgements
----------------------------------------
Thanks to everyone who have tried and are using aufs, whoever
have reported a bug or any feedback.
Especially donators:
Tomas Matejicek(slax.org) made a donation (much more than once).
Since Apr 2010, Tomas M (the author of Slax and Linux Live
scripts) is making "doubling" donations.
Unfortunately I cannot list all of the donators, but I really
appreciate.
It ends Aug 2010, but the ordinary donation URL is still available.
<http://sourceforge.net/donate/index.php?group_id=167503>
Dai Itasaka made a donation (2007/8).
Chuck Smith made a donation (2008/4, 10 and 12).
Henk Schoneveld made a donation (2008/9).
Chih-Wei Huang, ASUS, CTC donated Eee PC 4G (2008/10).
Francois Dupoux made a donation (2008/11).
Bruno Cesar Ribas and Luis Carlos Erpen de Bona, C3SL serves public
aufs2 GIT tree (2009/2).
William Grant made a donation (2009/3).
Patrick Lane made a donation (2009/4).
The Mail Archive (mail-archive.com) made donations (2009/5).
Nippy Networks (Ed Wildgoose) made a donation (2009/7).
New Dream Network, LLC (www.dreamhost.com) made a donation (2009/11).
Pavel Pronskiy made a donation (2011/2).
Iridium and Inmarsat satellite phone retailer (www.mailasail.com), Nippy
Networks (Ed Wildgoose) made a donation for hardware (2011/3).
Max Lekomcev (DOM-TV project) made a donation (2011/7, 12, 2012/3, 6 and
11).
Sam Liddicott made a donation (2011/9).
Era Scarecrow made a donation (2013/4).
Bor Ratajc made a donation (2013/4).
Alessandro Gorreta made a donation (2013/4).
POIRETTE Marc made a donation (2013/4).
Alessandro Gorreta made a donation (2013/4).
lauri kasvandik made a donation (2013/5).
"pemasu from Finland" made a donation (2013/7).
The Parted Magic Project made a donation (2013/9 and 11).
Pavel Barta made a donation (2013/10).
Nikolay Pertsev made a donation (2014/5).
James B made a donation (2014/7 and 2015/7).
Stefano Di Biase made a donation (2014/8).
Daniel Epellei made a donation (2015/1).
OmegaPhil made a donation (2016/1, 2018/4).
Tomasz Szewczyk made a donation (2016/4).
James Burry made a donation (2016/12).
Carsten Rose made a donation (2018/9).
Porteus Kiosk made a donation (2018/10).
Thank you very much.
Donations are always, including future donations, very important and
helpful for me to keep on developing aufs.
7.
----------------------------------------
If you are an experienced user, no explanation is needed. Aufs is
just a linux filesystem.
Enjoy!
# Local variables: ;
# mode: text;
# End: ;

View File

@ -0,0 +1,171 @@
# Copyright (C) 2005-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Introduction
----------------------------------------
aufs [ei ju: ef es] | /ey-yoo-ef-es/ | [a u f s]
1. abbrev. for "advanced multi-layered unification filesystem".
2. abbrev. for "another unionfs".
3. abbrev. for "auf das" in German which means "on the" in English.
Ex. "Butter aufs Brot"(G) means "butter onto bread"(E).
But "Filesystem aufs Filesystem" is hard to understand.
4. abbrev. for "African Urban Fashion Show".
AUFS is a filesystem with features:
- multi layered stackable unification filesystem, the member directory
is called as a branch.
- branch permission and attribute, 'readonly', 'real-readonly',
'readwrite', 'whiteout-able', 'link-able whiteout', etc. and their
combination.
- internal "file copy-on-write".
- logical deletion, whiteout.
- dynamic branch manipulation, adding, deleting and changing permission.
- allow bypassing aufs, user's direct branch access.
- external inode number translation table and bitmap which maintains the
persistent aufs inode number.
- seekable directory, including NFS readdir.
- file mapping, mmap and sharing pages.
- pseudo-link, hardlink over branches.
- loopback mounted filesystem as a branch.
- several policies to select one among multiple writable branches.
- revert a single systemcall when an error occurs in aufs.
- and more...
Multi Layered Stackable Unification Filesystem
----------------------------------------------------------------------
Most people already knows what it is.
It is a filesystem which unifies several directories and provides a
merged single directory. When users access a file, the access will be
passed/re-directed/converted (sorry, I am not sure which English word is
correct) to the real file on the member filesystem. The member
filesystem is called 'lower filesystem' or 'branch' and has a mode
'readonly' and 'readwrite.' And the deletion for a file on the lower
readonly branch is handled by creating 'whiteout' on the upper writable
branch.
On LKML, there have been discussions about UnionMount (Jan Blunck,
Bharata B Rao and Valerie Aurora) and Unionfs (Erez Zadok). They took
different approaches to implement the merged-view.
The former tries putting it into VFS, and the latter implements as a
separate filesystem.
(If I misunderstand about these implementations, please let me know and
I shall correct it. Because it is a long time ago when I read their
source files last time).
UnionMount's approach will be able to small, but may be hard to share
branches between several UnionMount since the whiteout in it is
implemented in the inode on branch filesystem and always
shared. According to Bharata's post, readdir does not seems to be
finished yet.
There are several missing features known in this implementations such as
- for users, the inode number may change silently. eg. copy-up.
- link(2) may break by copy-up.
- read(2) may get an obsoleted filedata (fstat(2) too).
- fcntl(F_SETLK) may be broken by copy-up.
- unnecessary copy-up may happen, for example mmap(MAP_PRIVATE) after
open(O_RDWR).
In linux-3.18, "overlay" filesystem (formerly known as "overlayfs") was
merged into mainline. This is another implementation of UnionMount as a
separated filesystem. All the limitations and known problems which
UnionMount are equally inherited to "overlay" filesystem.
Unionfs has a longer history. When I started implementing a stackable
filesystem (Aug 2005), it already existed. It has virtual super_block,
inode, dentry and file objects and they have an array pointing lower
same kind objects. After contributing many patches for Unionfs, I
re-started my project AUFS (Jun 2006).
In AUFS, the structure of filesystem resembles to Unionfs, but I
implemented my own ideas, approaches and enhancements and it became
totally different one.
Comparing DM snapshot and fs based implementation
- the number of bytes to be copied between devices is much smaller.
- the type of filesystem must be one and only.
- the fs must be writable, no readonly fs, even for the lower original
device. so the compression fs will not be usable. but if we use
loopback mount, we may address this issue.
for instance,
mount /cdrom/squashfs.img /sq
losetup /sq/ext2.img
losetup /somewhere/cow
dmsetup "snapshot /dev/loop0 /dev/loop1 ..."
- it will be difficult (or needs more operations) to extract the
difference between the original device and COW.
- DM snapshot-merge may help a lot when users try merging. in the
fs-layer union, users will use rsync(1).
You may want to read my old paper "Filesystems in LiveCD"
(http://aufs.sourceforge.net/aufs2/report/sq/sq.pdf).
Several characters/aspects/persona of aufs
----------------------------------------------------------------------
Aufs has several characters, aspects or persona.
1. a filesystem, callee of VFS helper
2. sub-VFS, caller of VFS helper for branches
3. a virtual filesystem which maintains persistent inode number
4. reader/writer of files on branches such like an application
1. Callee of VFS Helper
As an ordinary linux filesystem, aufs is a callee of VFS. For instance,
unlink(2) from an application reaches sys_unlink() kernel function and
then vfs_unlink() is called. vfs_unlink() is one of VFS helper and it
calls filesystem specific unlink operation. Actually aufs implements the
unlink operation but it behaves like a redirector.
2. Caller of VFS Helper for Branches
aufs_unlink() passes the unlink request to the branch filesystem as if
it were called from VFS. So the called unlink operation of the branch
filesystem acts as usual. As a caller of VFS helper, aufs should handle
every necessary pre/post operation for the branch filesystem.
- acquire the lock for the parent dir on a branch
- lookup in a branch
- revalidate dentry on a branch
- mnt_want_write() for a branch
- vfs_unlink() for a branch
- mnt_drop_write() for a branch
- release the lock on a branch
3. Persistent Inode Number
One of the most important issue for a filesystem is to maintain inode
numbers. This is particularly important to support exporting a
filesystem via NFS. Aufs is a virtual filesystem which doesn't have a
backend block device for its own. But some storage is necessary to
keep and maintain the inode numbers. It may be a large space and may not
suit to keep in memory. Aufs rents some space from its first writable
branch filesystem (by default) and creates file(s) on it. These files
are created by aufs internally and removed soon (currently) keeping
opened.
Note: Because these files are removed, they are totally gone after
unmounting aufs. It means the inode numbers are not persistent
across unmount or reboot. I have a plan to make them really
persistent which will be important for aufs on NFS server.
4. Read/Write Files Internally (copy-on-write)
Because a branch can be readonly, when you write a file on it, aufs will
"copy-up" it to the upper writable branch internally. And then write the
originally requested thing to the file. Generally kernel doesn't
open/read/write file actively. In aufs, even a single write may cause a
internal "file copy". This behaviour is very similar to cp(1) command.
Some people may think it is better to pass such work to user space
helper, instead of doing in kernel space. Actually I am still thinking
about it. But currently I have implemented it in kernel space.

View File

@ -0,0 +1,258 @@
# Copyright (C) 2005-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Basic Aufs Internal Structure
Superblock/Inode/Dentry/File Objects
----------------------------------------------------------------------
As like an ordinary filesystem, aufs has its own
superblock/inode/dentry/file objects. All these objects have a
dynamically allocated array and store the same kind of pointers to the
lower filesystem, branch.
For example, when you build a union with one readwrite branch and one
readonly, mounted /au, /rw and /ro respectively.
- /au = /rw + /ro
- /ro/fileA exists but /rw/fileA
Aufs lookup operation finds /ro/fileA and gets dentry for that. These
pointers are stored in a aufs dentry. The array in aufs dentry will be,
- [0] = NULL (because /rw/fileA doesn't exist)
- [1] = /ro/fileA
This style of an array is essentially same to the aufs
superblock/inode/dentry/file objects.
Because aufs supports manipulating branches, ie. add/delete/change
branches dynamically, these objects has its own generation. When
branches are changed, the generation in aufs superblock is
incremented. And a generation in other object are compared when it is
accessed. When a generation in other objects are obsoleted, aufs
refreshes the internal array.
Superblock
----------------------------------------------------------------------
Additionally aufs superblock has some data for policies to select one
among multiple writable branches, XIB files, pseudo-links and kobject.
See below in detail.
About the policies which supports copy-down a directory, see
wbr_policy.txt too.
Branch and XINO(External Inode Number Translation Table)
----------------------------------------------------------------------
Every branch has its own xino (external inode number translation table)
file. The xino file is created and unlinked by aufs internally. When two
members of a union exist on the same filesystem, they share the single
xino file.
The struct of a xino file is simple, just a sequence of aufs inode
numbers which is indexed by the lower inode number.
In the above sample, assume the inode number of /ro/fileA is i111 and
aufs assigns the inode number i999 for fileA. Then aufs writes 999 as
4(8) bytes at 111 * 4(8) bytes offset in the xino file.
When the inode numbers are not contiguous, the xino file will be sparse
which has a hole in it and doesn't consume as much disk space as it
might appear. If your branch filesystem consumes disk space for such
holes, then you should specify 'xino=' option at mounting aufs.
Aufs has a mount option to free the disk blocks for such holes in XINO
files on tmpfs or ramdisk. But it is not so effective actually. If you
meet a problem of disk shortage due to XINO files, then you should try
"tmpfs-ino.patch" (and "vfs-ino.patch" too) in aufs4-standalone.git.
The patch localizes the assignment inumbers per tmpfs-mount and avoid
the holes in XINO files.
Also a writable branch has three kinds of "whiteout bases". All these
are existed when the branch is joined to aufs, and their names are
whiteout-ed doubly, so that users will never see their names in aufs
hierarchy.
1. a regular file which will be hardlinked to all whiteouts.
2. a directory to store a pseudo-link.
3. a directory to store an "orphan"-ed file temporary.
1. Whiteout Base
When you remove a file on a readonly branch, aufs handles it as a
logical deletion and creates a whiteout on the upper writable branch
as a hardlink of this file in order not to consume inode on the
writable branch.
2. Pseudo-link Dir
See below, Pseudo-link.
3. Step-Parent Dir
When "fileC" exists on the lower readonly branch only and it is
opened and removed with its parent dir, and then user writes
something into it, then aufs copies-up fileC to this
directory. Because there is no other dir to store fileC. After
creating a file under this dir, the file is unlinked.
Because aufs supports manipulating branches, ie. add/delete/change
dynamically, a branch has its own id. When the branch order changes,
aufs finds the new index by searching the branch id.
Pseudo-link
----------------------------------------------------------------------
Assume "fileA" exists on the lower readonly branch only and it is
hardlinked to "fileB" on the branch. When you write something to fileA,
aufs copies-up it to the upper writable branch. Additionally aufs
creates a hardlink under the Pseudo-link Directory of the writable
branch. The inode of a pseudo-link is kept in aufs super_block as a
simple list. If fileB is read after unlinking fileA, aufs returns
filedata from the pseudo-link instead of the lower readonly
branch. Because the pseudo-link is based upon the inode, to keep the
inode number by xino (see above) is essentially necessary.
All the hardlinks under the Pseudo-link Directory of the writable branch
should be restored in a proper location later. Aufs provides a utility
to do this. The userspace helpers executed at remounting and unmounting
aufs by default.
During this utility is running, it puts aufs into the pseudo-link
maintenance mode. In this mode, only the process which began the
maintenance mode (and its child processes) is allowed to operate in
aufs. Some other processes which are not related to the pseudo-link will
be allowed to run too, but the rest have to return an error or wait
until the maintenance mode ends. If a process already acquires an inode
mutex (in VFS), it has to return an error.
XIB(external inode number bitmap)
----------------------------------------------------------------------
Addition to the xino file per a branch, aufs has an external inode number
bitmap in a superblock object. It is also an internal file such like a
xino file.
It is a simple bitmap to mark whether the aufs inode number is in-use or
not.
To reduce the file I/O, aufs prepares a single memory page to cache xib.
As well as XINO files, aufs has a feature to truncate/refresh XIB to
reduce the number of consumed disk blocks for these files.
Virtual or Vertical Dir, and Readdir in Userspace
----------------------------------------------------------------------
In order to support multiple layers (branches), aufs readdir operation
constructs a virtual dir block on memory. For readdir, aufs calls
vfs_readdir() internally for each dir on branches, merges their entries
with eliminating the whiteout-ed ones, and sets it to file (dir)
object. So the file object has its entry list until it is closed. The
entry list will be updated when the file position is zero and becomes
obsoleted. This decision is made in aufs automatically.
The dynamically allocated memory block for the name of entries has a
unit of 512 bytes (by default) and stores the names contiguously (no
padding). Another block for each entry is handled by kmem_cache too.
During building dir blocks, aufs creates hash list and judging whether
the entry is whiteouted by its upper branch or already listed.
The merged result is cached in the corresponding inode object and
maintained by a customizable life-time option.
Some people may call it can be a security hole or invite DoS attack
since the opened and once readdir-ed dir (file object) holds its entry
list and becomes a pressure for system memory. But I'd say it is similar
to files under /proc or /sys. The virtual files in them also holds a
memory page (generally) while they are opened. When an idea to reduce
memory for them is introduced, it will be applied to aufs too.
For those who really hate this situation, I've developed readdir(3)
library which operates this merging in userspace. You just need to set
LD_PRELOAD environment variable, and aufs will not consume no memory in
kernel space for readdir(3).
Workqueue
----------------------------------------------------------------------
Aufs sometimes requires privilege access to a branch. For instance,
in copy-up/down operation. When a user process is going to make changes
to a file which exists in the lower readonly branch only, and the mode
of one of ancestor directories may not be writable by a user
process. Here aufs copy-up the file with its ancestors and they may
require privilege to set its owner/group/mode/etc.
This is a typical case of a application character of aufs (see
Introduction).
Aufs uses workqueue synchronously for this case. It creates its own
workqueue. The workqueue is a kernel thread and has privilege. Aufs
passes the request to call mkdir or write (for example), and wait for
its completion. This approach solves a problem of a signal handler
simply.
If aufs didn't adopt the workqueue and changed the privilege of the
process, then the process may receive the unexpected SIGXFSZ or other
signals.
Also aufs uses the system global workqueue ("events" kernel thread) too
for asynchronous tasks, such like handling inotify/fsnotify, re-creating a
whiteout base and etc. This is unrelated to a privilege.
Most of aufs operation tries acquiring a rw_semaphore for aufs
superblock at the beginning, at the same time waits for the completion
of all queued asynchronous tasks.
Whiteout
----------------------------------------------------------------------
The whiteout in aufs is very similar to Unionfs's. That is represented
by its filename. UnionMount takes an approach of a file mode, but I am
afraid several utilities (find(1) or something) will have to support it.
Basically the whiteout represents "logical deletion" which stops aufs to
lookup further, but also it represents "dir is opaque" which also stop
further lookup.
In aufs, rmdir(2) and rename(2) for dir uses whiteout alternatively.
In order to make several functions in a single systemcall to be
revertible, aufs adopts an approach to rename a directory to a temporary
unique whiteouted name.
For example, in rename(2) dir where the target dir already existed, aufs
renames the target dir to a temporary unique whiteouted name before the
actual rename on a branch, and then handles other actions (make it opaque,
update the attributes, etc). If an error happens in these actions, aufs
simply renames the whiteouted name back and returns an error. If all are
succeeded, aufs registers a function to remove the whiteouted unique
temporary name completely and asynchronously to the system global
workqueue.
Copy-up
----------------------------------------------------------------------
It is a well-known feature or concept.
When user modifies a file on a readonly branch, aufs operate "copy-up"
internally and makes change to the new file on the upper writable branch.
When the trigger systemcall does not update the timestamps of the parent
dir, aufs reverts it after copy-up.
Move-down (aufs3.9 and later)
----------------------------------------------------------------------
"Copy-up" is one of the essential feature in aufs. It copies a file from
the lower readonly branch to the upper writable branch when a user
changes something about the file.
"Move-down" is an opposite action of copy-up. Basically this action is
ran manually instead of automatically and internally.
For desgin and implementation, aufs has to consider these issues.
- whiteout for the file may exist on the lower branch.
- ancestor directories may not exist on the lower branch.
- diropq for the ancestor directories may exist on the upper branch.
- free space on the lower branch will reduce.
- another access to the file may happen during moving-down, including
UDBA (see "Revalidate Dentry and UDBA").
- the file should not be hard-linked nor pseudo-linked. they should be
handled by auplink utility later.
Sometimes users want to move-down a file from the upper writable branch
to the lower readonly or writable branch. For instance,
- the free space of the upper writable branch is going to run out.
- create a new intermediate branch between the upper and lower branch.
- etc.
For this purpose, use "aumvdown" command in aufs-util.git.

View File

@ -0,0 +1,85 @@
# Copyright (C) 2015-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Support for a branch who has its ->atomic_open()
----------------------------------------------------------------------
The filesystems who implement its ->atomic_open() are not majority. For
example NFSv4 does, and aufs should call NFSv4 ->atomic_open,
particularly for open(O_CREAT|O_EXCL, 0400) case. Other than
->atomic_open(), NFSv4 returns an error for this open(2). While I am not
sure whether all filesystems who have ->atomic_open() behave like this,
but NFSv4 surely returns the error.
In order to support ->atomic_open() for aufs, there are a few
approaches.
A. Introduce aufs_atomic_open()
- calls one of VFS:do_last(), lookup_open() or atomic_open() for
branch fs.
B. Introduce aufs_atomic_open() calling create, open and chmod. this is
an aufs user Pip Cet's approach
- calls aufs_create(), VFS finish_open() and notify_change().
- pass fake-mode to finish_open(), and then correct the mode by
notify_change().
C. Extend aufs_open() to call branch fs's ->atomic_open()
- no aufs_atomic_open().
- aufs_lookup() registers the TID to an aufs internal object.
- aufs_create() does nothing when the matching TID is registered, but
registers the mode.
- aufs_open() calls branch fs's ->atomic_open() when the matching
TID is registered.
D. Extend aufs_open() to re-try branch fs's ->open() with superuser's
credential
- no aufs_atomic_open().
- aufs_create() registers the TID to an internal object. this info
represents "this process created this file just now."
- when aufs gets EACCES from branch fs's ->open(), then confirm the
registered TID and re-try open() with superuser's credential.
Pros and cons for each approach.
A.
- straightforward but highly depends upon VFS internal.
- the atomic behavaiour is kept.
- some of parameters such as nameidata are hard to reproduce for
branch fs.
- large overhead.
B.
- easy to implement.
- the atomic behavaiour is lost.
C.
- the atomic behavaiour is kept.
- dirty and tricky.
- VFS checks whether the file is created correctly after calling
->create(), which means this approach doesn't work.
D.
- easy to implement.
- the atomic behavaiour is lost.
- to open a file with superuser's credential and give it to a user
process is a bad idea, since the file object keeps the credential
in it. It may affect LSM or something. This approach doesn't work
either.
The approach A is ideal, but it hard to implement. So here is a
variation of A, which is to be implemented.
A-1. Introduce aufs_atomic_open()
- calls branch fs ->atomic_open() if exists. otherwise calls
vfs_create() and finish_open().
- the demerit is that the several checks after branch fs
->atomic_open() are lost. in the ordinary case, the checks are
done by VFS:do_last(), lookup_open() and atomic_open(). some can
be implemented in aufs, but not all I am afraid.

View File

@ -0,0 +1,113 @@
# Copyright (C) 2005-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Lookup in a Branch
----------------------------------------------------------------------
Since aufs has a character of sub-VFS (see Introduction), it operates
lookup for branches as VFS does. It may be a heavy work. But almost all
lookup operation in aufs is the simplest case, ie. lookup only an entry
directly connected to its parent. Digging down the directory hierarchy
is unnecessary. VFS has a function lookup_one_len() for that use, and
aufs calls it.
When a branch is a remote filesystem, aufs basically relies upon its
->d_revalidate(), also aufs forces the hardest revalidate tests for
them.
For d_revalidate, aufs implements three levels of revalidate tests. See
"Revalidate Dentry and UDBA" in detail.
Test Only the Highest One for the Directory Permission (dirperm1 option)
----------------------------------------------------------------------
Let's try case study.
- aufs has two branches, upper readwrite and lower readonly.
/au = /rw + /ro
- "dirA" exists under /ro, but /rw. and its mode is 0700.
- user invoked "chmod a+rx /au/dirA"
- the internal copy-up is activated and "/rw/dirA" is created and its
permission bits are set to world readable.
- then "/au/dirA" becomes world readable?
In this case, /ro/dirA is still 0700 since it exists in readonly branch,
or it may be a natively readonly filesystem. If aufs respects the lower
branch, it should not respond readdir request from other users. But user
allowed it by chmod. Should really aufs rejects showing the entries
under /ro/dirA?
To be honest, I don't have a good solution for this case. So aufs
implements 'dirperm1' and 'nodirperm1' mount options, and leave it to
users.
When dirperm1 is specified, aufs checks only the highest one for the
directory permission, and shows the entries. Otherwise, as usual, checks
every dir existing on all branches and rejects the request.
As a side effect, dirperm1 option improves the performance of aufs
because the number of permission check is reduced when the number of
branch is many.
Revalidate Dentry and UDBA (User's Direct Branch Access)
----------------------------------------------------------------------
Generally VFS helpers re-validate a dentry as a part of lookup.
0. digging down the directory hierarchy.
1. lock the parent dir by its i_mutex.
2. lookup the final (child) entry.
3. revalidate it.
4. call the actual operation (create, unlink, etc.)
5. unlock the parent dir
If the filesystem implements its ->d_revalidate() (step 3), then it is
called. Actually aufs implements it and checks the dentry on a branch is
still valid.
But it is not enough. Because aufs has to release the lock for the
parent dir on a branch at the end of ->lookup() (step 2) and
->d_revalidate() (step 3) while the i_mutex of the aufs dir is still
held by VFS.
If the file on a branch is changed directly, eg. bypassing aufs, after
aufs released the lock, then the subsequent operation may cause
something unpleasant result.
This situation is a result of VFS architecture, ->lookup() and
->d_revalidate() is separated. But I never say it is wrong. It is a good
design from VFS's point of view. It is just not suitable for sub-VFS
character in aufs.
Aufs supports such case by three level of revalidation which is
selectable by user.
1. Simple Revalidate
Addition to the native flow in VFS's, confirm the child-parent
relationship on the branch just after locking the parent dir on the
branch in the "actual operation" (step 4). When this validation
fails, aufs returns EBUSY. ->d_revalidate() (step 3) in aufs still
checks the validation of the dentry on branches.
2. Monitor Changes Internally by Inotify/Fsnotify
Addition to above, in the "actual operation" (step 4) aufs re-lookup
the dentry on the branch, and returns EBUSY if it finds different
dentry.
Additionally, aufs sets the inotify/fsnotify watch for every dir on branches
during it is in cache. When the event is notified, aufs registers a
function to kernel 'events' thread by schedule_work(). And the
function sets some special status to the cached aufs dentry and inode
private data. If they are not cached, then aufs has nothing to
do. When the same file is accessed through aufs (step 0-3) later,
aufs will detect the status and refresh all necessary data.
In this mode, aufs has to ignore the event which is fired by aufs
itself.
3. No Extra Validation
This is the simplest test and doesn't add any additional revalidation
test, and skip the revalidation in step 4. It is useful and improves
aufs performance when system surely hide the aufs branches from user,
by over-mounting something (or another method).

View File

@ -0,0 +1,74 @@
# Copyright (C) 2005-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Branch Manipulation
Since aufs supports dynamic branch manipulation, ie. add/remove a branch
and changing its permission/attribute, there are a lot of works to do.
Add a Branch
----------------------------------------------------------------------
o Confirm the adding dir exists outside of aufs, including loopback
mount, and its various attributes.
o Initialize the xino file and whiteout bases if necessary.
See struct.txt.
o Check the owner/group/mode of the directory
When the owner/group/mode of the adding directory differs from the
existing branch, aufs issues a warning because it may impose a
security risk.
For example, when a upper writable branch has a world writable empty
top directory, a malicious user can create any files on the writable
branch directly, like copy-up and modify manually. If something like
/etc/{passwd,shadow} exists on the lower readonly branch but the upper
writable branch, and the writable branch is world-writable, then a
malicious guy may create /etc/passwd on the writable branch directly
and the infected file will be valid in aufs.
I am afraid it can be a security issue, but aufs can do nothing except
producing a warning.
Delete a Branch
----------------------------------------------------------------------
o Confirm the deleting branch is not busy
To be general, there is one merit to adopt "remount" interface to
manipulate branches. It is to discard caches. At deleting a branch,
aufs checks the still cached (and connected) dentries and inodes. If
there are any, then they are all in-use. An inode without its
corresponding dentry can be alive alone (for example, inotify/fsnotify case).
For the cached one, aufs checks whether the same named entry exists on
other branches.
If the cached one is a directory, because aufs provides a merged view
to users, as long as one dir is left on any branch aufs can show the
dir to users. In this case, the branch can be removed from aufs.
Otherwise aufs rejects deleting the branch.
If any file on the deleting branch is opened by aufs, then aufs
rejects deleting.
Modify the Permission of a Branch
----------------------------------------------------------------------
o Re-initialize or remove the xino file and whiteout bases if necessary.
See struct.txt.
o rw --> ro: Confirm the modifying branch is not busy
Aufs rejects the request if any of these conditions are true.
- a file on the branch is mmap-ed.
- a regular file on the branch is opened for write and there is no
same named entry on the upper branch.

View File

@ -0,0 +1,64 @@
# Copyright (C) 2005-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Policies to Select One among Multiple Writable Branches
----------------------------------------------------------------------
When the number of writable branch is more than one, aufs has to decide
the target branch for file creation or copy-up. By default, the highest
writable branch which has the parent (or ancestor) dir of the target
file is chosen (top-down-parent policy).
By user's request, aufs implements some other policies to select the
writable branch, for file creation several policies, round-robin,
most-free-space, and other policies. For copy-up, top-down-parent,
bottom-up-parent, bottom-up and others.
As expected, the round-robin policy selects the branch in circular. When
you have two writable branches and creates 10 new files, 5 files will be
created for each branch. mkdir(2) systemcall is an exception. When you
create 10 new directories, all will be created on the same branch.
And the most-free-space policy selects the one which has most free
space among the writable branches. The amount of free space will be
checked by aufs internally, and users can specify its time interval.
The policies for copy-up is more simple,
top-down-parent is equivalent to the same named on in create policy,
bottom-up-parent selects the writable branch where the parent dir
exists and the nearest upper one from the copyup-source,
bottom-up selects the nearest upper writable branch from the
copyup-source, regardless the existence of the parent dir.
There are some rules or exceptions to apply these policies.
- If there is a readonly branch above the policy-selected branch and
the parent dir is marked as opaque (a variation of whiteout), or the
target (creating) file is whiteout-ed on the upper readonly branch,
then the result of the policy is ignored and the target file will be
created on the nearest upper writable branch than the readonly branch.
- If there is a writable branch above the policy-selected branch and
the parent dir is marked as opaque or the target file is whiteouted
on the branch, then the result of the policy is ignored and the target
file will be created on the highest one among the upper writable
branches who has diropq or whiteout. In case of whiteout, aufs removes
it as usual.
- link(2) and rename(2) systemcalls are exceptions in every policy.
They try selecting the branch where the source exists as possible
since copyup a large file will take long time. If it can't be,
ie. the branch where the source exists is readonly, then they will
follow the copyup policy.
- There is an exception for rename(2) when the target exists.
If the rename target exists, aufs compares the index of the branches
where the source and the target exists and selects the higher
one. If the selected branch is readonly, then aufs follows the
copyup policy.

View File

@ -0,0 +1,31 @@
// to view this graph, run dot(1) command in GRAPHVIZ.
digraph G {
node [shape=box];
whinfo [label="detailed info file\n(lower_brid_root-hinum, h_inum, namelen, old name)"];
node [shape=oval];
aufs_rename -> whinfo [label="store/remove"];
node [shape=oval];
inode_list [label="h_inum list in branch\ncache"];
node [shape=box];
whinode [label="h_inum list file"];
node [shape=oval];
brmgmt [label="br_add/del/mod/umount"];
brmgmt -> inode_list [label="create/remove"];
brmgmt -> whinode [label="load/store"];
inode_list -> whinode [style=dashed,dir=both];
aufs_rename -> inode_list [label="add/del"];
aufs_lookup -> inode_list [label="search"];
aufs_lookup -> whinfo [label="load/remove"];
}

View File

@ -0,0 +1,102 @@
# Copyright (C) 2017-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Special handling for renaming a directory (DIRREN)
----------------------------------------------------------------------
First, let's assume we have a simple usecase.
- /u = /rw + /ro
- /rw/dirA exists
- /ro/dirA and /ro/dirA/file exist too
- there is no dirB on both branches
- a user issues rename("dirA", "dirB")
Now, what should aufs behave against this rename(2)?
There are a few possible cases.
A. returns EROFS.
since dirA exists on a readonly branch which cannot be renamed.
B. returns EXDEV.
it is possible to copy-up dirA (only the dir itself), but the child
entries ("file" in this case) should not be. it must be a bad
approach to copy-up recursively.
C. returns a success.
even the branch /ro is readonly, aufs tries renaming it. Obviously it
is a violation of aufs' policy.
D. construct an extra information which indicates that /ro/dirA should
be handled as the name of dirB.
overlayfs has a similar feature called REDIRECT.
Until now, aufs implements the case B only which returns EXDEV, and
expects the userspace application behaves like mv(1) which tries
issueing rename(2) recursively.
A new aufs feature called DIRREN is introduced which implements the case
D. There are several "extra information" added.
1. detailed info per renamed directory
path: /rw/dirB/$AUFS_WH_DR_INFO_PFX.<lower branch-id>
2. the inode-number list of directories on a branch
path: /rw/dirB/$AUFS_WH_DR_BRHINO
The filename of "detailed info per directory" represents the lower
branch, and its format is
- a type of the branch id
one of these.
+ uuid (not implemented yet)
+ fsid
+ dev
- the inode-number of the branch root dir
And it contains these info in a single regular file.
- magic number
- branch's inode-number of the logically renamed dir
- the name of the before-renamed dir
The "detailed info per directory" file is created in aufs rename(2), and
loaded in any lookup.
The info is considered in lookup for the matching case only. Here
"matching" means that the root of branch (in the info filename) is same
to the current looking-up branch. After looking-up the before-renamed
name, the inode-number is compared. And the matched dentry is used.
The "inode-number list of directories" is a regular file which contains
simply the inode-numbers on the branch. The file is created or updated
in removing the branch, and loaded in adding the branch. Its lifetime is
equal to the branch.
The list is refered in lookup, and when the current target inode is
found in the list, the aufs tries loading the "detailed info per
directory" and get the changed and valid name of the dir.
Theoretically these "extra informaiton" may be able to be put into XATTR
in the dir inode. But aufs doesn't choose this way because
1. XATTR may not be supported by the branch (or its configuration)
2. XATTR may have its size limit.
3. XATTR may be less easy to convert than a regular file, when the
format of the info is changed in the future.
At the same time, I agree that the regular file approach is much slower
than XATTR approach. So, in the future, aufs may take the XATTR or other
better approach.
This DIRREN feature is enabled by aufs configuration, and is activated
by a new mount option.
For the more complicated case, there is a work with UDBA option, which
is to dected the direct access to the branches (by-passing aufs) and to
maintain the cashes in aufs. Since a single cached aufs dentry may
contains two names, before- and after-rename, the name comparision in
UDBA handler may not work correctly. In this case, the behaviour will be
equivalen to udba=reval case.

View File

@ -0,0 +1,120 @@
# Copyright (C) 2011-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
File-based Hierarchical Storage Management (FHSM)
----------------------------------------------------------------------
Hierarchical Storage Management (or HSM) is a well-known feature in the
storage world. Aufs provides this feature as file-based with multiple
writable branches, based upon the principle of "Colder, the Lower".
Here the word "colder" means that the less used files, and "lower" means
that the position in the order of the stacked branches vertically.
These multiple writable branches are prioritized, ie. the topmost one
should be the fastest drive and be used heavily.
o Characters in aufs FHSM story
- aufs itself and a new branch attribute.
- a new ioctl interface to move-down and to establish a connection with
the daemon ("move-down" is a converse of "copy-up").
- userspace tool and daemon.
The userspace daemon establishes a connection with aufs and waits for
the notification. The notified information is very similar to struct
statfs containing the number of consumed blocks and inodes.
When the consumed blocks/inodes of a branch exceeds the user-specified
upper watermark, the daemon activates its move-down process until the
consumed blocks/inodes reaches the user-specified lower watermark.
The actual move-down is done by aufs based upon the request from
user-space since we need to maintain the inode number and the internal
pointer arrays in aufs.
Currently aufs FHSM handles the regular files only. Additionally they
must not be hard-linked nor pseudo-linked.
o Cowork of aufs and the user-space daemon
During the userspace daemon established the connection, aufs sends a
small notification to it whenever aufs writes something into the
writable branch. But it may cost high since aufs issues statfs(2)
internally. So user can specify a new option to cache the
info. Actually the notification is controlled by these factors.
+ the specified cache time.
+ classified as "force" by aufs internally.
Until the specified time expires, aufs doesn't send the info
except the forced cases. When aufs decide forcing, the info is always
notified to userspace.
For example, the number of free inodes is generally large enough and
the shortage of it happens rarely. So aufs doesn't force the
notification when creating a new file, directory and others. This is
the typical case which aufs doesn't force.
When aufs writes the actual filedata and the files consumes any of new
blocks, the aufs forces notifying.
o Interfaces in aufs
- New branch attribute.
+ fhsm
Specifies that the branch is managed by FHSM feature. In other word,
participant in the FHSM.
When nofhsm is set to the branch, it will not be the source/target
branch of the move-down operation. This attribute is set
independently from coo and moo attributes, and if you want full
FHSM, you should specify them as well.
- New mount option.
+ fhsm_sec
Specifies a second to suppress many less important info to be
notified.
- New ioctl.
+ AUFS_CTL_FHSM_FD
create a new file descriptor which userspace can read the notification
(a subset of struct statfs) from aufs.
- Module parameter 'brs'
It has to be set to 1. Otherwise the new mount option 'fhsm' will not
be set.
- mount helpers /sbin/mount.aufs and /sbin/umount.aufs
When there are two or more branches with fhsm attributes,
/sbin/mount.aufs invokes the user-space daemon and /sbin/umount.aufs
terminates it. As a result of remounting and branch-manipulation, the
number of branches with fhsm attribute can be one. In this case,
/sbin/mount.aufs will terminate the user-space daemon.
Finally the operation is done as these steps in kernel-space.
- make sure that,
+ no one else is using the file.
+ the file is not hard-linked.
+ the file is not pseudo-linked.
+ the file is a regular file.
+ the parent dir is not opaqued.
- find the target writable branch.
- make sure the file is not whiteout-ed by the upper (than the target)
branch.
- make the parent dir on the target branch.
- mutex lock the inode on the branch.
- unlink the whiteout on the target branch (if exists).
- lookup and create the whiteout-ed temporary name on the target branch.
- copy the file as the whiteout-ed temporary name on the target branch.
- rename the whiteout-ed temporary name to the original name.
- unlink the file on the source branch.
- maintain the internal pointer array and the external inode number
table (XINO).
- maintain the timestamps and other attributes of the parent dir and the
file.
And of course, in every step, an error may happen. So the operation
should restore the original file state after an error happens.

View File

@ -0,0 +1,72 @@
# Copyright (C) 2005-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
mmap(2) -- File Memory Mapping
----------------------------------------------------------------------
In aufs, the file-mapped pages are handled by a branch fs directly, no
interaction with aufs. It means aufs_mmap() calls the branch fs's
->mmap().
This approach is simple and good, but there is one problem.
Under /proc, several entries show the mmapped files by its path (with
device and inode number), and the printed path will be the path on the
branch fs's instead of virtual aufs's.
This is not a problem in most cases, but some utilities lsof(1) (and its
user) may expect the path on aufs.
To address this issue, aufs adds a new member called vm_prfile in struct
vm_area_struct (and struct vm_region). The original vm_file points to
the file on the branch fs in order to handle everything correctly as
usual. The new vm_prfile points to a virtual file in aufs, and the
show-functions in procfs refers to vm_prfile if it is set.
Also we need to maintain several other places where touching vm_file
such like
- fork()/clone() copies vma and the reference count of vm_file is
incremented.
- merging vma maintains the ref count too.
This is not a good approach. It just fakes the printed path. But it
leaves all behaviour around f_mapping unchanged. This is surely an
advantage.
Actually aufs had adopted another complicated approach which calls
generic_file_mmap() and handles struct vm_operations_struct. In this
approach, aufs met a hard problem and I could not solve it without
switching the approach.
There may be one more another approach which is
- bind-mount the branch-root onto the aufs-root internally
- grab the new vfsmount (ie. struct mount)
- lazy-umount the branch-root internally
- in open(2) the aufs-file, open the branch-file with the hidden
vfsmount (instead of the original branch's vfsmount)
- ideally this "bind-mount and lazy-umount" should be done atomically,
but it may be possible from userspace by the mount helper.
Adding the internal hidden vfsmount and using it in opening a file, the
file path under /proc will be printed correctly. This approach looks
smarter, but is not possible I am afraid.
- aufs-root may be bind-mount later. when it happens, another hidden
vfsmount will be required.
- it is hard to get the chance to bind-mount and lazy-umount
+ in kernel-space, FS can have vfsmount in open(2) via
file->f_path, and aufs can know its vfsmount. But several locks are
already acquired, and if aufs tries to bind-mount and lazy-umount
here, then it may cause a deadlock.
+ in user-space, bind-mount doesn't invoke the mount helper.
- since /proc shows dev and ino, aufs has to give vma these info. it
means a new member vm_prinode will be necessary. this is essentially
equivalent to vm_prfile described above.
I have to give up this "looks-smater" approach.

View File

@ -0,0 +1,96 @@
# Copyright (C) 2014-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Listing XATTR/EA and getting the value
----------------------------------------------------------------------
For the inode standard attributes (owner, group, timestamps, etc.), aufs
shows the values from the topmost existing file. This behaviour is good
for the non-dir entries since the bahaviour exactly matches the shown
information. But for the directories, aufs considers all the same named
entries on the lower branches. Which means, if one of the lower entry
rejects readdir call, then aufs returns an error even if the topmost
entry allows it. This behaviour is necessary to respect the branch fs's
security, but can make users confused since the user-visible standard
attributes don't match the behaviour.
To address this issue, aufs has a mount option called dirperm1 which
checks the permission for the topmost entry only, and ignores the lower
entry's permission.
A similar issue can happen around XATTR.
getxattr(2) and listxattr(2) families behave as if dirperm1 option is
always set. Otherwise these very unpleasant situation would happen.
- listxattr(2) may return the duplicated entries.
- users may not be able to remove or reset the XATTR forever,
XATTR/EA support in the internal (copy,move)-(up,down)
----------------------------------------------------------------------
Generally the extended attributes of inode are categorized as these.
- "security" for LSM and capability.
- "system" for posix ACL, 'acl' mount option is required for the branch
fs generally.
- "trusted" for userspace, CAP_SYS_ADMIN is required.
- "user" for userspace, 'user_xattr' mount option is required for the
branch fs generally.
Moreover there are some other categories. Aufs handles these rather
unpopular categories as the ordinary ones, ie. there is no special
condition nor exception.
In copy-up, the support for XATTR on the dst branch may differ from the
src branch. In this case, the copy-up operation will get an error and
the original user operation which triggered the copy-up will fail. It
can happen that even all copy-up will fail.
When both of src and dst branches support XATTR and if an error occurs
during copying XATTR, then the copy-up should fail obviously. That is a
good reason and aufs should return an error to userspace. But when only
the src branch support that XATTR, aufs should not return an error.
For example, the src branch supports ACL but the dst branch doesn't
because the dst branch may natively un-support it or temporary
un-support it due to "noacl" mount option. Of course, the dst branch fs
may NOT return an error even if the XATTR is not supported. It is
totally up to the branch fs.
Anyway when the aufs internal copy-up gets an error from the dst branch
fs, then aufs tries removing the just copied entry and returns the error
to the userspace. The worst case of this situation will be all copy-up
will fail.
For the copy-up operation, there two basic approaches.
- copy the specified XATTR only (by category above), and return the
error unconditionally if it happens.
- copy all XATTR, and ignore the error on the specified category only.
In order to support XATTR and to implement the correct behaviour, aufs
chooses the latter approach and introduces some new branch attributes,
"icexsec", "icexsys", "icextr", "icexusr", and "icexoth".
They correspond to the XATTR namespaces (see above). Additionally, to be
convenient, "icex" is also provided which means all "icex*" attributes
are set (here the word "icex" stands for "ignore copy-error on XATTR").
The meaning of these attributes is to ignore the error from setting
XATTR on that branch.
Note that aufs tries copying all XATTR unconditionally, and ignores the
error from the dst branch according to the specified attributes.
Some XATTR may have its default value. The default value may come from
the parent dir or the environment. If the default value is set at the
file creating-time, it will be overwritten by copy-up.
Some contradiction may happen I am afraid.
Do we need another attribute to stop copying XATTR? I am unsure. For
now, aufs implements the branch attributes to ignore the error.

View File

@ -0,0 +1,58 @@
# Copyright (C) 2005-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Export Aufs via NFS
----------------------------------------------------------------------
Here is an approach.
- like xino/xib, add a new file 'xigen' which stores aufs inode
generation.
- iget_locked(): initialize aufs inode generation for a new inode, and
store it in xigen file.
- destroy_inode(): increment aufs inode generation and store it in xigen
file. it is necessary even if it is not unlinked, because any data of
inode may be changed by UDBA.
- encode_fh(): for a root dir, simply return FILEID_ROOT. otherwise
build file handle by
+ branch id (4 bytes)
+ superblock generation (4 bytes)
+ inode number (4 or 8 bytes)
+ parent dir inode number (4 or 8 bytes)
+ inode generation (4 bytes))
+ return value of exportfs_encode_fh() for the parent on a branch (4
bytes)
+ file handle for a branch (by exportfs_encode_fh())
- fh_to_dentry():
+ find the index of a branch from its id in handle, and check it is
still exist in aufs.
+ 1st level: get the inode number from handle and search it in cache.
+ 2nd level: if not found in cache, get the parent inode number from
the handle and search it in cache. and then open the found parent
dir, find the matching inode number by vfs_readdir() and get its
name, and call lookup_one_len() for the target dentry.
+ 3rd level: if the parent dir is not cached, call
exportfs_decode_fh() for a branch and get the parent on a branch,
build a pathname of it, convert it a pathname in aufs, call
path_lookup(). now aufs gets a parent dir dentry, then handle it as
the 2nd level.
+ to open the dir, aufs needs struct vfsmount. aufs keeps vfsmount
for every branch, but not itself. to get this, (currently) aufs
searches in current->nsproxy->mnt_ns list. it may not be a good
idea, but I didn't get other approach.
+ test the generation of the gotten inode.
- every inode operation: they may get EBUSY due to UDBA. in this case,
convert it into ESTALE for NFSD.
- readdir(): call lockdep_on/off() because filldir in NFSD calls
lookup_one_len(), vfs_getattr(), encode_fh() and others.

View File

@ -0,0 +1,52 @@
# Copyright (C) 2005-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Show Whiteout Mode (shwh)
----------------------------------------------------------------------
Generally aufs hides the name of whiteouts. But in some cases, to show
them is very useful for users. For instance, creating a new middle layer
(branch) by merging existing layers.
(borrowing aufs1 HOW-TO from a user, Michael Towers)
When you have three branches,
- Bottom: 'system', squashfs (underlying base system), read-only
- Middle: 'mods', squashfs, read-only
- Top: 'overlay', ram (tmpfs), read-write
The top layer is loaded at boot time and saved at shutdown, to preserve
the changes made to the system during the session.
When larger changes have been made, or smaller changes have accumulated,
the size of the saved top layer data grows. At this point, it would be
nice to be able to merge the two overlay branches ('mods' and 'overlay')
and rewrite the 'mods' squashfs, clearing the top layer and thus
restoring save and load speed.
This merging is simplified by the use of another aufs mount, of just the
two overlay branches using the 'shwh' option.
# mount -t aufs -o ro,shwh,br:/livesys/overlay=ro+wh:/livesys/mods=rr+wh \
aufs /livesys/merge_union
A merged view of these two branches is then available at
/livesys/merge_union, and the new feature is that the whiteouts are
visible!
Note that in 'shwh' mode the aufs mount must be 'ro', which will disable
writing to all branches. Also the default mode for all branches is 'ro'.
It is now possible to save the combined contents of the two overlay
branches to a new squashfs, e.g.:
# mksquashfs /livesys/merge_union /path/to/newmods.squash
This new squashfs archive can be stored on the boot device and the
initramfs will use it to replace the old one at the next boot.

View File

@ -0,0 +1,47 @@
# Copyright (C) 2010-2019 Junjiro R. Okajima
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
Dynamically customizable FS operations
----------------------------------------------------------------------
Generally FS operations (struct inode_operations, struct
address_space_operations, struct file_operations, etc.) are defined as
"static const", but it never means that FS have only one set of
operation. Some FS have multiple sets of them. For instance, ext2 has
three sets, one for XIP, for NOBH, and for normal.
Since aufs overrides and redirects these operations, sometimes aufs has
to change its behaviour according to the branch FS type. More importantly
VFS acts differently if a function (member in the struct) is set or
not. It means aufs should have several sets of operations and select one
among them according to the branch FS definition.
In order to solve this problem and not to affect the behaviour of VFS,
aufs defines these operations dynamically. For instance, aufs defines
dummy direct_IO function for struct address_space_operations, but it may
not be set to the address_space_operations actually. When the branch FS
doesn't have it, aufs doesn't set it to its address_space_operations
while the function definition itself is still alive. So the behaviour
itself will not change, and it will return an error when direct_IO is
not set.
The lifetime of these dynamically generated operation object is
maintained by aufs branch object. When the branch is removed from aufs,
the reference counter of the object is decremented. When it reaches
zero, the dynamically generated operation object will be freed.
This approach is designed to support AIO (io_submit), Direct I/O and
XIP (DAX) mainly.
Currently this approach is applied to address_space_operations for
regular files only.

View File

@ -907,7 +907,11 @@ tcp_limit_output_bytes - INTEGER
limits the number of bytes on qdisc or device to reduce artificial limits the number of bytes on qdisc or device to reduce artificial
RTT/cwnd and reduce bufferbloat. RTT/cwnd and reduce bufferbloat.
#if defined(CONFIG_SYNO_LSP_RTD1619B)
Default: 262144
#else /* CONFIG_SYNO_LSP_RTD1619B */
Default: 1048576 (16 * 65536) Default: 1048576 (16 * 65536)
#endif /* CONFIG_SYNO_LSP_RTD1619B */
tcp_challenge_ack_limit - INTEGER tcp_challenge_ack_limit - INTEGER
Limits number of Challenge ACK sent per second, as recommended Limits number of Challenge ACK sent per second, as recommended

View File

@ -3009,6 +3009,19 @@ F: include/linux/audit.h
F: include/uapi/linux/audit.h F: include/uapi/linux/audit.h
F: kernel/audit* F: kernel/audit*
AUFS (advanced multi layered unification filesystem) FILESYSTEM
M: "J. R. Okajima" <hooanon05g@gmail.com>
L: aufs-users@lists.sourceforge.net (members only)
L: linux-unionfs@vger.kernel.org
S: Supported
W: http://aufs.sourceforge.net
T: git://github.com/sfjro/aufs5-linux.git
F: Documentation/ABI/testing/debugfs-aufs
F: Documentation/ABI/testing/sysfs-aufs
F: Documentation/filesystems/aufs/
F: fs/aufs/
F: include/uapi/linux/aufs_type.h
AUXILIARY DISPLAY DRIVERS AUXILIARY DISPLAY DRIVERS
M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com> M: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
S: Maintained S: Maintained

View File

@ -465,6 +465,8 @@ LZ4 = lz4c
XZ = xz XZ = xz
ZSTD = zstd ZSTD = zstd
PAHOLE_FLAGS = $(shell PAHOLE=$(PAHOLE) $(srctree)/scripts/pahole-flags.sh)
CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \
-Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF) -Wbitwise -Wno-return-void -Wno-unknown-attribute $(CF)
NOSTDINC_FLAGS := NOSTDINC_FLAGS :=
@ -518,6 +520,7 @@ export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE export KBUILD_AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE export KBUILD_AFLAGS_MODULE KBUILD_CFLAGS_MODULE KBUILD_LDFLAGS_MODULE
export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL export KBUILD_AFLAGS_KERNEL KBUILD_CFLAGS_KERNEL
export PAHOLE_FLAGS
# Files to ignore in find ... statements # Files to ignore in find ... statements

71
SynoBuildConf/_env Normal file
View File

@ -0,0 +1,71 @@
#!/usr/bin/env bash
# Copyright (c) 2000-2020 Synology Inc. All rights reserved.
[ -z "$__INCLUDE_ENV__" ] || return
readonly __INCLUDE_ENV__=defined
export ARCH="${ARCH:=x86_64}"
export CROSS_COMPILE="${ToolChainPrefix:=}"
export KCFLAGS="-fdiagnostics-color=always -Werror"
_init()
{
C_INFO="\e[1;32m"
C_WARN="\e[1;33m"
C_ERROR="\e[1;31m"
C_CLEAR="\e[m"
# simple alternatives of utilities from lnxscripts
local _func
for _func in INFO ERROR WARNING; do
if ! type -p "$_func"; then
eval "$_func() { echo \"[$_func] \$*\"; }"
fi
done
}
INFO()
{
echo -e "[${C_INFO:-}INFO${C_CLEAR:-}] $*"
}
WARNING()
{
echo -e "[${C_WARN:-}WARNING${C_CLEAR:-}] $*"
}
ERROR()
{
echo -e "[${C_ERROR:-}Error${C_CLEAR:-}] $*"
}
env_check_command() # $1: command
{
if ! command -v "$1" &>/dev/null; then
ERROR "'$1' is not found"
return 1
fi
}
env_detect_clang()
{
env_check_command "clang"
}
env_detect_llvm()
{
env_check_command "lld" # FIXME
}
env_enable_clang()
{
export CC="clang"
}
env_enable_llvm()
{
export LLVM=1
}
_init

255
SynoBuildConf/_kconfig Normal file
View File

@ -0,0 +1,255 @@
#!/usr/bin/env bash
# Copyright (c) 2000-2020 Synology Inc. All rights reserved.
[ -z "$__INCLUDE_KCONFIG__" ] || return
readonly __INCLUDE_KCONFIG__=defined
# shellcheck source=/dev/null
source "SynoBuildConf/_platform"
kconfig_check_diff()
{
local _plat_config="synology/synoconfigs/$PLATFORM_ABBR"
[ -f ".debug" ] && return
if ! diff -bu "$_plat_config" .config; then
ERROR "There's difference between $_plat_config & .config"
ERROR "Please reconfirm your modifications before committing."
return 1
fi
}
kconfig_check_syno_macro()
{
local _m
declare -A syno_kconfig=()
# collect syno macros from all kconfigs
for _m in $(find . -name "Kconfig*" -exec grep "config SYNO" {} + | cut -d' ' -f2); do
syno_kconfig[$_m]=
done
# all syno macros should be defined in kconfig.
# toolkit: ds.epyc7002-7.2.env
# toolchain: epyc7002-gcc1220_glibc236_x86_64-GPL (Not used)
find . \( -path './.git' -o -path './SynoBuildConf' -o -path './ds.*' -o -path './drivers/syno' \) -prune -o -type f -exec \
grep -rohE --exclude="*.patch" "[/]*((#ifdef)|(#defined))[[:space:]]*\(?CONFIG_SYNO([[:alnum:]]|_)*" {} + \
| grep -v "^//" \
| awk -F 'CONFIG_' '{ print $2 }' \
| while IFS= read -r _m
do
if [[ ! -v syno_kconfig[$_m] ]]; then
ERROR "'$_m' isn't defined in kconfig"
return 1
fi
done
# '#ifndef CONFIG_SYNO*' isn't allowed.
# toolkit: ds.epyc7002-7.2.env
# toolchain: epyc7002-gcc1220_glibc236_x86_64-GPL (Not used)
if find . \( -path './.git' -o -path './SynoBuildConf' -o -path './ds.*' -o -path './drivers/syno' \) -prune -o -type f -exec \
grep -roE "ifndef[[:space:]]*CONFIG_SYNO" {} +; then
ERROR "'#ifndef' isn't allowed with syno macros"
return 1
fi
# all syno macros should start with prefix SYNO_
# toolkit: ds.epyc7002-7.2.env
# toolchain: epyc7002-gcc1220_glibc236_x86_64-GPL (Not used)
if find . \( -path './.git' -o -path './SynoBuildConf' -o -path './ds.*' -o -path './drivers/syno' \) -prune -o -type f -exec \
grep -roE "((ifdef)|(defined))[[:space:]]*\(?SYNO([[:alnum:]]|_)*" {} + \
| grep -v -e SYNO_EXPORT_CONFIG -e SYNO_FS_SYNO_ACL; then
ERROR "all syno macros should start with prefix SYNO_"
return 1
fi
}
kconfig_debug_mode()
{
local _cfg=
local _enabled="
#
# printk and dmesg options
#
CONFIG_DYNAMIC_DEBUG
#
# Memory Debugging
#
CONFIG_DEBUG_PAGEALLOC
CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT
CONFIG_PAGE_OWNER
CONFIG_PAGE_POISONING
#CONFIG_DEBUG_OBJECTS
#CONFIG_DEBUG_OBJECTS_FREE
#CONFIG_DEBUG_OBJECTS_TIMERS
#CONFIG_DEBUG_OBJECTS_WORK
#CONFIG_DEBUG_OBJECTS_RCU_HEAD
#CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER
CONFIG_SLUB_DEBUG_ON
CONFIG_SLUB_STATS
#CONFIG_DEBUG_KMEMLEAK
CONFIG_DEBUG_STACK_USAGE
#CONFIG_DEBUG_VM
#CONFIG_DEBUG_VM_VMACACHE
#CONFIG_DEBUG_VM_RB
#CONFIG_DEBUG_VIRTUAL
#CONFIG_DEBUG_NOMMU_REGIONS
#CONFIG_DEBUG_MEMORY_INIT
#CONFIG_MEMORY_NOTIFIER_ERROR_INJECT
#CONFIG_DEBUG_PER_CPU_MAPS
#CONFIG_DEBUG_HIGHMEM
#CONFIG_DEBUG_STACKOVERFLOW
#
# Kernel address sanitizer (Kasan)
#
CONFIG_KASAN
CONFIG_KASAN_OUTLINE
CONFIG_KASAN_VMALLOC
#CONFIG_KASAN_INLINE
#
# Debug Lockups and Hangs
#
#CONFIG_SCHED_STACK_END_CHECK
#CONFIG_DEBUG_TIMEKEEPING
#CONFIG_TIMER_STATS
#
# Lock Debugging
#
CONFIG_DEBUG_SPINLOCK
CONFIG_DEBUG_MUTEXES
CONFIG_DEBUG_LOCK_ALLOC
CONFIG_PROVE_LOCKING
CONFIG_LOCK_STAT
CONFIG_DEBUG_ATOMIC_SLEEP
CONFIG_LOCKDEP
#CONFIG_TRACE_IRQFLAGS
#CONFIG_DEBUG_KOBJECT
#CONFIG_DEBUG_KOBJECT_RELEASE
#CONFIG_DEBUG_LIST
#CONFIG_DEBUG_PI_LIST
#CONFIG_DEBUG_SG
#CONFIG_DEBUG_NOTIFIERS
#CONFIG_DEBUG_CREDENTIALS
#
# RCU Debugging
#
#CONFIG_PROVE_RCU
#CONFIG_PROVE_RCU_REPEATEDLY
#CONFIG_RCU_TRACE
#
# Fault-injection framework
#
CONFIG_FAULT_INJECTION
CONFIG_FAILSLAB
CONFIG_FAIL_PAGE_ALLOC
CONFIG_FAIL_MAKE_REQUEST
CONFIG_FAIL_IO_TIMEOUT
#CONFIG_FAIL_MMC_REQUEST
#CONFIG_FAIL_FUTEX
CONFIG_FAULT_INJECTION_DEBUG_FS
CONFIG_FAIL_FUNCTION
#CONFIG_FAULT_INJECTION_STACKTRACE_FILTER
#CONFIG_LATENCYTOP
#CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
#
# Trace
#
#CONFIG_FUNCTION_TRACER
#CONFIG_FUNCTION_GRAPH_TRACER
#CONFIG_IRQSOFF_TRACER
#CONFIG_PREEMPT_TRACER
#CONFIG_ENABLE_DEFAULT_TRACERS
#CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP
#CONFIG_BRANCH_PROFILE_NONE
#CONFIG_PROFILE_ANNOTATED_BRANCHES
#CONFIG_PROFILE_ALL_BRANCHES
#CONFIG_STACK_TRACER
#CONFIG_DYNAMIC_FTRACE
#CONFIG_FUNCTION_PROFILER
#CONFIG_MMIOTRACE
#
# Btrfs
#
CONFIG_BTRFS_FS_RUN_SANITY_TESTS
#CONFIG_BTRFS_DEBUG
CONFIG_BTRFS_ASSERT
#CONFIG_BTRFS_FS_REF_VERIFY
"
local _disabled="
"
./scripts/config --set-val CONFIG_CONSOLE_LOGLEVEL_DEFAULT 7
./scripts/config --set-val CONFIG_MESSAGE_LOGLEVEL_DEFAULT 7
while read -r _cfg; do
if [ -z "$_cfg" ] || [[ "$_cfg" =~ .*"#".* ]]; then
continue
fi
INFO "Enable $_cfg"
./scripts/config --enable "$_cfg"
done <<< "$_enabled"
while read -r _cfg; do
if [ -z "$_cfg" ] || [[ "$_cfg" =~ .*"#".* ]]; then
continue
fi
INFO "Disable $_cfg"
./scripts/config --disable "$_cfg"
done <<< "$_disabled"
# disable KASAN for non-x64 platform due to MTD size
if [ "$PLATFORM_FAMILY" != "SYNOPLAT_F_X86_64" ]; then
./scripts/config --disable CONFIG_KASAN
./scripts/config --disable CONFIG_DEBUG_SPINLOCK
./scripts/config --disable CONFIG_DEBUG_MUTEXES
./scripts/config --disable CONFIG_DEBUG_LOCK_ALLOC
./scripts/config --disable CONFIG_PROVE_LOCKING
./scripts/config --disable CONFIG_LOCK_STAT
./scripts/config --disable CONFIG_DEBUG_ATOMIC_SLEEP
./scripts/config --disable CONFIG_LOCKDEP
fi
}
kconfig_generate()
{
if [ -z "$PLATFORM_ABBR" ]; then
ERROR "environment variable 'PLATFORM_ABBR' isn't assigned"
return 1
fi
cp -f "synology/synoconfigs/$PLATFORM_ABBR" .config
if [ -f ".debug" ]; then
INFO "File '.debug' is detected. Configured as debug mode."
kconfig_debug_mode
make olddefconfig
else
make oldconfig
fi
}
kconfig_check_rule()
{
if ! (cd synology/synoconfigs-spec/ || return 1; rake test) > /dev/null; then
ERROR "kernel configs don't match the rules."
ERROR "please check them with 'rake test' in synology/synoconfigs-spec"
return 1
fi
}

770
SynoBuildConf/_modules Normal file
View File

@ -0,0 +1,770 @@
#!/usr/bin/env bash
# Copyright (c) 2000-2020 Synology Inc. All rights reserved.
# shellcheck disable=SC2034
[ -z "$__INCLUDE_MODULE__" ] || return
readonly __INCLUDE_MODULE__=defined
mod_crypto="
crypto/ansi_cprng.ko
crypto/cbc.ko
crypto/des_generic.ko
crypto/ecb.ko
crypto/cmac.ko
crypto/hmac.ko
crypto/md4.ko
crypto/md5.ko
crypto/sha256_generic.ko
crypto/cts.ko
crypto/seqiv.ko
crypto/gcm.ko
crypto/ccm.ko
crypto/ghash-generic.ko
crypto/ctr.ko
crypto/cryptd.ko
crypto/gf128mul.ko
crypto/lrw.ko
crypto/echainiv.ko
crypto/xxhash_generic.ko
lib/crypto/libdes.ko
lib/crypto/libsha256.ko
lib/crypto/libarc4.ko
crypto/zstd.ko
crypto/lzo-rle.ko
crypto/lzo.ko
"
mod_fs_misc="
fs/fat/fat.ko
fs/fat/vfat.ko
fs/hfsplus/hfsplus.ko
drivers/md/dm-flakey.ko
"
mod_fs_enc="
fs/ecryptfs/ecryptfs.ko
"
mod_fs_fuse="
fs/fuse/fuse.ko
"
mod_fs_iso="
drivers/block/loop.ko
fs/isofs/isofs.ko
fs/udf/udf.ko
lib/crc-itu-t.ko
"
mod_net_bonding="
drivers/net/bonding/bonding.ko
"
mod_appletalk="
net/802/psnap.ko
net/802/p8022.ko
net/appletalk/appletalk.ko
net/llc/llc.ko
"
mod_net_firewall="
net/ipv4/netfilter/ip_tables.ko
net/netfilter/xt_REDIRECT.ko
net/ipv4/netfilter/iptable_filter.ko
net/ipv4/netfilter/iptable_nat.ko
net/ipv4/netfilter/nf_defrag_ipv4.ko
net/netfilter/nf_nat.ko
net/netfilter/nf_conntrack.ko
net/netfilter/x_tables.ko
net/netfilter/xt_multiport.ko
net/netfilter/xt_state.ko
net/netfilter/xt_tcpudp.ko
net/netfilter/xt_LOG.ko
net/netfilter/xt_limit.ko
net/netfilter/xt_iprange.ko
net/netfilter/xt_recent.ko
net/netfilter/nfnetlink.ko
net/netfilter/nfnetlink_queue.ko
net/netfilter/ipset/ip_set.ko
net/netfilter/ipset/ip_set_hash_ip.ko
net/netfilter/xt_set.ko
net/netfilter/xt_nat.ko
net/netfilter/xt_TCPMSS.ko
net/netfilter/xt_MASQUERADE.ko
net/netfilter/xt_mac.ko
net/netfilter/xt_policy.ko
"
mod_ipv6_firewall="
net/ipv6/netfilter/ip6_tables.ko
net/ipv6/netfilter/ip6table_filter.ko
net/ipv6/netfilter/nf_defrag_ipv6.ko
net/netfilter/xt_LOG.ko
"
mod_ipv6="
net/ipv6/ipv6.ko
"
mod_net_ppp="
drivers/net/ppp/ppp_async.ko
drivers/net/ppp/ppp_generic.ko
drivers/net/ppp/ppp_synctty.ko
drivers/net/ppp/pppox.ko
drivers/net/ppp/pppoe.ko
drivers/net/ppp/bsd_comp.ko
drivers/net/ppp/ppp_deflate.ko
drivers/net/ppp/ppp_mppe.ko
drivers/net/ppp/pptp.ko
net/l2tp/l2tp_core.ko
net/l2tp/l2tp_ppp.ko
net/ipv4/gre.ko
drivers/net/slip/slhc.ko
drivers/tty/n_hdlc.ko
lib/crc-ccitt.ko
"
mod_net_tunnel="
drivers/net/tun.ko
"
mod_iscsi="
drivers/scsi/libiscsi.ko
drivers/scsi/libiscsi_tcp.ko
drivers/scsi/iscsi_tcp.ko
"
mod_fs_nfsd="
fs/nfsd/nfsd.ko
fs/nfs_common/grace.ko
fs/lockd/lockd.ko
net/sunrpc/sunrpc.ko
net/sunrpc/auth_gss/auth_rpcgss.ko
net/sunrpc/auth_gss/rpcsec_gss_krb5.ko
"
mod_fs_nfs="
fs/nfs/nfs.ko
fs/nfs/nfsv2.ko
fs/nfs/nfsv3.ko
fs/nfs/nfsv4.ko
fs/nfs_common/nfs_ssc.ko
"
mod_fs_cifs="
fs/cifs/cifs.ko
"
mod_scsi="
drivers/scsi/sg.ko
"
mod_dm_snapshot="
drivers/md/dm-bufio.ko
drivers/md/dm-snapshot.ko
"
mod_sound="
sound/soundcore.ko
"
mod_usb_printer="
drivers/usb/class/usblp.ko
"
mod_usb="
drivers/hid/hid.ko
drivers/hid/hid-generic.ko
drivers/hid/usbhid/usbhid.ko
drivers/usb/host/uhci-hcd.ko
drivers/usb/host/xhci-hcd.ko
drivers/usb/host/xhci-pci.ko
drivers/usb/common/usb-common.ko
drivers/usb/core/usbcore.ko
drivers/usb/storage/usb-storage.ko
drivers/usb/storage/uas.ko
drivers/usb/class/cdc-acm.ko
"
mod_usb_ehci="
drivers/usb/host/ehci-hcd.ko
drivers/usb/host/ehci-pci.ko
"
mod_usb_ip="
drivers/usb/usbip/usbip-host.ko
drivers/usb/usbip/usbip-core.ko
"
mod_usb_wimax="
drivers/net/usb/usbnet.ko
drivers/net/usb/cdc_ether.ko
"
mod_usb_alsa="
sound/usb/snd-usbmidi-lib.ko
sound/usb/snd-usb-audio.ko
sound/core/snd-hwdep.ko
sound/core/snd-rawmidi.ko
sound/usb/hiface/snd-usb-hiface.ko
"
mod_usb_rtk="
drivers/usb/phy/phy-rtk-usb3.ko
drivers/usb/phy/phy-rtk-usb2.ko
drivers/usb/dwc3/dwc3_rtk.ko
drivers/usb/dwc3/dwc3.ko
drivers/usb/host/xhci-plat-hcd.ko
drivers/soc/realtek/common/rtk-usb-manager.ko
"
mod_sound_alsa="
sound/core/snd-pcm.ko
sound/core/snd-seq-device.ko
sound/core/snd.ko
sound/core/oss/snd-pcm-oss.ko
sound/core/oss/snd-mixer-oss.ko
sound/core/snd-timer.ko
"
mod_docker="
drivers/net/macvlan.ko
drivers/net/veth.ko
drivers/net/vxlan.ko
net/bridge/br_netfilter.ko
net/ipv4/udp_tunnel.ko
net/ipv6/ip6_udp_tunnel.ko
net/netfilter/xt_addrtype.ko
net/netfilter/xt_conntrack.ko
fs/aufs/aufs.ko
fs/overlayfs/overlay.ko
"
mod_raid="
drivers/md/dm-mod.ko
drivers/md/dm-raid.ko
drivers/md/linear.ko
drivers/md/raid0.ko
drivers/md/raid10.ko
drivers/md/raid456.ko
lib/raid6/raid6_pq.ko
crypto/async_tx/async_tx.ko
crypto/async_tx/async_memcpy.ko
crypto/async_tx/async_xor.ko
crypto/async_tx/async_pq.ko
crypto/async_tx/async_raid6_recov.ko
crypto/xor.ko
"
mod_ipv6_tunnel="
net/ipv4/ip_tunnel.ko
net/ipv4/tunnel4.ko
net/ipv6/sit.ko
"
mod_net_filter="
net/netfilter/nfnetlink.ko
net/netfilter/nfnetlink_queue.ko
net/netfilter/xt_NFQUEUE.ko
"
mod_cpufreq="
drivers/cpufreq/acpi-cpufreq.ko
drivers/cpufreq/cpufreq_performance.ko
drivers/cpufreq/cpufreq_powersave.ko
"
mod_net_bridge="
net/bridge/bridge.ko
net/802/stp.ko
"
mod_net_tc="
net/sched/sch_htb.ko
net/sched/sch_sfq.ko
net/sched/cls_fw.ko
net/sched/sch_netem.ko
net/netfilter/xt_mark.ko
net/ipv4/netfilter/iptable_mangle.ko
net/ipv6/netfilter/ip6table_mangle.ko
net/sched/cls_u32.ko
"
mod_net_fw_security="
net/netfilter/nf_conntrack_pptp.ko
net/ipv4/netfilter/nf_nat_pptp.ko
"
mod_net_vlan="
net/8021q/8021q.ko
"
mod_net_ipsec="
crypto/authenc.ko
crypto/authencesn.ko
net/ipv4/ah4.ko
net/ipv4/esp4.ko
net/ipv4/ipcomp.ko
net/ipv4/xfrm4_tunnel.ko
net/ipv4/tunnel4.ko
net/ipv4/udp_tunnel.ko
net/ipv4/xfrm4_tunnel.ko
net/xfrm/xfrm_algo.ko
net/xfrm/xfrm_user.ko
net/xfrm/xfrm_ipcomp.ko
net/ipv6/ah6.ko
net/ipv6/esp6.ko
net/ipv6/ipcomp6.ko
net/ipv6/xfrm6_tunnel.ko
net/ipv6/tunnel6.ko
net/ipv6/ip6_udp_tunnel.ko
net/ipv6/xfrm6_tunnel.ko
net/key/af_key.ko
"
mod_zram="
drivers/block/zram/zram.ko
"
mod_vaapi="
drivers/gpu/drm/drm.ko
arch/x86/video/fbdev.ko
drivers/video/fbdev/core/fb.ko
drivers/video/fbdev/core/fb_sys_fops.ko
drivers/video/fbdev/core/sysimgblt.ko
drivers/video/fbdev/core/sysfillrect.ko
drivers/video/fbdev/core/syscopyarea.ko
drivers/gpu/drm/drm_kms_helper.ko
drivers/video/fbdev/core/cfbcopyarea.ko
drivers/video/fbdev/core/cfbimgblt.ko
drivers/video/fbdev/core/cfbfillrect.ko
drivers/acpi/button.ko
drivers/video/backlight/backlight.ko
drivers/acpi/video.ko
drivers/gpu/drm/i915/i915.ko
arch/x86/platform/intel/iosf_mbi.ko
drivers/gpu/drm/drm_panel_orientation_quirks.ko
"
mod_kvm="
virt/lib/irqbypass.ko
arch/x86/kvm/kvm.ko
arch/x86/kvm/kvm-intel.ko
drivers/pci/pci-stub.ko
"
mod_vfio="
drivers/vfio/vfio.ko
drivers/vfio/vfio_iommu_type1.ko
drivers/vfio/pci/vfio-pci.ko
drivers/vfio/vfio_virqfd.ko
"
mod_net_openvswitch="
net/openvswitch/openvswitch.ko
net/mpls/mpls_gso.ko
net/nsh/nsh.ko
"
mod_usb_serial="
drivers/usb/serial/usbserial.ko
drivers/usb/serial/ftdi_sio.ko
"
mod_led_lp3943="
drivers/leds/leds-lp3943.ko
"
mod_led_atmega1608="
drivers/leds/leds-atmega1608.ko
"
mod_led_atmega1608_seg7="
drivers/leds/leds-atmega1608-seg7.ko
"
mod_i2c="
drivers/i2c/algos/i2c-algo-bit.ko
"
mod_fs_btrfs_cp="
fs/syno_cache_protection/syno_cache_protection.ko
"
mod_fs_btrfs="
fs/btrfs/btrfs.ko
lib/zstd/zstd_compress.ko
"
mod_crypto_intel="
crypto/crypto_simd.ko
arch/x86/crypto/glue_helper.ko
arch/x86/crypto/aesni-intel.ko
"
mod_hwmon_disk_pwctl="
drivers/hwmon/syno_hddmon.ko
"
mod_virtio="
drivers/block/virtio_blk.ko
drivers/char/virtio_console.ko
drivers/char/hw_random/virtio-rng.ko
drivers/net/virtio_net.ko
drivers/net/net_failover.ko
drivers/scsi/virtio_scsi.ko
drivers/virtio/virtio.ko
drivers/virtio/virtio_balloon.ko
drivers/virtio/virtio_mmio.ko
drivers/virtio/virtio_pci.ko
drivers/virtio/virtio_ring.ko
net/9p/9pnet_virtio.ko
net/core/failover.ko
"
mod_dca="
drivers/dca/dca.ko
"
mod_hwmon_adt="
drivers/hwmon/adt7475.ko
"
mod_net_console="
drivers/net/netconsole.ko
"
mod_ntb="
drivers/ntb/ntb.ko
drivers/ntb/hw/intel/ntb_hw_intel.ko
drivers/ntb/ntb_transport.ko
drivers/net/ntb_netdev.ko
"
mod_ntb_brd="
drivers/block/ntb_brd.ko
"
mod_docker_ingress="
net/netfilter/ipvs/ip_vs.ko
net/netfilter/ipvs/ip_vs_rr.ko
net/netfilter/xt_ipvs.ko
"
mod_scsi_fc="\
drivers/scsi/scsi_transport_fc.ko
drivers/scsi/libfc/libfc.ko
"
mod_acpi="\
drivers/acpi/button.ko
"
mod_dm_multipath="\
drivers/md/dm-multipath.ko
drivers/md/dm-round-robin.ko
drivers/md/dm-queue-length.ko
drivers/md/dm-service-time.ko
"
mod_fc="\
drivers/scsi/scsi_transport_fc.ko
drivers/scsi/libfc/libfc.ko
"
mod_bnx2x="\
drivers/net/ethernet/emulex/benet/be2net.ko
"
mod_cpufreq_rtk="
drivers/cpufreq/cpufreq_performance.ko
drivers/cpufreq/cpufreq_powersave.ko
"
mod_dm_crypt="\
drivers/md/dm-crypt.ko
crypto/essiv.ko
"
mod_ceph="\
drivers/block/rbd.ko \
net/ceph/libceph.ko \
fs/ceph/ceph.ko \
"
declare -A _mapping_idx=(
[KVMX64]=2
[GEMINILAKE]=3
[V1000]=4
[BROADWELL]=5
[BROADWELLNK]=6
[BROADWELLNTB]=7
[BROADWELLNTBAP]=8
[DENVERTON]=9
[APOLLOLAKE]=10
[REALTEK_RTD1296]=11
[PURLEY]=12
[MARVELL_ARMADA37XX]=13
[COFFEELAKE]=14
[NEXTKVMX64]=15
[REALTEK_RTD1619]=16
[SKYLAKED]=17
[KVMCLOUD]=18
[REALTEK_RTD1619B]=19
[ICELAKED]=20
[EPYC7002]=21
[EPYC7002SOFS]=22
[V1000SOFS]=23
[KVMX64SOFS]=24
[RYZEN5K]=25
[EPYC7003NTB]=26
[KVMX64V2]=27
)
_mapping="
# Please add modules-platform mappings in this array map
# Platform aliases:
# KVM: KVMX64
# GML: GEMINILAKE
# V1K: V1000
# BRW: BROADWELL
# BRN: BROADWELLNK
# BNT: BROADWELLNTB
# BAP: BROADWELLNTBAP
# DNV: DENVERTON
# APL: APOLLOLAKE
# R96: REALTEK_RTD1296
# PUR: PURLEY
# A37: MARVELL_ARMADA37XX
# CFL: COFFEELAKE
# NXT: NEXTKVMX64
# R19: REALTEK_RTD1619
# SKL: SKYLAKED
# KCL: KVMCLOUD
# ICXD: ICELAKED
# EPC2: EPYC7002
# EPSO: EPYC7002SOFS
# VSO: V1000SOFS
# KVSO: KVMX64SOFS
# R5K: RYZEN5K
# EPC3N: EPYC7003NTB
# KV2: KVMX64V2
# Modules KVM GML V1K BRW BRN BNT BAP DNV APL R96 PUR A37 CFL NXT R19 SKL KCL R19B ICXD EPC2 EPSO VSO KVSO R5K EPC3N KV2
mod_crypto o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_crypto_intel o o o o o o o o o x o x o o x o o x o o o o o o o o
mod_fs_misc o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_fs_enc o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_fs_fuse o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_fs_iso o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_fs_nfsd o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_fs_nfs o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_fs_cifs o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_fs_btrfs o o o o o o o o o o o x o o o o o o o o o o o o o o
mod_fs_btrfs_cp x x x x x x o x x x x x x x x x x x x x x x x x x x
mod_appletalk o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_net_bonding o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_net_firewall o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_net_ppp o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_net_tunnel o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_net_filter o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_net_bridge o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_net_tc o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_net_fw_security o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_net_vlan o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_net_ipsec o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_net_openvswitch o o o o o o o o o x o o o o x o o x o o o o o o o o
mod_net_console x o o o o x x o o x o o o x x o x x o o o o x o o x # XXX: need review ??
mod_ipv6 o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_ipv6_firewall o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_ipv6_tunnel o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_iscsi o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_scsi o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_scsi_fc x x x o o o x x x x o x x x x x x x o o o x x o o x
mod_sound o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_sound_alsa o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_raid o o o o o o o o o o o o o o o o o o o o o o o o o o
mod_cpufreq o o o o o o o o o x o x o o x o o x o o o o o o o o
mod_zram o o o o o o o o o o o o o o x o o x o o o o o o o o # XXX: why not installed in REALTEK_RTD1619 ??
mod_vaapi x o x x x x x x o x x x x x x x x x x x x o x x x x
mod_kvm x o x o o o o o o x o x o o x o x x x x x o x x x x
mod_virtio o x x x x x x x x x x x x o x x o x x x x x o x x o
# Modules KVM GML V1K BRW BRN BNT BAP DNV APL R96 PUR A37 CFL NXT R19 SKL KCL R19B ICXD EPC2 EPSO VSO KVSO R5k EPC3N KV2
mod_usb o o o o o o o o o o o o o o o o x o o o o o o o o o
mod_usb_printer o o o o o o o o o o o o o o o o x o o o o o o o o o
mod_usb_ehci o o o x x o o o o o o o o o o o x o o o o o o o o o # XXX: not consistent in broadwell/kvm series ??
mod_usb_ip o o o o o o o o o o o o o o o o x o o o o o o o o o
mod_usb_wimax o o o o o o o o o o o o o o o o x o o o o o o o o o # deprecated
mod_usb_serial o o o o o o o o o o o o o o o o x o o o o o o o o o
mod_usb_alsa o o o o o o o o o o o o o o o o x o o o o o o o o o
mod_led_lp3943 x o o o o o o o o x o x o x x x x x x x x o x x x x # XXX: need review ??
mod_led_atmega1608 x x o x x x x x x x o x x x x x x x o o o o x o o x
mod_led_atmega1608_seg7 x x o x x x x x x x o x x x x x x x o o o o x o x x
mod_vfio x o o o o o x o o x o x o o x o x x o o o o o o o x # XXX: need review ??
mod_i2c o o x o o o o o o x o x o o x o x x o o o x o o o o
mod_hwmon_adt x x o o o o o x x x x x o x x x x x o o o o x o o x
mod_hwmon_disk_pwctl x o o o o o o o o o x o o x o x x o x x x o x x x x # XXX: need review ??
mod_dca x x x o o o o x x x x x o x x x x x o x x x x x x x
mod_ntb x x x x x o o x x x x x x x x x x x x x x x x x x x
mod_ntb_brd x x x x x x o x x x x x x x x x x x x x x x x x x x
mod_docker o o o o o o o o o o o o o o o o o o o o o o o o o o # deprecated
mod_docker_ingress o o o o o o o o o x o x o o x o o o o o o o o o o o
mod_acpi x x x x x x x x x x x x x x x x o x x x x x x x x x
mod_dm_multipath x x x x x x x x x x o x x x x x x x x x x x x x x x
mod_dm_snapshot o o o o o o o o o o o o o o o o o o o o o o o o o o # deprecated
mod_fc x x x o o o o x x x o x x x x x x x o o o x x o o x
mod_usb_rtk x x x x x x x x x x x x x x x x x o x x x x x x x x
mod_bnx2x o x x o x x x x x x o x x x x x x x o o o x o o o o
mod_cpufreq_rtk x x x x x x x x x x x x x x x x x o x x x x x x x x
mod_dm_crypt o o o o o o o o o x o x o o x o o x o o o o o o o o
mod_ceph x x x x x x x x x x x x x x x x x x x x o o o x x x
"
modules_customized()
{
local _modules
case "$BUILD_TARGET" in
KVMX64)
_modules="
drivers/i2c/busses/i2c-i801.ko
drivers/dma/ioat/ioatdma.ko
drivers/hwmon/adt7475.ko
drivers/dca/dca.ko
drivers/net/mdio.ko
lib/zlib_deflate/zlib_deflate.ko
drivers/net/ethernet/intel/igbvf/igbvf.ko
"
;;
KVMX64SOFS)
_modules="
drivers/i2c/busses/i2c-i801.ko
drivers/dma/ioat/ioatdma.ko
drivers/hwmon/adt7475.ko
drivers/dca/dca.ko
drivers/net/mdio.ko
lib/zlib_deflate/zlib_deflate.ko
drivers/net/ethernet/intel/igbvf/igbvf.ko
"
;;
KVMX64V2)
_modules="
drivers/i2c/busses/i2c-i801.ko
drivers/dma/ioat/ioatdma.ko
drivers/hwmon/adt7475.ko
drivers/dca/dca.ko
drivers/net/mdio.ko
lib/zlib_deflate/zlib_deflate.ko
drivers/net/ethernet/intel/igbvf/igbvf.ko
"
;;
BROADWELL)
_modules="
drivers/net/mdio.ko
"
;;
PURLEY)
_modules="
drivers/dma/ioat/ioatdma.ko
drivers/hwmon/adt7475.ko
drivers/dca/dca.ko
drivers/scsi/mpt3sas/mpt3sas.ko
"
;;
GEMINILAKE)
;;
V1000)
_modules="
drivers/hwmon/hwmon-vid.ko
virt/lib/irqbypass.ko
arch/x86/kvm/kvm.ko
arch/x86/kvm/kvm-amd.ko
drivers/pci/pci-stub.ko
drivers/hwmon/syno_smbus_hddmon.ko
drivers/net/phy/marvell10g.ko
drivers/net/ethernet/amd/xgbe/amd-xgbe.ko
lib/synolib/syno_uart2spi_logout.ko
"
;;
V1000SOFS)
_modules="
drivers/hwmon/hwmon-vid.ko
virt/lib/irqbypass.ko
arch/x86/kvm/kvm.ko
arch/x86/kvm/kvm-amd.ko
drivers/pci/pci-stub.ko
drivers/hwmon/syno_smbus_hddmon.ko
drivers/net/phy/marvell10g.ko
drivers/net/ethernet/amd/xgbe/amd-xgbe.ko
lib/synolib/syno_uart2spi_logout.ko
"
;;
REALTEK_RTD1619B)
_modules="
arch/arm64/lib/xor-neon.ko
"
;;
ICELAKED)
;;
EPYC7002)
_modules="
drivers/hwmon/hwmon-vid.ko
virt/lib/irqbypass.ko
arch/x86/kvm/kvm.ko
arch/x86/kvm/kvm-amd.ko
drivers/pci/pci-stub.ko
"
;;
EPYC7002SOFS)
_modules="
drivers/hwmon/hwmon-vid.ko
virt/lib/irqbypass.ko
arch/x86/kvm/kvm.ko
arch/x86/kvm/kvm-amd.ko
drivers/pci/pci-stub.ko
"
;;
RYZEN5K)
_modules="
drivers/hwmon/hwmon-vid.ko
"
;;
EPYC7003NTB)
_modules="
drivers/hwmon/hwmon-vid.ko
virt/lib/irqbypass.ko
arch/x86/kvm/kvm.ko
arch/x86/kvm/kvm-amd.ko
drivers/pci/pci-stub.ko
drivers/ntb/ntb.ko
drivers/ntb/hw/amd/ntb_hw_amd.ko
drivers/ntb/ntb_transport.ko
drivers/net/ntb_netdev.ko
"
;;
esac
printf "%s" "$_modules"
}
module_list()
{
local _line _modules _install _idx
while read -r _line; do
[[ "$_line" =~ ^[[:blank:]]*(#.*)?$ ]] && continue
_idx="${_mapping_idx[${BUILD_TARGET:?undefined}]}"
_modules="$(echo "$_line" | awk "{ print \$1 }")"
_install="$(echo "$_line" | awk "{ print \$$_idx }")"
# shellcheck disable=SC2086
[ "$_install" = "o" ] && printf "%s " ${!_modules}
done <<< "$_mapping"
while read -r _line; do
printf "%s " "$_line"
done <<< "$(modules_customized)"
}

72
SynoBuildConf/_platform Normal file
View File

@ -0,0 +1,72 @@
#!/usr/bin/env bash
# Copyright (c) 2000-2020 Synology Inc. All rights reserved.
[ -z "$__INCLUDE_PLATFORM__" ] || return
readonly __INCLUDE_PLATFORM__=defined
# shellcheck source=/dev/null
source "SynoBuildConf/_env"
platform_target()
{
case $PLATFORM_FAMILY in
SYNOPLAT_F_X86_64)
echo "bzImage"
;;
SYNOPLAT_F_ARMV8)
echo "Image.lzma"
;;
esac
}
# displayed image name should be matched with the result of
# platform_customize_image()
platform_image_name()
{
[ -f ".config" ] || return
if [ "$PLATFORM_FAMILY" = "SYNOPLAT_F_X86_64" ]; then
make -s image_name
elif [ "$PLATFORM_FAMILY" = "SYNOPLAT_F_ARMV8" ]; then
make -s image_name
else
echo "ENOENT"
fi
}
# shellcheck disable=SC2154
platform_customize_rtd1619b_mango_image()
{
# shellcheck disable=SC2043
for model in mango; do
DTBIMG="${KernelDir}/arch/arm64/boot/dts/realtek/rtd-1619b-synology-${model}.dtb"
mkdir -p "${DebDevBuild}/image/files/sds-sii/dtbs/synology_rtd1619bmango_${model}/"
cp -vf "${DTBIMG}" "${DebDevBuild}/image/files/sds-sii/dtbs/synology_rtd1619bmango_${model}/model-vendor.dtb"
done
}
# shellcheck disable=SC2154
platform_customize_rtd1619b_image()
{
# shellcheck disable=SC2043
for model in ds223j ds423 ds223 ds124; do
DTBIMG="${KernelDir}/arch/arm64/boot/dts/realtek/rtd-1619b-synology-${model}.dtb"
mkdir -p "${DebDevBuild}/image/files/sds-sii/dtbs/synology_rtd1619b_${model}/"
cp -vf "${DTBIMG}" "${DebDevBuild}/image/files/sds-sii/dtbs/synology_rtd1619b_${model}/model-vendor.dtb"
done
}
# some platforms such as REALTEK_RTD1296, may need customized kernel image.
# please leave your customization here.
platform_customize_image()
{
if [ "$PLATFORM_FAMILY" = "SYNOPLAT_F_X86_64" ]; then
: # do nothing
elif [ "$BUILD_TARGET" = "REALTEK_RTD1619B" ]; then
platform_customize_rtd1619b_image
else
: # customized by platform later
fi
}

123
SynoBuildConf/build Normal file
View File

@ -0,0 +1,123 @@
#!/usr/bin/env bash
# Copyright (c) 2000-2020 Synology Inc. All rights reserved.
# shellcheck source=/dev/null
source "SynoBuildConf/_env"
source "SynoBuildConf/_kconfig"
case ${MakeClean:-} in
[Yy][Ee][Ss])
make distclean
;;
esac
case ${CleanOnly:-} in
[Yy][Ee][Ss])
return
;;
esac
build_public_key()
{
# shellcheck disable=SC2154
# lnxscripts/include/applyEnv: SysRootInclude="${ToolChainSysRoot}/usr/include"
# lnxscripts/include/platforms: KernelDir="/source/${SYNO_KERNEL_SOURCE_DIR}"
if [ "$PLATFORM_FAMILY" = "SYNOPLAT_F_X86_64" ]; then
ln -fsv "$SysRootInclude/hydrogen/hydrogen.h" "$KernelDir/include/crypto/hydrogen.h"
ln -fsv "$SysRootInclude/hydrogen/hydrogen.c" "$KernelDir/crypto/hydrogen/hydrogen.c"
ln -fsv "$SysRootInclude/hydrogen/impl" "$KernelDir/crypto/hydrogen/impl"
sed -i "s/__RAMDISK_SIGN_PUBLIC_KEY__/$(cat < "$ScriptsDir/config/rd_sign.pub" | xxd -i -c 32)/" \
"$KernelDir/init/initramfs.c"
fi
}
build_certification()
{
ln -fsv "$ScriptsDir/config/signing_key.pem" "$KernelDir/synology/certs/signing_key.pem"
ln -fsv "$ScriptsDir/config/trusted_certificates.pem" "$KernelDir/synology/certs/trusted_certificates.pem"
}
build_seed()
{
# shellcheck disable=SC2154
# lnxscripts/include/platforms: KernelDir="/source/${SYNO_KERNEL_SOURCE_DIR}"
if [ "$PLATFORM_FAMILY" = "SYNOPLAT_F_X86_64" ]; then
DECOMPRESSION_TYPE=$(shuf -i 1001-2147483647 -n 1)
sed -i "s/__DECOMPRESSION_TYPE__/${DECOMPRESSION_TYPE}/" \
"${KernelDir}/arch/x86/boot/compressed/head_64.S"
sed -i "s/__DECOMPRESSION_TYPE__/${DECOMPRESSION_TYPE}/" \
"${KernelDir}/lib/synolib/syno_kexec_test.c"
fi
}
build_version()
{
local _protect_ver _dsm_ver
if [ -f "${VERSION_FILE:-/source/synoversion/VERSION}" ]; then
# originally ".version" is updated by scripts/link-vmlinux.sh
# we forcely overwrite it with DSM build number at every build.
echo $(($(GetDSMBuildNumber) - 1)) > ".version"
fi
[ -f ".debug" ] || return
_protect_ver="$(dpkg -l | grep "synoprotection-$PLATFORM_ABBR-" | awk '{print $3}' | cut -d'-' -f2 | head -n1)"
_dsm_ver="$(GetDSMBuildNumber)"
if [ -z "$_protect_ver" ]; then
ERROR "Unable to detect dpkg 'synoprotection'"
exit 1
fi
if [ "$_dsm_ver" != "$_protect_ver" ]; then
ERROR "buildnumber in synoversion/VERSION doesn't match dpkg 'synoprotection'"
exit 1
fi
}
# shellcheck disable=SC2086
build_kernel()
{
[ -f ".config" ] || return 1
make prepare $MAKE_FLAGS
make vmlinux $MAKE_FLAGS
make modules $MAKE_FLAGS
make "$(platform_target)" $MAKE_FLAGS
}
# shellcheck disable=SC2086
build_device_tree()
{
# Usually only arm platform needs this action
if [ "$BUILD_TARGET" = "REALTEK_RTD1619B" ]; then
make $MAKE_FLAGS dtbs
fi
}
INFO "Generate .config for architecture $ARCH platform $PLATFORM_ABBR"
kconfig_generate
# INFO "Copying signing_key and certification from build system"
# build_certification
# build_public_key
# build_seed
build_version
INFO "Build Synology linux kernel $(make -s kernelversion)"
build_kernel
INFO "Build device tree"
build_device_tree
INFO "Compare kernel config with re-generated one"
kconfig_check_diff
INFO "Check Synology kernel configs"
kconfig_check_syno_macro
kconfig_check_rule

View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Copyright (c) 2000-2020 Synology Inc. All rights reserved.
# shellcheck source=/dev/null
source "SynoBuildConf/_env"
source "SynoBuildConf/_kconfig"
kconfig_generate
make prepare
make headers_install
# `make headers_install` will deploy all headers (*.h) in "include/uapi" and
# "arch/$ARCH/include/uapi'. Please *DO NOT* copy the files one by one. Just
# place your headers at the right location.

View File

@ -0,0 +1,28 @@
#!/bin/bash
# Copyright (c) 2000-2022 Synology Inc. All rights reserved.
# shellcheck disable=SC2154
build_turbostat()
{
# shellcheck disable=SC2086
if [ "$PLATFORM_FAMILY" = "SYNOPLAT_F_X86_64" ]; then
case "$MakeClean" in
[Yy][Ee][Ss])
make turbostat_clean -C tools
;;
esac
make $MAKE_FLAGS turbostat -C tools
fi
}
case "$CleanOnly" in
[Yy][Ee][Ss])
return
;;
esac
env CC="$CC" CXX="$CXX" LD="$LD" AR="$AR" RANLIB="$RANLIB" NM="$NM" STRIP="$STRIP" \
CROSS_COMPILE="$ToolChainPrefix" LDFLAGS="$LDFLAGS" \
build_turbostat

1
SynoBuildConf/conflict Normal file
View File

@ -0,0 +1 @@
linux-5.10.x="linux-4.4.x"

View File

@ -0,0 +1 @@
linux-5.10.x-virtual-headers="linux-4.4.x-virtual-headers"

2
SynoBuildConf/depends Normal file
View File

@ -0,0 +1,2 @@
[BuildDependent]
libhydrogen

View File

@ -0,0 +1,3 @@
[BuildDependent-Tag]
${KernelHeaders}
libcap-2.x

3
SynoBuildConf/error Normal file
View File

@ -0,0 +1,3 @@
{
"warning:" : [" locale ", "dpkg: warning:"]
}

201
SynoBuildConf/gitlab-ci Normal file
View File

@ -0,0 +1,201 @@
#!/usr/bin/env bash
# Copyright (c) 2000-2020 Synology Inc. All rights reserved.
# shellcheck source=/dev/null
source "SynoBuildConf/_env"
source "SynoBuildConf/_kconfig"
unset ARCH CROSS_COMPILE
ci_help()
{
cat <<-EOF
Usage:
$(basename "$0") <command>
Commands:
config
prepare
check-patch
check-sparse
check-smatch
check-syno-macro
check-syno-script
check-clang-format-diff
build-tools
build-ci-image
build-btf-image
EOF
}
ci_config()
{
cp -f "synology/synoconfigs/fst-ci-config" .config
make olddefconfig
}
ci_prepare()
{
[ -f ".config" ] || return 1
make prepare
}
ci_check_sparse()
{
env_check_command "sparse" || return
make C=2 CHECK="$(command -v 'sparse')" -j "$(nproc)"
}
ci_check_patch()
{
if git remote show origin &>/dev/null; then
./scripts/checkpatch.pl -g origin/HEAD..HEAD
else
./scripts/checkpatch.pl -g HEAD~1..HEAD
fi
}
ci_check_smatch()
{
env_check_command "smatch" || return
make C=2 CHECK="$(command -v 'smatch') -p=kernel" -j "$(nproc)"
}
ci_check_coccinelle()
{
env_check_command "spatch" || return
make coccicheck MODE=report
}
ci_check_syno_script()
{
local _f
env_check_command "shellcheck" || return
while IFS= read -r _f; do
if ! shellcheck "$_f"; then
ERROR "'$_f' doesn't honor shellcheck"
return 1
fi
done < <(find SynoBuildConf/ -regex '.*/\(gitlab-ci\|build.*\|install.*\|_.*\)';
find synology/systemd/ -regex '.*/.*\.sh';)
}
ci_check_syno_macro()
{
kconfig_check_syno_macro
}
ci_check_clang_format_diff()
{
env_check_command "clang-format-diff" || return
local _diff
if git remote show origin &>/dev/null; then
_diff="$(git diff -U0 --no-color origin/HEAD..HEAD | clang-format-diff -p1)"
else
_diff="$(git diff -U0 --no-color HEAD~1..HEAD | clang-format-diff -p1)"
fi
if [ -n "$_diff" ]; then
echo "$_diff"
return 1
fi
}
ci_build_tools()
{
local _tools _tool _failed
# you need to install lots of dependency ...
_tools="
acpi
bpf
cgroup
cpupower
debugging
firewire
firmware
freefall
gpio
hv
iio
intel-speed-select
leds
#liblockdep
objtool
pci
perf
#selftests
spi
tmon
turbostat
usb
#virtio
libapi
vm
wmi
x86_energy_perf_policy
"
if env_detect_clang && env_detect_llvm; then
env_enable_clang
env_enable_llvm
INFO "Build with LLVM/Clang"
fi
# FIXME: workaround for tools/bpf/runqslower bad detection
export VMLINUX_BTF="../../../vmlinux"
while read -r _tool; do
[[ "$_tool" =~ ^[[:blank:]]*(#.*)?$ ]] && continue
INFO "Build tools/$_tool"
if ! make "tools/$_tool"; then
_failed="$_failed $_tool"
fi
done <<< "$_tools"
if [ -n "$_failed" ]; then
ERROR "failed to build tools: $_failed"
return 1
fi
}
ci_build_ci_image()
{
make olddefconfig
make vmlinux modules -j "$(nproc)"
}
ci_build_btf_image()
{
if env_detect_clang && env_detect_llvm; then
env_enable_clang
env_enable_llvm
INFO "Build with LLVM/Clang"
fi
# vmlinux with BTF is required for tools/bpf
./scripts/config --enable CONFIG_DEBUG_INFO_BTF
make olddefconfig
make vmlinux modules -j "$(nproc)"
}
if [ -z "$1" ]; then
ci_help
elif type -p "ci_${1//-/_}"; then
cmd="${1//-/_}"; shift
ci_"$cmd" "$@"
else
ERROR "Command $1 not found"
fi

386
SynoBuildConf/install Normal file
View File

@ -0,0 +1,386 @@
#!/usr/bin/env bash
# Copyright (c) 2000-2020 Synology Inc. All rights reserved.
# shellcheck source=/dev/null
source "SynoBuildConf/_env"
TmpInstDir="${TmpInstDir:-/tmp/_install}"
# Auto generate bootup insert module list config into /lib/modules-load.d/
SYNOAutoGenerateModulesConfig () {
local _install_list=${1}
local _insert_list=${2}
local _config_name=${3}
local _mod=""
local _mod_path=""
if [ -f ".synotmp-${_config_name}" ];then
rm -f ".synotmp-${_config_name}"
fi
for _mod in ${_insert_list};
do
_mod_path="/${_mod}.ko"
# Check the insert modules is really in install list
if [[ ${_install_list} == *${_mod_path}* ]]; then
echo "${_mod}" >> ".synotmp-${_config_name}"
else
echo "Error: insert module [${_mod}] not in install list"
fi
done
if [ -f ".synotmp-${_config_name}" ];then
install -Dm644 ".synotmp-${_config_name}" "${KERNEL_MODULES_CONFIG_PATH}/${_config_name}"
fi
}
install_systemd_units()
{
KERNEL_MODULES_CONFIG_PATH=${TmpInstDir}/lib/modules-load.d
IPV6_COMMON_LIST="ipv6 ip_tunnel tunnel4 sit"
CRYPTO_MODULES_X86_64_COMMON_LIST="cbc md5 cts ansi_cprng des_generic authenc ecb sha256_generic cryptd libarc4 aesni-intel lzo lzo-rle zstd"
CPUFREQ_MODULES_X86_64_COMMON_LIST="acpi-cpufreq cpufreq_performance cpufreq_powersave"
MISC_MODULES_X86_64_COMMON_LIST="hmac md4 hfsplus llc p8022 psnap crc-ccitt crc-itu-t dm-bufio dm-snapshot sg loop essiv dm-crypt"
MISC_MODULES_ARM_64_COMMON_LIST="hmac md4 hfsplus llc p8022 psnap crc-ccitt crc-itu-t dm-bufio dm-snapshot sg loop"
USB_MODULES_COMMON_LIST="usb-common usbcore xhci-hcd"
# shellcheck disable=SC2154
if [ ! -f "$ConfDir/_modules" ]; then
echo "Error: Cannot find ${KERNEL_MODULES_TABLE} for generate insert modules list."
return
fi
# get platform $ModuleList
source "$ConfDir/_modules"
ModuleList=$(module_list)
[ -d "${KERNEL_MODULES_CONFIG_PATH}" ] || install -d "${KERNEL_MODULES_CONFIG_PATH}"
# Set the white list on each platform, please not use global white list
case ${BUILD_TARGET} in
KVMX64)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
MISC_MODULES_LIST=${MISC_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} ehci-hcd ehci-pci uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
NETWORK_MODULES="be2net igbvf"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${NETWORK_MODULES}" "70-network-kernel.conf"
;;
KVMX64SOFS)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
MISC_MODULES_LIST=${MISC_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} ehci-hcd ehci-pci uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
NETWORK_MODULES="be2net igbvf"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${NETWORK_MODULES}" "70-network-kernel.conf"
;;
KVMX64V2)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
MISC_MODULES_LIST=${MISC_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} ehci-hcd ehci-pci uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
NETWORK_MODULES="be2net igbvf"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${NETWORK_MODULES}" "70-network-kernel.conf"
;;
BROADWELL)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
CPUFREQ_MODULES_LIST=${CPUFREQ_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CPUFREQ_MODULES_LIST}" "70-cpufreq-kernel.conf"
MISC_MODULES_LIST=${MISC_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
NETWORK_MODULES="be2net"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${NETWORK_MODULES}" "70-network-kernel.conf"
;;
PURLEY)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
CPUFREQ_MODULES_LIST=${CPUFREQ_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CPUFREQ_MODULES_LIST}" "70-cpufreq-kernel.conf"
MISC_MODULES_LIST="${MISC_MODULES_X86_64_COMMON_LIST}"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} ehci-hcd ehci-pci uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
NETWORK_MODULES="be2net"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${NETWORK_MODULES}" "70-network-kernel.conf"
;;
GEMINILAKE)
# Auto generate video driver conf into /lib/modules-load.d/video.conf
VIDEO_DRIVER_LIST="i2c-algo-bit button backlight video fbdev fb iosf_mbi drm_panel_orientation_quirks drm cfbimgblt cfbcopyarea cfbfillrect fb_sys_fops sysimgblt sysfillrect syscopyarea drm_kms_helper i915"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VIDEO_DRIVER_LIST}" "70-video-kernel.conf"
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
CPUFREQ_MODULES_LIST=${CPUFREQ_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CPUFREQ_MODULES_LIST}" "70-cpufreq-kernel.conf"
MISC_MODULES_LIST=${MISC_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} ehci-hcd ehci-pci uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
;;
V1000)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
CPUFREQ_MODULES_LIST=${CPUFREQ_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CPUFREQ_MODULES_LIST}" "70-cpufreq-kernel.conf"
MISC_MODULES_LIST=${MISC_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} ehci-hcd ehci-pci uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
NET_DRIVER_MODULES_LIST="marvell10g amd-xgbe"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${NET_DRIVER_MODULES_LIST}" "70-net-kernel.conf"
;;
V1000SOFS)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
CPUFREQ_MODULES_LIST=${CPUFREQ_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CPUFREQ_MODULES_LIST}" "70-cpufreq-kernel.conf"
MISC_MODULES_LIST=${MISC_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} ehci-hcd ehci-pci uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
NET_DRIVER_MODULES_LIST="marvell10g amd-xgbe"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${NET_DRIVER_MODULES_LIST}" "70-net-kernel.conf"
;;
REALTEK_RTD1619B)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST="lrw md4 ansi_cprng hmac des_generic cts md5 ghash-generic cbc ecb sha256_generic echainiv cmac ccm seqiv ctr libarc4"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
CPUFREQ_MODULES_LIST="cpufreq_performance cpufreq_powersave"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CPUFREQ_MODULES_LIST}" "70-cpufreq-kernel.conf"
MISC_MODULES_LIST=${MISC_MODULES_ARM_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} dwc3 xhci-pci xhci-plat-hcd phy-rtk-usb2 phy-rtk-usb3 dwc3_rtk rtk-usb-manager cdc-acm"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
;;
ICELAKED)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
CPUFREQ_MODULES_LIST=${CPUFREQ_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CPUFREQ_MODULES_LIST}" "70-cpufreq-kernel.conf"
MISC_MODULES_LIST="${MISC_MODULES_X86_64_COMMON_LIST}"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} ehci-hcd ehci-pci uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
NETWORK_MODULES="be2net"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${NETWORK_MODULES}" "70-network-kernel.conf"
;;
EPYC7002)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
CPUFREQ_MODULES_LIST=${CPUFREQ_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CPUFREQ_MODULES_LIST}" "70-cpufreq-kernel.conf"
MISC_MODULES_LIST="${MISC_MODULES_X86_64_COMMON_LIST}"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} ehci-hcd ehci-pci uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
NETWORK_MODULES="be2net"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${NETWORK_MODULES}" "70-network-kernel.conf"
;;
EPYC7002SOFS)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
CPUFREQ_MODULES_LIST=${CPUFREQ_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CPUFREQ_MODULES_LIST}" "70-cpufreq-kernel.conf"
MISC_MODULES_LIST="${MISC_MODULES_X86_64_COMMON_LIST}"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} ehci-hcd ehci-pci uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
NETWORK_MODULES="be2net"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${NETWORK_MODULES}" "70-network-kernel.conf"
;;
RYZEN5K)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
CPUFREQ_MODULES_LIST=${CPUFREQ_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CPUFREQ_MODULES_LIST}" "70-cpufreq-kernel.conf"
MISC_MODULES_LIST="${MISC_MODULES_COMMON_LIST}"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} ehci-hcd ehci-pci uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
NETWORK_MODULES="be2net"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${NETWORK_MODULES}" "70-network-kernel.conf"
;;
EPYC7003NTB)
IPV6_LIST=${IPV6_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${IPV6_LIST}" "70-ipv6-kernel.conf"
CRYPTO_MODULES_LIST=${CRYPTO_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CRYPTO_MODULES_LIST}" "70-crypto-kernel.conf"
CPUFREQ_MODULES_LIST=${CPUFREQ_MODULES_X86_64_COMMON_LIST}
SYNOAutoGenerateModulesConfig "${ModuleList}" "${CPUFREQ_MODULES_LIST}" "70-cpufreq-kernel.conf"
MISC_MODULES_LIST="${MISC_MODULES_X86_64_COMMON_LIST}"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${MISC_MODULES_LIST}" "70-misc-kernel.conf"
USB_MODULES_LIST="${USB_MODULES_COMMON_LIST} ehci-hcd ehci-pci uhci-hcd"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${USB_MODULES_LIST}" "70-usb-kernel.conf"
VXLAN_MODULES="ip_tunnel udp_tunnel ip6_udp_tunnel vxlan"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${VXLAN_MODULES}" "69-docker-vxlan.conf"
NETWORK_MODULES="be2net"
SYNOAutoGenerateModulesConfig "${ModuleList}" "${NETWORK_MODULES}" "70-network-kernel.conf"
;;
*)
;;
esac
}
# module configs in /lib/modules-load.d
install_module_configs()
{
SYSTEMD_UNIT_DIR="${TmpInstDir}/lib/systemd/system"
SYSTEMD_UNIT_SCRIPT_DIR="${TmpInstDir}/usr/syno/lib/systemd/scripts"
# install services unit of kernel module to systemd
[ -d "${SYSTEMD_UNIT_DIR}" ] || install -d "${SYSTEMD_UNIT_DIR}"
[ -d "${SYSTEMD_UNIT_DIR}"/sysinit.target.wants ] || install -d "${SYSTEMD_UNIT_DIR}"/sysinit.target.wants
[ -d "${SYSTEMD_UNIT_SCRIPT_DIR}" ] || install -d "${SYSTEMD_UNIT_SCRIPT_DIR}"
install -m644 synology/systemd/syno-kernel-modules-load.service "${SYSTEMD_UNIT_DIR}"
install -m755 synology/systemd/syno-kernel-modules-load.sh "${SYSTEMD_UNIT_SCRIPT_DIR}"
ln -s ../syno-kernel-modules-load.service "${SYSTEMD_UNIT_DIR}"/sysinit.target.wants/syno-kernel-modules-load.service
install -m644 synology/systemd/syno-fan-modules-load.service "${SYSTEMD_UNIT_DIR}"
install -m755 synology/systemd/syno-fan-modules-load.sh "${SYSTEMD_UNIT_SCRIPT_DIR}"
ln -s ../syno-fan-modules-load.service "${SYSTEMD_UNIT_DIR}"/sysinit.target.wants/syno-fan-modules-load.service
}
INFO "Install systemd units"
install_systemd_units
INFO "Install kernel module configs"
install_module_configs

89
SynoBuildConf/install-dev Normal file
View File

@ -0,0 +1,89 @@
#!/usr/bin/env bash
# Copyright (c) 2000-2020 Synology Inc. All rights reserved.
# shellcheck source=/dev/null
source "SynoBuildConf/_env"
source "SynoBuildConf/_modules"
source "SynoBuildConf/_platform"
DebDevBuild="${DebDevBuild:-/deb/build}"
install_dev_image()
{
local _image
# FIXME: moved to build ?
platform_customize_image
_image="$(platform_image_name)"
if [ -z "$_image" ]; then
ERROR "image '$_image' not found"
return 1
fi
install -Dm644 "$_image" "$DebDevBuild/image/zImage"
install -Dm644 "vmlinux" "$DebDevBuild/image/synodebug/vmlinux"
install -Dm644 "System.map" "$DebDevBuild/image/synodebug/System.map"
install -Dm644 "Module.symvers" "$DebDevBuild/image/synodebug/Module.symvers"
}
install_dev_modules()
{
if [ ! -f "modules.order" ]; then
ERROR "'modules.order' not found"
return 1
fi
local _mod _mod_name
declare -A _built_modules
while read -r _mod; do
_built_modules["$_mod"]=
done < "modules.order"
for _mod in $(module_list); do
if [ ! -f "$_mod" ]; then
WARNING "Not found: $_mod"
continue
fi
unset "_built_modules[$_mod]"
_mod_name="$(basename "$_mod")"
install -Dm644 "$_mod" "$DebDevBuild/image/modules/$_mod_name"
install -Dm644 "$_mod" "$DebDevBuild/image/modulesdebug/$_mod_name"
$STRIP -d "$DebDevBuild/image/modules/$_mod_name"
done
for _mod in "${!_built_modules[@]}"; do
WARNING "Not installed: $_mod"
done
}
install_dev_kernel_devel()
{
# shellcheck source=/dev/null
source "${ScriptsDir:-}/include/kernel-devel"
# FIXME: get rid of "${ScriptsDir:-}/include/kernel-devel"
# for kmsynoacl
install -Dm644 "fs/syno_acl.h" "$WRKDIR/fs/synoacl_int.h"
install -Dm644 "include/linux/syno_fs.h" "$WRKDIR/include/linux/syno_fs.h"
install -Dm644 "include/linux/syno_gpio.h" "$WRKDIR/include/linux/syno_gpio.h"
install -Dm644 "include/linux/syno_fdt.h" "$WRKDIR/include/linux/syno_fdt.h"
install -Dm755 "scripts/sign-file" "${DebDevBuild}/usr/syno/bin/sign-file"
}
INFO "Install kernel image for packing and debugging"
install_dev_image
INFO "Install kernel modules for packing and debugging"
install_dev_modules
INFO "Install stuff for kernel module development"
install_dev_kernel_devel

View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
# Copyright (c) 2000-2020 Synology Inc. All rights reserved.
mkdir -p "${DebDevBuild:?undefined}/DEBIAN/"
for _inc in ${ToolChainInclude32:=} ${ToolChainInclude64:=} ${StaticInclude32:=} ${StaticInclude64:=}; do
for _kinc in $(find "usr/include/"* -maxdepth 0 -type d -print | cut -d'/' -f3); do
mkdir -p "$DebDevBuild/$_inc/$_kinc"
cp -a "usr/include/$_kinc/"* "$DebDevBuild/$_inc/$_kinc"
done
done

View File

@ -0,0 +1,27 @@
#!/bin/bash
# shellcheck disable=SC2154
if [ -e "${KernelDir}/lib/synolib/syno_sata_signal_check.ko" ]; then
install -Dm644 "${KernelDir}"/lib/synolib/syno_sata_signal_check.ko "${TmpInstDir}"/lib/modules/syno_sata_signal_check.ko
fi
if [ -e "${KernelDir}/lib/synolib/syno_sata_signal_test.ko" ]; then
install -Dm644 "${KernelDir}"/lib/synolib/syno_sata_signal_test.ko "${TmpInstDir}"/lib/modules/syno_sata_signal_test.ko
fi
if [ -e "${KernelDir}/lib/synolib/syno_jmb585_update_spi.ko" ]; then
install -Dm644 "${KernelDir}"/lib/synolib/syno_jmb585_update_spi.ko "${TmpInstDir}"/lib/modules/syno_jmb585_update_spi.ko
fi
if [ -e "${KernelDir}/lib/synolib/asm116xfwdl/asm116xfwdl.ko" ]; then
install -Dm644 "${KernelDir}"/lib/synolib/asm116xfwdl/asm116xfwdl.ko "${TmpInstDir}"/lib/modules/asm116xfwdl.ko
fi
if [ -e "${KernelDir}/lib/synolib/syno_hddpwrctl_test.ko" ]; then
install -Dm644 "${KernelDir}"/lib/synolib/syno_hddpwrctl_test.ko "${TmpInstDir}"/lib/modules/syno_hddpwrctl_test.ko
fi
if [ -e "${KernelDir}/lib/synolib/syno_ahci_reg_read_test.ko" ]; then
install -Dm644 "${KernelDir}"/lib/synolib/syno_ahci_reg_read_test.ko "${TmpInstDir}"/lib/modules/syno_ahci_reg_read_test.ko
fi
exit 0

View File

@ -0,0 +1,11 @@
#!/bin/bash
cpufreq_modules="freq_table cpufreq_stats cpufreq thermal_sys processor mperf acpi-cpufreq cpufreq_ondemand cpufreq_performance cpufreq_powersave cpufreq_conservative"
# shellcheck disable=SC2154
for module_name in $cpufreq_modules; do
module=$(find . -name "${module_name}".ko)
[ -e "${module}" ] && install -Dm644 "${module}" "${TmpInstDir}/lib/modules/${module_name}.ko"
done
exit 0

View File

@ -0,0 +1,11 @@
#!/bin/bash
# shellcheck disable=SC2154
if [ "$PLATFORM_FAMILY" != "SYNOPLAT_F_X86_64" ]; then
SkipThisProject
return
fi
if [ -e "tools/power/x86/turbostat/turbostat" ]; then
install -Dm755 tools/power/x86/turbostat/turbostat "${TmpInstDir}"/turbostat
fi

1
SynoBuildConf/shellcheck Normal file
View File

@ -0,0 +1 @@
dsm:

4
SynoBuildConf/version Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env bash
# Copyright (c) 2000-2020 Synology Inc. All rights reserved.
make -s kernelversion

View File

@ -1602,6 +1602,9 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)
rn = arm_bpf_get_reg32(src_lo, tmp2[1], ctx); rn = arm_bpf_get_reg32(src_lo, tmp2[1], ctx);
emit_ldx_r(dst, rn, off, ctx, BPF_SIZE(code)); emit_ldx_r(dst, rn, off, ctx, BPF_SIZE(code));
break; break;
/* speculation barrier */
case BPF_ST | BPF_NOSPEC:
break;
/* ST: *(size *)(dst + off) = imm */ /* ST: *(size *)(dst + off) = imm */
case BPF_ST | BPF_MEM | BPF_W: case BPF_ST | BPF_MEM | BPF_W:
case BPF_ST | BPF_MEM | BPF_H: case BPF_ST | BPF_MEM | BPF_H:

View File

@ -150,7 +150,11 @@ libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
# Default target when executing plain make # Default target when executing plain make
boot := arch/arm64/boot boot := arch/arm64/boot
ifeq ($(CONFIG_SYNO_RTD1619B), y)
KBUILD_IMAGE := $(boot)/Image.lzma
else # CONFIG_SYNO_RTD1619B
KBUILD_IMAGE := $(boot)/Image.gz KBUILD_IMAGE := $(boot)/Image.gz
endif # CONFIG_SYNO_RTD1619B
all: Image.gz all: Image.gz

View File

@ -13,3 +13,21 @@ dtb-$(CONFIG_ARCH_REALTEK) += rtd1395-bpi-m4.dtb
dtb-$(CONFIG_ARCH_REALTEK) += rtd1395-lionskin.dtb dtb-$(CONFIG_ARCH_REALTEK) += rtd1395-lionskin.dtb
dtb-$(CONFIG_ARCH_REALTEK) += rtd1619-mjolnir.dtb dtb-$(CONFIG_ARCH_REALTEK) += rtd1619-mjolnir.dtb
ifeq ($(CONFIG_SYNO_LSP_RTD1619B), y)
dtb-$(CONFIG_ARCH_REALTEK) += rtd1319-pymparticles-2gb.dtb
dtb-$(CONFIG_ARCH_REALTEK) += rtd1319-rescue.dtb
dtb-$(CONFIG_ARCH_REALTEK) += rtd1619b-bleedingedge-1gb-nas.dtb
dtb-$(CONFIG_ARCH_REALTEK) += rtd1619b-bleedingedge-2gb-spi.dtb
dtb-$(CONFIG_ARCH_REALTEK) += rtd1619b-bleedingedge-2gb.dtb
dtb-$(CONFIG_ARCH_REALTEK) += rtd1619b-bleedingedge-4gb.dtb
dtb-$(CONFIG_ARCH_REALTEK) += rtd1619b-rescue.dtb
endif # CONFIG_SYNO_LSP_RTD1619B
ifeq ($(CONFIG_SYNO_RTD1619B), y)
dtb-$(CONFIG_ARCH_REALTEK) += rtd-1619b-synology-ds223j.dtb
dtb-$(CONFIG_ARCH_REALTEK) += rtd-1619b-synology-ds423.dtb
dtb-$(CONFIG_ARCH_REALTEK) += rtd-1619b-synology-ds223.dtb
dtb-$(CONFIG_ARCH_REALTEK) += rtd-1619b-synology-ds124.dtb
dtb-$(CONFIG_ARCH_REALTEK) += rtd-1619b-synology-mango.dtb
endif # CONFIG_SYNO_RTD1619B

View File

@ -0,0 +1,155 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd1619b-bleedingedge.dtsi"
/ {
compatible = "realtek,bleeding-edge", "realtek,rtd1619b";
model = "Realtek Bleeding Edge EVB (1GB)";
memory@4000 {
device_type = "memory";
reg = <0x00040000 0x3ffc0000>; /* 1 GiB */
};
};
&pcie1 {
status = "disabled";
};
&pcie2 {
status = "disabled";
};
&sata_phy {
status = "okay";
};
&sata_phy0 {
tx-drv = <0x40ab2001>, <0x40ab6001>, <0x40aba001>,
<0x12601a01>, <0x12605a01>, <0x126b9a01>;
status = "okay";
};
&ahci_sata {
hostinit-mode = <1>;
status = "okay";
};
&sata_port0 {
status = "okay";
};
&rtk_pm {
wakeup-flags = <(LAN | GPIO | RTC | TIMER | CEC)>;
wakeup-gpio-list = <26 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_HIGH>;
wakeup-timer = <0>;
status = "okay";
};
&i2c_1 {
rtc@68 {
compatible = "pericom,pt7c4337";
reg = <0x68>;
wakeup-source;
};
};
&protected_mem {
status = "disabled";
};
&rpc_comm {
status = "disabled";
};
&rpc_ringbuf {
status = "disabled";
};
&video_fw_ve3 {
status = "disabled";
};
&audio_heap {
status = "disabled";
};
&media_heap {
status = "disabled";
};
&cma_resrved_1 {
status = "disabled";
};
&cma_resrved_2 {
status = "disabled";
};
&cma_resrved_3 {
status = "disabled";
};
&cma_resrved_4 {
status = "disabled";
};
&cma_resrved_5 {
status = "disabled";
};
&cma_resrved_6 {
status = "disabled";
};
&cma_resrved_7 {
status = "disabled";
};
&cma_resrved_8 {
status = "disabled";
};
&cma_resrved_9 {
status = "disabled";
};
&rtk_ion {
status = "disabled";
};
&tee {
status = "disabled";
};
&hifi {
status = "disabled";
};
&nic {
led-cfg = <0x17000F00>;
eee = <0>; /* 0: disable, 1: enable */
};
&rpc {
status = "disabled";
};
&rtk_fw_pm {
status = "disabled";
};
&reserved_memory {
ramoops@22000000 {
compatible = "ramoops";
reg = <0x22000000 0x00200000>;
console-size = <0x00100000>;
record-size = <0x00004000>;
ftrace-size = <0x00004000>;
};
};

View File

@ -0,0 +1,165 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd1619b-bleedingedge.dtsi"
/ {
compatible = "realtek,bleeding-edge", "realtek,rtd1619b";
model = "Realtek Bleeding Edge EVB (1GB)";
memory@4000 {
device_type = "memory";
reg = <0x00040000 0x7ffc0000>; /* 1 GB */
};
};
&pcie1 {
status = "disabled";
};
&pcie2 {
status = "disabled";
};
&sata_phy {
status = "okay";
};
&sata_phy0 {
tx-drv = <0x40ab2001>, <0x40ab6001>, <0x40aba001>,
<0x12601a01>, <0x12605a01>, <0x126b9a01>;
status = "okay";
};
&sata_phy1 {
tx-drv = <0x40ab2001>, <0x40ab6001>, <0x40ada001>,
<0x12601a01>, <0x12605a01>, <0x126a9a01>;
status = "okay";
};
&ahci_sata {
hostinit-mode = <1>;
status = "okay";
};
&sata_port0 {
status = "okay";
};
&sata_port1 {
status = "okay";
};
&rtk_pm {
wakeup-flags = <(LAN | GPIO | RTC | TIMER | CEC)>;
wakeup-gpio-list = <26 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_HIGH>;
wakeup-timer = <0>;
status = "okay";
};
&i2c_1 {
rtc@68 {
compatible = "pericom,pt7c4337";
reg = <0x68>;
wakeup-source;
};
};
&protected_mem {
status = "disabled";
};
&rpc_comm {
status = "disabled";
};
&rpc_ringbuf {
status = "disabled";
};
&video_fw_ve3 {
status = "disabled";
};
&audio_heap {
status = "disabled";
};
&media_heap {
status = "disabled";
};
&cma_resrved_1 {
status = "disabled";
};
&cma_resrved_2 {
status = "disabled";
};
&cma_resrved_3 {
status = "disabled";
};
&cma_resrved_4 {
status = "disabled";
};
&cma_resrved_5 {
status = "disabled";
};
&cma_resrved_6 {
status = "disabled";
};
&cma_resrved_7 {
status = "disabled";
};
&cma_resrved_8 {
status = "disabled";
};
&cma_resrved_9 {
status = "disabled";
};
&rtk_ion {
status = "disabled";
};
&tee {
status = "disabled";
};
&hifi {
status = "disabled";
};
&nic {
led-cfg = <0x17000F00>;
eee = <0>; /* 0: disable, 1: enable */
};
&rpc {
status = "disabled";
};
&rtk_fw_pm {
status = "disabled";
};
&reserved_memory {
ramoops@22000000 {
compatible = "ramoops";
reg = <0x22000000 0x00200000>;
console-size = <0x00100000>;
record-size = <0x00004000>;
ftrace-size = <0x00004000>;
};
};

View File

@ -0,0 +1,165 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd1619b-bleedingedge.dtsi"
/ {
compatible = "realtek,bleeding-edge", "realtek,rtd1619b";
model = "Realtek Bleeding Edge EVB (1GB)";
memory@4000 {
device_type = "memory";
reg = <0x00040000 0x3ffc0000>; /* 1 GiB */
};
};
&pcie1 {
status = "disabled";
};
&pcie2 {
status = "disabled";
};
&sata_phy {
status = "okay";
};
&sata_phy0 {
tx-drv = <0x40ab2001>, <0x40ab6001>, <0x40aba001>,
<0x12601a01>, <0x12605a01>, <0x12659a01>;
status = "okay";
};
&sata_phy1 {
tx-drv = <0x40ab2001>, <0x40ab6001>, <0x40aba001>,
<0x12601a01>, <0x12605a01>, <0x12609a01>;
status = "okay";
};
&ahci_sata {
hostinit-mode = <1>;
status = "okay";
};
&sata_port0 {
status = "okay";
};
&sata_port1 {
status = "okay";
};
&rtk_pm {
wakeup-flags = <(LAN | GPIO | RTC | TIMER | CEC)>;
wakeup-gpio-list = <26 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_HIGH>;
wakeup-timer = <0>;
status = "okay";
};
&i2c_1 {
rtc@68 {
compatible = "pericom,pt7c4337";
reg = <0x68>;
wakeup-source;
};
};
&protected_mem {
status = "disabled";
};
&rpc_comm {
status = "disabled";
};
&rpc_ringbuf {
status = "disabled";
};
&video_fw_ve3 {
status = "disabled";
};
&audio_heap {
status = "disabled";
};
&media_heap {
status = "disabled";
};
&cma_resrved_1 {
status = "disabled";
};
&cma_resrved_2 {
status = "disabled";
};
&cma_resrved_3 {
status = "disabled";
};
&cma_resrved_4 {
status = "disabled";
};
&cma_resrved_5 {
status = "disabled";
};
&cma_resrved_6 {
status = "disabled";
};
&cma_resrved_7 {
status = "disabled";
};
&cma_resrved_8 {
status = "disabled";
};
&cma_resrved_9 {
status = "disabled";
};
&rtk_ion {
status = "disabled";
};
&tee {
status = "disabled";
};
&hifi {
status = "disabled";
};
&nic {
led-cfg = <0x17000F00>;
eee = <0>; /* 0: disable, 1: enable */
};
&rpc {
status = "disabled";
};
&rtk_fw_pm {
status = "disabled";
};
&reserved_memory {
ramoops@22000000 {
compatible = "ramoops";
reg = <0x22000000 0x00200000>;
console-size = <0x00100000>;
record-size = <0x00004000>;
ftrace-size = <0x00004000>;
};
};

View File

@ -0,0 +1,163 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd1619b-bleedingedge.dtsi"
/ {
compatible = "realtek,bleeding-edge", "realtek,rtd1619b";
model = "Realtek Bleeding Edge EVB (2GB)";
memory@4000 {
device_type = "memory";
reg = <0x00040000 0x7ffc0000>; /* 1 GB */
};
};
&pcie1 {
perst-gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
status = "okay";
};
&pcie2 {
perst-gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
status = "okay";
};
&sata_phy {
status = "disabled";
};
&sata_phy0 {
status = "disabled";
};
&sata_phy1 {
status = "disabled";
};
&ahci_sata {
status = "disabled";
};
&sata_port0 {
status = "disabled";
};
&sata_port1 {
status = "disabled";
};
&rtk_pm {
wakeup-flags = <(LAN | GPIO | RTC | TIMER | CEC)>;
wakeup-gpio-list = <26 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_HIGH>;
wakeup-timer = <0>;
status = "okay";
};
&i2c_1 {
rtc@68 {
compatible = "pericom,pt7c4337";
reg = <0x68>;
wakeup-source;
};
};
&protected_mem {
status = "disabled";
};
&rpc_comm {
status = "disabled";
};
&rpc_ringbuf {
status = "disabled";
};
&video_fw_ve3 {
status = "disabled";
};
&audio_heap {
status = "disabled";
};
&media_heap {
status = "disabled";
};
&cma_resrved_1 {
status = "disabled";
};
&cma_resrved_2 {
status = "disabled";
};
&cma_resrved_3 {
status = "disabled";
};
&cma_resrved_4 {
status = "disabled";
};
&cma_resrved_5 {
status = "disabled";
};
&cma_resrved_6 {
status = "disabled";
};
&cma_resrved_7 {
status = "disabled";
};
&cma_resrved_8 {
status = "disabled";
};
&cma_resrved_9 {
status = "disabled";
};
&rtk_ion {
status = "disabled";
};
&tee {
status = "disabled";
};
&hifi {
status = "disabled";
};
&nic {
led-cfg = <0x17000F00>;
eee = <0>; /* 0: disable, 1: enable */
wol-enable = <1>;
};
&rpc {
status = "disabled";
};
&rtk_fw_pm {
status = "disabled";
};
&reserved_memory {
ramoops@22000000 {
compatible = "ramoops";
reg = <0x22000000 0x00200000>;
console-size = <0x00100000>;
record-size = <0x00004000>;
ftrace-size = <0x00004000>;
};
};

View File

@ -0,0 +1,178 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd1619b-bleedingedge.dtsi"
/ {
compatible = "realtek,bleeding-edge", "realtek,rtd1619b";
model = "Realtek Bleeding Edge EVB (1GB)";
memory@4000 {
device_type = "memory";
reg = <0x00040000 0x3ffc0000>; /* 1 GiB */
};
};
&pcie1 {
status = "disabled";
};
&pcie2 {
status = "disabled";
};
&sata_phy {
status = "okay";
};
&sata_phy0 {
tx-drv = <0x40ab2001>, <0x40ab6001>, <0x40aba001>,
<0x12601a01>, <0x12605a01>, <0x126b9a01>;
status = "okay";
};
&ahci_sata {
hostinit-mode = <1>;
status = "okay";
};
&sata_port0 {
status = "okay";
};
&rtk_pm {
wakeup-flags = <(LAN | GPIO | RTC | TIMER | CEC)>;
wakeup-gpio-list = <26 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_HIGH>;
wakeup-timer = <0>;
status = "okay";
};
&i2c_1 {
s35390a: s35390a@30 {
status = "ok";
compatible = "sii,s35390a";
reg = <0x30>;
};
};
&protected_mem {
status = "disabled";
};
&rpc_comm {
status = "disabled";
};
&rpc_ringbuf {
status = "disabled";
};
&video_fw_ve3 {
status = "disabled";
};
&audio_heap {
status = "disabled";
};
&media_heap {
status = "disabled";
};
&cma_resrved_1 {
status = "disabled";
};
&cma_resrved_2 {
status = "disabled";
};
&cma_resrved_3 {
status = "disabled";
};
&cma_resrved_4 {
status = "disabled";
};
&cma_resrved_5 {
status = "disabled";
};
&cma_resrved_6 {
status = "disabled";
};
&cma_resrved_7 {
status = "disabled";
};
&cma_resrved_8 {
status = "disabled";
};
&cma_resrved_9 {
status = "disabled";
};
&rtk_ion {
status = "disabled";
};
&tee {
status = "disabled";
};
&hifi {
status = "disabled";
};
&nic {
led-cfg = <0x1700042F>;
eee = <0>; /* 0: disable, 1: enable */
};
&rpc {
status = "disabled";
};
&rtk_fw_pm {
status = "disabled";
};
&reserved_memory {
ramoops@22000000 {
compatible = "ramoops";
reg = <0x22000000 0x00200000>;
console-size = <0x00100000>;
record-size = <0x00004000>;
ftrace-size = <0x00004000>;
};
};
&iso {
pwm: pwm@d0 {
pwm_1 {
enable = <1>;
clkout_div = <0xff>;
clksrc_div = <0xf>;
duty_rate = <50>; /* HW active low */
};
pwm_2 {
enable = <1>;
clkout_div = <0xff>;
clksrc_div = <0xf>;
duty_rate = <100>; /* HW active low */
};
};
};
&pwm {
pinctrl-names = "default";
pinctrl-0 = <&pwm1_0_pins>,
<&pwm2_0_pins>;
status = "okay";
};

View File

@ -0,0 +1,50 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2019-2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd1319-pymparticles.dtsi"
/ {
compatible = "realtek,pym-particles", "realtek,rtd1319";
model = "Realtek Pym Particles EVB (2GB, TEE)";
memory@40000 {
device_type = "memory";
reg = <0x00004000 0x7fffc000>; /* 2 GiB */
};
chosen {
linux,initrd-start = <0x03100000>;
linux,initrd-end = <0x03500000>;
bootargs = "earlycon=uart8250,mmio32,0x98007800 console=ttyS0,460800 init=/init loop.max_part=7 androidboot.storage=emmc androidboot.hardware=hank";
};
};
&pcie {
status = "disabled";
};
&pcie1 {
status = "disabled";
};
&pcie2 {
workaround = <1>;
status = "okay";
};
&pcie_trans {
status = "okay";
};
&rfkill {
status = "okay";
};
&uart1 {
status = "okay";
};

View File

@ -0,0 +1,502 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2019-2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include <dt-bindings/clock/rtd1319-clk.h>
#include <dt-bindings/regulator/anpec,apw888x.h>
#include <dt-bindings/soc/realtek,pm.h>
#include <dt-bindings/thermal/thermal.h>
#include "rtd13xx.dtsi"
/ {
compatible = "realtek,pym-particles", "realtek,rtd1319";
model = "Realtek Pym Particles EVB";
memory@40000 {
device_type = "memory";
reg = <0x00040000 0x7ffc0000>; /* boot ROM to 1 GiB or 2 GiB */
};
chosen {
stdout-path = "serial0:460800n8";
};
};
/* debug console (J1) */
&uart0 {
status = "okay";
};
/* M.2 slot (CON8) */
&uart1 {
status = "disabled";
};
/* GPIO connector (T1) */
&uart2 {
status = "disabled";
};
/* PMIC */
&i2c_0 {
clock-frequency = <3400000>;
pinctrl-0 = <&i2c_pins_0_HS>;
status = "okay";
apw8886: apw8886@12 {
compatible = "anpec,apw8886";
reg = <0x12>;
regulators: regulators {
compatible = "anpec,apw8886-regulator";
};
};
};
&i2c_1 {
clock-frequency = <400000>;
status = "okay";
};
&i2c_3 {
status = "okay";
};
&watchdog {
status = "okay";
};
&reboot_mode {
status = "okay";
};
&reboot {
status = "okay";
};
&gpio {
status = "okay";
};
&rtc {
status = "okay";
};
&nic {
status = "okay";
};
&spi_0 {
status = "okay";
};
&pwm {
status = "okay";
};
&i2c_3 {
status = "okay";
};
&emmc {
status = "okay";
};
&sd {
status = "okay";
};
&sdio {
bus-width = <4>;
non-removable;
cap-sd-highspeed;
cap-mmc-highspeed;
sd-uhs-sdr12;
sd-uhs-sdr25;
sd-uhs-sdr50;
sd-uhs-sdr104;
keep-power-in-suspend;
enable-sdio-wakeup;
no-sd;
no-mmc;
status = "okay";
};
&sata_phy {
status = "okay";
};
&sata_phy0 {
status = "okay";
};
&sata_phy1 {
status = "disabled";
};
&ahci_sata {
status = "okay";
};
&sata_port0 {
status = "okay";
};
&sata_port1 {
status = "disabled";
};
&rng {
status = "okay";
};
&hse {
status = "okay";
};
&cp {
status = "okay";
};
&ve1 {
status = "okay";
};
&jpeg {
status = "okay";
};
&apw8886 {
regulators {
vd33_supp: dc1 {
regulator-name = "vd33";
regulator-min-microvolt = <2200000>;
regulator-max-microvolt = <3777500>;
regulator-boot-on;
regulator-always-on;
regulator-initial-mode = <APW888X_DC_MODE_AUTO>;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <3300000>;
};
};
core_supp: dc2 {
regulator-name = "core";
regulator-min-microvolt = <550000>;
regulator-max-microvolt = <1337500>;
regulator-boot-on;
regulator-always-on;
regulator-initial-mode = <APW888X_DC_MODE_AUTO>;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <900000>;
};
};
cpu_supp: dc3 {
regulator-name = "cpudvs";
regulator-min-microvolt = <550000>;
regulator-max-microvolt = <1337500>;
regulator-boot-on;
regulator-always-on;
regulator-initial-mode = <APW888X_DC_MODE_AUTO>;
regulator-ramp-delay = <625>;
regulator-state-mem {
regulator-off-in-suspend;
};
};
vd18_supp: dc4 {
regulator-name = "vd18";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <2060000>;
regulator-boot-on;
regulator-always-on;
regulator-initial-mode = <APW888X_DC_MODE_AUTO>;
regulator-state-mem {
regulator-on-in-suspend;
};
};
ddr_supp: dc5 {
regulator-name = "ddr";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-boot-on;
regulator-always-on;
regulator-initial-mode = <APW888X_DC_MODE_AUTO>;
regulator-state-mem {
regulator-on-in-suspend;
};
regulator-state-shutdown {
regulator-off-in-suspend;
};
};
vd25_supp: ldo1 {
regulator-name = "vd25";
regulator-min-microvolt = <1780000>;
regulator-max-microvolt = <3020000>;
regulator-boot-on;
regulator-always-on;
regulator-initial-mode = <APW888X_LDO_MODE_NORMAL>;
regulator-state-mem {
regulator-on-in-suspend;
};
};
vfb5 {
regulator-name = "vfb5";
regulator-min-microvolt = <512500>;
regulator-max-microvolt = <700000>;
regulator-boot-on;
regulator-always-on;
regulator-state-mem {
regulator-on-in-suspend;
};
};
};
};
&usb_manager {
status = "okay";
rtk_usb {
pcie_usb3phy_sel = <0x9800705c>; /* Only for RTD1319 */
type_c {
/* For 1319, u3drd */
realtek,plug_side_switch-gpio = <&gpio 53 GPIO_ACTIVE_HIGH>;
};
};
};
&dwc3_u2drd {
status = "okay";
dwc3_u2drd@98020000 {
dr_mode = "host"; /*host, peripheral*/
status = "okay";
};
/delete-node/rtk_dwc3_type_c;
};
&dwc3_u2host {
status = "okay";
};
&dwc3_u3drd {
status = "okay";
dwc3_u3drd@981f0000 {
dr_mode = "peripheral"; /*host, peripheral*/
status = "okay";
};
rtk_dwc3_type_c@98007220 {
status = "okay";
};
};
&cpu0 {
clocks = <&cc RTD1319_CRT_PLL_SCPU>;
cpu-supply = <&cpu_supp>;
operating-points-v2 = <&cpu_opps>;
#cooling-cells = <2>;
};
&cpu1 {
clocks = <&cc RTD1319_CRT_PLL_SCPU>;
cpu-supply = <&cpu_supp>;
operating-points-v2 = <&cpu_opps>;
#cooling-cells = <2>;
};
&cpu2 {
clocks = <&cc RTD1319_CRT_PLL_SCPU>;
cpu-supply = <&cpu_supp>;
operating-points-v2 = <&cpu_opps>;
#cooling-cells = <2>;
};
&cpu3 {
clocks = <&cc RTD1319_CRT_PLL_SCPU>;
cpu-supply = <&cpu_supp>;
operating-points-v2 = <&cpu_opps>;
#cooling-cells = <2>;
};
&cpu_dvfs {
fss,opp-updated = <0>;
fss,volt-correct = <12500 12500 12500>;
fss,volt-step = <25000>;
fss,volt-min = <850000>;
fss,volt-max = <1100000>;
cpu_opps: cpu-opp-table {
compatible = "operating-points-v2";
opp-shared;
opp600: opp-600mhz {
opp-hz = /bits/ 64 <600000000>;
opp-microvolt = <862500>;
opp-microvolt-fss = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp700: opp-700mhz {
opp-hz = /bits/ 64 <700000000>;
opp-microvolt = <887500>;
opp-microvolt-fss = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp800: opp-800mhz {
opp-hz = /bits/ 64 <800000000>;
opp-microvolt = <912500>;
opp-microvolt-fss = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp900: opp-900mhz {
opp-hz = /bits/ 64 <900000000>;
opp-microvolt = <937500>;
opp-microvolt-fss = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp1000: opp-1000mhz {
opp-hz = /bits/ 64 <1000000000>;
opp-microvolt = <962500>;
opp-microvolt-fss = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp1100: opp-1100mhz {
opp-hz = /bits/ 64 <1100000000>;
opp-microvolt = <987500>;
opp-microvolt-fss = <0>;
clock-latency-ns = <150000>;
opp-suspend;
status = "okay";
};
opp1200: opp-1200mhz {
opp-hz = /bits/ 64 <1200000000>;
opp-microvolt = <1012500>;
opp-microvolt-fss = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp1300: opp-1300mhz {
opp-hz = /bits/ 64 <1300000000>;
opp-microvolt = <1050000>;
opp-microvolt-fss = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp1400: opp-1400mhz {
opp-hz = /bits/ 64 <1400000000>;
opp-microvolt = <1100000>;
opp-microvolt-fss = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
};
};
&usb_manager {
status = "okay";
rtk_usb {
pcie_usb3phy_sel = <0x9800705c>; /* Only for RTD1319 */
type_c {
/* For 1319, u3drd */
realtek,plug_side_switch-gpio = <&gpio 53 GPIO_ACTIVE_HIGH>;
};
};
};
&dwc3_u2drd {
status = "okay";
dwc3_u2drd@98020000 {
dr_mode = "host"; /*host, peripheral*/
status = "okay";
};
};
&dwc3_u2host {
status = "okay";
};
&dwc3_u3drd {
status = "okay";
dwc3_u3drd@981f0000 {
dr_mode = "peripheral"; /*host, peripheral*/
status = "okay";
};
};
&rtk_type_c {
status = "okay";
dwc3_rtk = <&dwc3_u3drd>;
};
&cpu_thermal {
trips {
cpu_alert0: cpu-alert0 {
temperature = <90000>;
hysteresis = <0>;
type = "passive";
};
cpu_alert1: cpu-alert1 {
temperature = <105000>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
cpu-map0 {
trip = <&cpu_alert0>;
cooling-device = <&cpu0 THERMAL_NO_LIMIT 3>;
contribution = <70>;
};
cpu-map1 {
trip = <&cpu_alert1>;
cooling-device = <&cpu0 4 THERMAL_NO_LIMIT>;
contribution = <70>;
};
};
};
&vcpu {
status = "okay";
};
&rtk_fw_pm {
status = "okay";
};
&rtk_pm {
wakeup-flags = <NORMAL_MODE>;
wakeup-gpio-list = <11 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_LOW>,
<26 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_LOW>;
wakeup-timer = <0>;
status = "okay";
};

View File

@ -0,0 +1,23 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2019 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd13xx-rescue.dtsi"
/ {
model = "Realtek RTD1319 Rescue";
memory@40000 {
device_type = "memory";
reg = <0x00040000 0x3ffc0000>; /* 1 GiB */
};
chosen {
stdout-path = "serial0:460800n8";
bootargs = "earlycon=uart8250,mmio32,0x98007800 console=ttyS0,460800 init=/init androidboot.storage=emmc androidboot.hardware=hank";
};
};

View File

@ -0,0 +1,52 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright (C) 2019-2020 Realtek Semiconductor Corporation
*/
&efuse {
otp_chip_id: chip-id@3cc {
reg = <0x3cc 0x10>;
};
otp_secure_chip_en: secure-chip-en@3fd {
reg = <0x3fd 0x1>;
bits = <2 3>;
};
otp_bist_rst_ctrl: bist-rst-ctrl@406 {
reg = <0x406 0x1>;
bits = <5 2>;
};
otp_uuid: uuid@478 {
reg = <0x478 0xc>;
};
otp_bond_id: bond-id@4f4 {
reg = <0x4f4 0x4>;
};
otp_iddq: iddq@4f8 {
reg = <0x4f8 0x2>;
};
otp_etn_para: etn-para@4fc {
reg = <0x4fc 0x1>;
bits = <0 5>;
};
otp_etn_idac: etn-idac@500 {
reg = <0x500 0x1>;
};
otp_cpu_dss: cpu-dss@514 {
reg = <0x514 0x13>;
bits = <0 148>;
};
otp_usb_cal: usb-cal@528 {
reg = <0x528 0xa>;
bits = <0 77>;
};
otp_usb_port0_dc_cal: usb-port0-dc-cal@534 {
reg = <0x534 0x1>;
bits = <0 4>;
};
otp_usb_port1_dc_cal: usb-port1-dc-cal@534 {
reg = <0x534 0x1>;
bits = <4 4>;
};
otp_usb_port2_dc_cal: usb-port2-dc-cal@535 {
reg = <0x535 0x1>;
bits = <0 4>;
};
};

View File

@ -0,0 +1,177 @@
// SPDX-License-Identifier: GPL-2.0+
/*
* Realtek RTD13xx SoC family
*
* Copyright (c) 2019-2020 Realtek Semiconductor Corp.
*/
&rbus {
pcie: pcie@60000 {
compatible = "realtek,rtd13xx-pcie-slot1", "syscon";
reg = <0x60000 0x00001000>;
syscon = <&iso>;
interrupt-names = "rtk-pcie0-intr";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &gic GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
interrupts = <0 61 4>;
pinctrl-names = "default";
pinctrl-0 = <&pcie_clk_pins_0>;
bus-range = <0x00 0xff>;
linux,pci-domain = <0>;
device_type = "pci";
perst-gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
#size-cells = <2>;
#address-cells = <3>;
num-lanes = <1>;
phys = <&pcie0_phy>;
speed-mode = <1>; // 0:GEN1, 1:GEN2
debug-mode = <0>;
ranges = <0x02000000 0x0 0x98062000 0x00062000 0x0 0x0001E000
0x01000000 0x0 0x00030000 0x10030000 0x0 0x00010000>;
resets = <&cc RTD1319_CRT_RSTN_PCIE0>,
<&cc RTD1319_CRT_RSTN_PCIE0_CORE>,
<&cc RTD1319_CRT_RSTN_PCIE0_POWER>,
<&cc RTD1319_CRT_RSTN_PCIE0_NONSTITCH>,
<&cc RTD1319_CRT_RSTN_PCIE0_STITCH>,
<&cc RTD1319_CRT_RSTN_PCIE0_SGMII_MDIO>;
reset-names = "rstn",
"core",
"power",
"nonstitch",
"stitch",
"sgmii_mdio";
clocks = <&cc RTD1319_CRT_CLK_EN_PCIE0>;
status = "disabled";
};
pcie1: pcie@a0000 {
compatible = "realtek,rtd13xx-pcie-slot1", "syscon";
reg = <0xA0000 0x00001000>;
syscon = <&m2tmx>;
interrupt-names = "rtk-pcie1-intr";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &gic GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
interrupts = <0 62 4>;
pinctrl-names = "default";
pinctrl-0 = <&pcie_clk_pins_1>;
bus-range = <0x00 0xff>;
linux,pci-domain = <1>;
device_type = "pci";
perst-gpios = <&gpio 80 GPIO_ACTIVE_HIGH>;
#size-cells = <2>;
#address-cells = <3>;
num-lanes = <1>;
phys = <&pcie1_phy>;
speed-mode = <1>; // 0:GEN1, 1:GEN2
debug-mode = <0>;
ranges = <0x03000000 0x0 0x980A2000 0x000A2000 0x0 0x0001E000
0x01000000 0x0 0x00040000 0x10040000 0x0 0x00010000>;
workaround = <0>;
workaround-ranges = <0x03000000 0x0 0xC0000000 0xC0000000 0x0 0x00100000
0x01000000 0x0 0x00040000 0x10040000 0x0 0x00010000>;
resets = <&cc RTD1319_CRT_RSTN_PCIE1>,
<&cc RTD1319_CRT_RSTN_PCIE1_CORE>,
<&cc RTD1319_CRT_RSTN_PCIE1_POWER>,
<&cc RTD1319_CRT_RSTN_PCIE1_NONSTITCH>,
<&cc RTD1319_CRT_RSTN_PCIE1_STITCH>;
reset-names = "rstn",
"core",
"power",
"nonstitch",
"stitch";
clocks = <&cc RTD1319_CRT_CLK_EN_PCIE1>;
status = "okay";
};
pcie2: pcie@c0000 {
compatible = "realtek,rtd13xx-pcie-slot2", "syscon";
reg = <0xC0000 0x00001000>;
syscon = <&m2tmx>;
interrupt-names = "rtk-pcie2-intr";
#interrupt-cells = <1>;
interrupt-map-mask = <0 0 0 0>;
interrupt-map = <0 0 0 0 &gic GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
interrupts = <0 62 4>;
pinctrl-names = "default";
pinctrl-0 = <&pcie_clk_pins_2>;
bus-range = <0x00 0xff>;
linux,pci-domain = <2>;
device_type = "pci";
perst-gpios = <&gpio 81 GPIO_ACTIVE_HIGH>;
#size-cells = <2>;
#address-cells = <3>;
num-lanes = <1>;
phys = <&pcie2_phy>;
speed-mode = <1>; // 0:GEN1, 1:GEN2
debug-mode = <0>;
ranges = <0x02000000 0x0 0x980C2000 0x000C2000 0x0 0x0001E000
0x01000000 0x0 0x00050000 0x10050000 0x0 0x00010000>;
workaround = <0>;
workaround-ranges = <0x02000000 0x0 0xC1000000 0xC1000000 0x0 0x00100000
0x01000000 0x0 0x00050000 0x10050000 0x0 0x00010000>;
resets = <&cc RTD1319_CRT_RSTN_PCIE2>,
<&cc RTD1319_CRT_RSTN_PCIE2_CORE>,
<&cc RTD1319_CRT_RSTN_PCIE2_POWER>,
<&cc RTD1319_CRT_RSTN_PCIE2_NONSTITCH>,
<&cc RTD1319_CRT_RSTN_PCIE2_STITCH>;
reset-names = "rstn",
"core",
"power",
"nonstitch",
"stitch";
clocks = <&cc RTD1319_CRT_CLK_EN_PCIE2>;
status = "okay";
};
pcie_trans: pcie_trans@70000 {
compatible = "realtek,rtd13xx-pcie-trans";
reg = <0x70000 0x10000>,
<0xb0000 0x10000>,
<0xd0000 0x10000>;
syscon = <&pcie>,
<&pcie1>,
<&pcie2>;
status = "disabled";
};
};
/ {
pcie0_phy: pcie0_phy {
compatible = "realtek,rtd13xx-pcie-slot0-phy";
syscon = <&pcie>;
resets = <&cc RTD1319_CRT_RSTN_PCIE0_PHY>,
<&cc RTD1319_CRT_RSTN_PCIE0_PHY_MDIO>;
reset-names = "phy",
"phy_mdio";
#phy-cells = <0>;
status = "okay";
};
pcie1_phy: pcie1_phy {
compatible = "realtek,rtd13xx-pcie-slot1-phy";
syscon = <&pcie1>;
resets = <&cc RTD1319_CRT_RSTN_PCIE1_PHY>,
<&cc RTD1319_CRT_RSTN_PCIE1_PHY_MDIO>;
reset-names = "phy",
"phy_mdio";
#phy-cells = <0>;
status = "okay";
};
pcie2_phy: pcie2_phy {
compatible = "realtek,rtd13xx-pcie-slot2-phy";
syscon = <&pcie2>;
resets = <&cc RTD1319_CRT_RSTN_PCIE2_PHY>,
<&cc RTD1319_CRT_RSTN_PCIE2_PHY_MDIO>;
reset-names = "phy",
"phy_mdio";
#phy-cells = <0>;
status = "okay";
};
};

View File

@ -0,0 +1,503 @@
&pinctrl {
sdcard_pins_low: sdcard_low {
pins= "gpio_32",
"gpio_33",
"hif_data",
"hif_en",
"hif_rdy",
"hif_clk";
function="sd";
bias-pull-down;
};
sdcard_pins_high: sdcard_high {
pins="gpio_35", "gpio_34";
function="mmc";
bias-pull-up;
};
sdio_pins_0: sdio_pins_0 {
pins= "gpio_32",
"gpio_33",
"hif_data",
"hif_en",
"hif_rdy",
"hif_clk",
"sdio_loc";
function = "sdio_loc0";
};
sdio_pins_1: sdio_pins_1 {
pins = "gpio_40",
"gpio_41",
"gpio_42",
"gpio_43",
"gpio_44",
"gpio_45",
"sdio_loc";
function = "sdio_loc1";
};
rgmii_mdio_pins: rgmii_mdio_pins {
pins = "gpio_14",
"gpio_15";
function = "rgmii";
};
rgmii_txrx_pins: rgmii_txrx_pins {
pins = "gpio_65",
"gpio_66",
"gpio_67",
"gpio_68",
"gpio_69",
"gpio_70",
"gpio_71",
"gpio_72",
"gpio_73",
"gpio_74",
"gpio_75",
"gpio_76";
function = "rgmii";
};
uart0_pins: uart0_pins {
pins = "ur0_rx",
"ur0_tx";
function = "uart0";
};
uart1_pins: uart1_pins {
pins = "gpio_8",
"gpio_9";
function = "uart1";
};
uart2_pins_0: uart2_pins_0 {
pins = "ur2_loc",
"gpio_18",
"gpio_19";
function = "uart2_loc0";
};
uart2_pins_1: uart2_pins_1 {
pins ="ur2_loc",
"gpio_26",
"gpio_27";
function = "uart2_loc1";
};
i2c_pins_0: i2c_pins_0 {
pins = "gpio_12",
"gpio_13";
function = "i2c0";
drive-strength = <4>;
};
i2c_pins_0_HS: i2c_pins_0_HS {
pins = "gpio_12",
"gpio_13";
function = "i2c0";
drive-strength = <8>;
};
i2c_pins_1: i2c_pins_1 {
pins = "gpio_16",
"gpio_17";
function = "i2c1";
};
i2c_pins_3: i2c_pins_3 {
pins = "gpio_63",
"gpio_64";
function = "i2c3";
};
i2c_pins_5: i2c_pins_5 {
pins = "gpio_29",
"gpio_46";
function = "i2c5";
};
spi_pins_enable: spi-pins-enable {
pins = "sf_en";
function = "sf_enable";
};
spi_pins_loc_spi: spi_pins_loc_spi {
pins = "spi_ce_n",
"spi_sck",
"spi_so",
"spi_si";
function = "spi";
};
gspi_pins_0: gspi_pins_0 {
pins = "gspi_loc",
"gpio_18",
"gpio_19",
"gpio_20",
"gpio_31";
function = "gspi_loc0";
};
gspi_pins_1: gspi_pins_1 {
pins = "gspi_loc",
"gpio_8",
"gpio_9",
"gpio_10",
"gpio_11";
function = "gspi_loc1";
};
iso_gspi_pins_0: iso_gspi_pins_0 {
pins = "iso_gspi_loc",
"gpio_18",
"gpio_19",
"gpio_20",
"gpio_31";
function = "iso_gspi_loc0";
};
iso_gspi_pins_1: iso_gspi_pins_1 {
pins = "iso_gspi_loc",
"gpio_8",
"gpio_9",
"gpio_10",
"gpio_11";
function = "iso_gspi_loc1";
};
smartcard_pins_0:smartcard_pins_0{
pins = "gpio_18",
"gpio_19",
"gpio_20",
"gpio_31";
function = "sc0";
};
smartcard_pins_1:smartcard_pins_1{
pins = "gpio_2",
"gpio_3",
"gpio_4",
"gpio_5";
function = "sc1";
};
tp_common_pins: tp-common-pins {
pins = "gpio_66",
"gpio_67",
"gpio_68",
"gpio_73",
"gpio_74",
"gpio_75",
"gpio_76";
function = "tp0";
};
tp0_parallel_pins: tp0-parallel-pins {
pins = "gpio_69",
"gpio_70",
"gpio_71",
"gpio_72";
function = "tp0";
};
tp1_serial_pins: tp1-serial-pins {
pins = "gpio_69",
"gpio_70",
"gpio_71",
"gpio_72";
function = "tp1";
};
ao_pins: ao_pins {
pins = "gpio_66",
"gpio_67",
"gpio_68",
"gpio_69",
"gpio_70",
"gpio_71",
"gpio_72";
function = "ao";
};
ao_pins_1: ao_pins_1 {
pins = "gpio_66",
"gpio_67",
"gpio_68",
"gpio_69";
function = "ao";
};
ir_rx_pins: ir_rx_pins {
pins = "ir_rx";
function = "ir_rx";
};
spdif_pins: spdif_pins {
pins = "gpio_50";
function = "spdif";
};
/*spdif_optical_pins: spdif_optical_pins {
pins = "gpio_21", "gpio_68", "gpio_85";
function = "spdif";
pull_en = <0>;
};*/
ai_loc0_pins: ai_loc0_pins {
pins = "gpio_57",
"gpio_58",
"gpio_59",
"gpio_60",
"gpio_61",
"gpio_62",
"gpio_63";
function = "ai_loc0";
};
ai_loc1_pins: ai_loc1_pins {
pins = "gpio_32",
"gpio_33",
"gpio_34",
"hif_data",
"hif_en",
"hif_rdy",
"hif_clk";
function = "ai_loc1";
};
dmic_loc0_pins: dmic_loc0_pins {
pins = "dmic_loc",
"gpio_57",
"gpio_58",
"gpio_59",
"gpio_60",
"gpio_61",
"gpio_62",
"gpio_63",
"gpio_64";
function = "dmic_loc0";
};
dmic_loc1_pins: dmic_loc1_pins {
pins = "dmic_loc",
"gpio_32",
"gpio_33",
"gpio_34",
"gpio_35",
"hif_data",
"hif_en",
"hif_rdy",
"hif_clk";
function = "dmic_loc1";
};
tdm_loc0_pins: tdm_loc0_pins {
pins =
"gpio_57",
"gpio_58",
"gpio_59",
"gpio_60";
function = "tdm_ai_loc0";
};
tdm_loc1_pins: tdm_loc1_pins {
pins =
"hif_data",
"hif_en",
"hif_rdy",
"hif_clk";
function = "tdm_ai_loc1";
};
/*i2s_out_4pins: i2s_out_4pins {
pins ="tp_data_1",
"tp_data_2",
"tp_data_3",
"tp_data_4";
function = "ao";
};*/
/*i2s_in_pins: i2s_in_pins {
pins = "gpio_6";
function = "ai";
};*/
etn_led_pins: etn_led_pins {
pins = "gpio_14",
"gpio_15";
function = "etn_led";
};
pcie_clk_pins_0: pcie_clk_pins_0 {
pins = "gpio_46";
function = "pcie0";
};
pcie_clk_pins_1: pcie_clk_pins_1 {
pins = "gpio_25";
function = "pcie1";
};
pcie_clk_pins_2: pcie_clk_pins_2 {
pins = "gpio_52";
function = "pcie2";
};
scpu_ejtag_pins_loc_0: scpu_ejtag_pins_loc_0 {
pins = "gpio_2",
"gpio_3",
"gpio_4",
"gpio_5",
"gpio_6",
"ejtag_scpu_loc";
function = "scpu_ejtag_loc0";
};
scpu_ejtag_pins_loc_1: scpu_ejtag_pins_loc_1 {
pins = "gpio_32",
"gpio_33",
"hif_data",
"hif_en",
"hif_clk",
"ejtag_scpu_loc";
function = "scpu_ejtag_loc1";
};
scpu_ejtag_pins_disable: scpu_ejtag_pins_disable {
pins = "ejtag_scpu_loc";
function = "scpu_ejtag_disable";
};
acpu_ejtag_pins_loc_0: acpu_ejtag_pins_loc_0 {
pins = "gpio_2",
"gpio_3",
"gpio_4",
"gpio_5",
"gpio_6",
"ejtag_acpu_loc";
function = "acpu_ejtag_loc0";
};
acpu_ejtag_pins_loc_1: acpu_ejtag_pins_loc_1 {
pins = "gpio_32",
"gpio_33",
"hif_data",
"hif_en",
"hif_clk",
"ejtag_acpu_loc";
function = "acpu_ejtag_loc1";
};
acpu_ejtag_pins_disable:acpu_ejtag_pins_disable{
pins = "ejtag_acpu_loc";
function = "acpu_ejtag_disable";
};
vcpu_ejtag_pins_loc_0: avpu_ejtag_pins_loc_0 {
pins = "gpio_2",
"gpio_3",
"gpio_4",
"gpio_5",
"gpio_6",
"ejtag_vcpu_loc";
function = "vcpu_ejtag_loc0";
};
vcpu_ejtag_pins_loc_1: vcpu_ejtag_pins_loc_1 {
pins = "gpio_32",
"gpio_33",
"hif_data",
"hif_en",
"hif_clk",
"ejtag_vcpu_loc";
function = "vcpu_ejtag_loc1";
};
vcpu_ejtag_pins_disable:vcpu_ejtag_pins_disable{
pins = "ejtag_vcpu_loc";
function = "vcpu_ejtag_disable";
};
dc_fan_sensor_pins: dc_fan_sensor_pins {
pins = "gpio_47";
function = "dc_fan";
};
pwm0_0_pins: pwm0_0_pins {
pins = "gpio_12";
function = "pwm0";
};
pwm0_1_pins: pwm0_1_pins {
pins = "gpio_20";
function = "pwm0";
};
pwm1_0_pins: pwm1_0_pins {
pins = "gpio_13";
function = "pwm1";
};
pwm1_1_pins: pwm1_1_pins {
pins = "gpio_21";
function = "pwm1";
};
pwm2_0_pins: pwm2_0_pins {
pins = "gpio_14";
function = "pwm2";
};
pwm2_1_pins: pwm2_1_pins {
pins = "gpio_22";
function = "pwm2";
};
pwm3_0_pins: pwm3_0_pins {
pins = "gpio_15";
function = "pwm3";
};
pwm3_1_pins: pwm3_1_pins {
pins = "gpio_23";
function = "pwm3";
};
usb_cc1_pins: usb_cc1_pins {
pins = "usb_cc1";
function = "usb_cc1";
};
usb_cc2_pins: usb_cc2_pins {
pins = "usb_cc2";
function = "usb_cc2";
};
demod_pins: demod-pins {
pins = "gpio_21";
function = "qam_agc_if";
};
/*rtc_pins: rtc_pins {
pins = "gpio_25";
function = "rtc";
};*/
/*prob0_pins: prob0_pins{
pins = "prob_0";
function = "gpio";
};
prob1_pins: prob1_pins{
pins = "prob_1";
function = "gpio";
};*/
};

View File

@ -0,0 +1,107 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2019-2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd13xx.dtsi"
#include <dt-bindings/soc/realtek,pm.h>
/ {
model = "Realtek Rescue";
memory@40000 {
device_type = "memory";
reg = <0x00004000 0x7fffc000>; /* boot ROM to 1 GiB or 2 GiB */
};
chosen {
linux,initrd-start = <0x03100000>;
linux,initrd-end = <0x03d00000>;
};
};
/* debug console (J1) */
&uart0 {
status = "okay";
};
&gpio {
status = "okay";
};
&watchdog {
status = "okay";
};
&nic {
status = "okay";
};
&emmc {
hs400_force_tuning = <0x1>;
status = "okay";
};
&cp {
status = "okay";
};
&usb_manager {
status = "okay";
rtk_usb {
pcie_usb3phy_sel = <0x9800705c>; /* Only for RTD1319 */
type_c {
/* For 1319, u3drd */
realtek,plug_side_switch-gpio = <&gpio 53 GPIO_ACTIVE_HIGH>;
};
};
};
&dwc3_u2drd {
status = "okay";
dwc3_u2drd@98020000 {
dr_mode = "host"; /*host, peripheral*/
status = "okay";
};
};
&dwc3_u2host {
status = "okay";
};
&dwc3_u3drd {
status = "okay";
dwc3_u3drd@981f0000 {
dr_mode = "peripheral"; /*host, peripheral*/
status = "okay";
};
};
&rtk_type_c {
status = "okay";
dwc3_rtk = <&dwc3_u3drd>;
};
&cma_resrved_3 {
status = "disabled";
};
&psci {
status = "disabled";
};
&rtk_pm {
wakeup-flags = <NORMAL_MODE>;
wakeup-gpio-list = <2 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_LOW>,
<4 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_LOW>,
<26 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_LOW>;
wakeup-timer = <0>;
status = "okay";
};

View File

@ -0,0 +1,344 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Realtek RTD13xx SoC USB
*
* Copyright (c) 2020 Realtek Semiconductor Corp.
*/
/ {
usb_manager: rtk_usb_manager {
compatible = "realtek,usb-manager";
//usb_iso_mode; /* ISO mode is only port suspend (Default disable) */
//en_usb_storage_reprobe; /* To enable usb storage re-probe*/
//rescue_usb; /* For rescue dtb use */
status = "disabled";
gpio0: gpio0 {
realtek,power-gpio = <&gpio 48 GPIO_ACTIVE_HIGH>;
power_low_active;
};
gpio1: gpio1 {
realtek,power-gpio = <&gpio 49 GPIO_ACTIVE_HIGH>;
power_low_active;
};
port0 {
usb = <&dwc3_u2drd>;
usb_gpio = <&gpio0>;
};
port1 {
usb = <&dwc3_u2host>;
usb_gpio = <&gpio0>;
};
port2 {
usb = <&dwc3_u3drd>;
usb_gpio = <&gpio1>;
};
rtk_usb {
//pcie_usb3phy_sel = <0x9800705c>; /* Only for RTD1319 */
power_ctrl_reg {
/* l4_icg */
p0_l4_icg = <0x98013364>;
p1_l4_icg = <0x98013d60>;
p2_l4_icg = <0x98013f60>;
usb_power_cut; /* Non ISO mode and power cut (Default disable power cut) */
/* Note if enable ISO mode, then power_cut will not effective*/
};
type_c {
/* For 1315, 1317, u2drd */
//realtek,connector_switch-gpio = <&gpio 25 GPIO_ACTIVE_HIGH>;
/* For 1319, u3drd */
//realtek,plug_side_switch-gpio = <&gpio 53 GPIO_ACTIVE_HIGH>;
};
};
};
dwc3_u2drd_usb2phy: dwc3_u2drd_usb2phy@98013214 {
compatible = "realtek,usb2phy";
reg = <0x98013214 0x4>, <0x98028280 0x4>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
status = "okay";
nvmem-cells = <&otp_usb_port0_dc_cal>;
nvmem-cell-names = "usb-dc-cal";
port_index = <0>; /* index in u2 port */
phyN = <1>;
phy0 {
phy_data_page0_size = <16>;
phy_data_page0_addr = /bits/ 8
<0xE0 0xE1 0xE2 0xE3 0xE4 0xE5 0xE6 0xE7 0xF0 0xF1
0xF2 0xF3 0xF4 0xF5 0xF6 0xF7>;
phy_data_page0_A00 = /bits/ 8
<0xE0 0x30 0x79 0x8D 0x6A 0x65 0x01 0x71 0xFC 0x8C
0x00 0x11 0x9B 0x00 0x00 0x0A>;
phy_data_page0_B00 = /bits/ 8
<0x18 0x30 0x79 0x8D 0x6A 0x65 0x01 0x71 0xFC 0x8C
0x00 0x11 0x9B 0x00 0x00 0x32>;
phy_data_page1_size = <8>;
phy_data_page1_addr = /bits/ 8
<0xE0 0xE1 0xE2 0xE3 0xE4 0xE5 0xE6 0xE7>;
phy_data_page1_A00 = /bits/ 8
<0x25 0xEF 0x60 0x44 0x00 0x0F 0x18 0xE3>;
phy_data_page2_size = <1>;
phy_data_page2_addr = /bits/ 8
<0xE0>;
phy_data_page2_A00 = /bits/ 8
<0x01>;
do_toggle;
check_efuse;
//use_default_parameter;
is_double_sensitivity_mode;
ldo_page0_e4_compensate = <(-2)>;
};
};
dwc3_u2drd: rtk_dwc3_u2drd@98013200 {
compatible = "realtek,dwc3";
reg = <0x98013200 0x200>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
delay_probe_work; //To delay probe work
ordered_probe; // ordered probe in delay work
drd_mode;
status = "disabled";
dwc3_u2drd@98020000 {
compatible = "synopsys,dwc3";
reg = <0x98020000 0x9000>;
interrupts = <0 95 4>;
snps,fixed_dwc3_globals_regs_start = <0x8100>;
usb-phy = <&dwc3_u2drd_usb2phy>;
dr_mode = "host"; /*otg, host, peripheral*/
snps,dis_u2_susphy_quirk; // Disable u2phy suspend for drd
snps,dis-u2-freeclk-exists-quirk; // Fixed u2drd host die issue
status = "disabled";
};
};
dwc3_u2host_usb2phy: dwc3_u2host_usb2phy@98013C14 {
compatible = "realtek,usb2phy";
reg = <0x98013C14 0x4>, <0x98031280 0x4>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
status = "okay";
nvmem-cells = <&otp_usb_port1_dc_cal>;
nvmem-cell-names = "usb-dc-cal";
port_index = <1>; /* index in u2 port */
phyN = <1>;
phy0 {
phy_data_page0_size = <16>;
phy_data_page0_addr = /bits/ 8
<0xE0 0xE1 0xE2 0xE3 0xE4 0xE5 0xE6 0xE7 0xF0 0xF1
0xF2 0xF3 0xF4 0xF5 0xF6 0xF7>;
phy_data_page0_A00 = /bits/ 8
<0xE0 0x30 0x79 0x8D 0x6A 0x65 0x01 0x71 0xFC 0x8C
0x00 0x11 0x9B 0x00 0x00 0x0A>;
phy_data_page0_B00 = /bits/ 8
<0x18 0x30 0x79 0x8D 0x6A 0x65 0x01 0x71 0xFC 0x8C
0x00 0x11 0x9B 0x00 0x00 0x32>;
phy_data_page1_size = <8>;
phy_data_page1_addr = /bits/ 8
<0xE0 0xE1 0xE2 0xE3 0xE4 0xE5 0xE6 0xE7>;
phy_data_page1_A00 = /bits/ 8
<0x25 0xEF 0x60 0x44 0x00 0x0F 0x18 0xE3>;
phy_data_page2_size = <1>;
phy_data_page2_addr = /bits/ 8
<0xE0>;
phy_data_page2_A00 = /bits/ 8
<0x01>;
do_toggle;
check_efuse;
//use_default_parameter;
is_double_sensitivity_mode;
ldo_page0_e4_compensate = <(-2)>;
};
};
dwc3_u2host: rtk_dwc3_u2host@98013C00 {
compatible = "realtek,dwc3";
reg = <0x98013C00 0x200>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
delay_probe_work; //To delay probe work
ordered_probe; // ordered probe in delay work
status = "disabled";
dwc3_u2host@98029000 {
compatible = "synopsys,dwc3";
reg = <0x98029000 0x9000>;
interrupts = <0 21 4>;
snps,fixed_dwc3_globals_regs_start = <0x8100>;
usb-phy = <&dwc3_u2host_usb2phy>;
dr_mode = "host"; /*only host*/
};
};
dwc3_u3drd_usb3phy: dwc3_u3drd_usb3phy@98013E10 {
compatible = "realtek,usb3phy";
reg = <0x98013E10 0x4>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
status = "okay";
port_index = <0>; /* index in u3 port */
phyN = <1>;
phy0 {
phy_data_size = <0x30>;
phy_data_addr = /bits/ 8
<0x00 0x01 0x02 0x03 0x04 0x05 0x06
0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D
0x0E 0x0F 0x10 0x11 0x12 0x13 0x14
0x15 0x16 0x17 0x18 0x19 0x1A 0x1B
0x1C 0x1D 0x1E 0x1F 0x20 0x21 0x22
0x23 0x24 0x25 0x26 0x27 0x28 0x29
0x2A 0x2B 0x2C 0x2D 0x2E 0x2F>;
phy_data_A00 = /bits/ 16
<0x400C 0xAC86 0x6042 0x2771 0x72F5 0x2AD3 0x0003
0x2E00 0x3591 0x925C 0xA608 0xA905 0xC000 0xEF1E
0x2010 0x8D50 0x000C 0x4C10 0xFC00 0x0C81 0xDE01
0x0000 0x0000 0x0000 0x0000 0x6000 0x0085 0x2014
0xC900 0xA03F 0xC2E0 0x7E00 0x705A 0xF645 0x0013
0xCB66 0x4770 0x126C 0x840A 0x01D6 0xF802 0xff00
0x3040 0x8028 0xFFFF 0xFFFF 0x0000 0x8600>;
phy_data_B00 = /bits/ 16
<0x400C 0xAC86 0x6042 0x2771 0x72F5 0x2AD3 0x0003
0x2E00 0x3591 0x924C 0xA608 0xB905 0xC000 0xEF1E
0x2010 0x8D50 0x000C 0x4C10 0xFC00 0x0C81 0xDE01
0x0000 0x0000 0x0000 0x0000 0x6000 0x0085 0x2014
0xC900 0xA03F 0xC2E0 0x7E00 0x705A 0xF645 0x0013
0xCB66 0x4770 0x126C 0x840A 0x01D6 0xF802 0xff00
0x3040 0x8028 0xFFFF 0xFFFF 0x0000 0x8600>;
do_toggle;
//use_default_parameter;
};
};
dwc3_u3drd_usb2phy: dwc3_u3drd_usb2phy@98013E14 {
compatible = "realtek,usb2phy";
reg = <0x98013E14 0x4>, <0x98058280 0x4>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
status = "okay";
nvmem-cells = <&otp_usb_port2_dc_cal>;
nvmem-cell-names = "usb-dc-cal";
port_index = <2>; /* index in u2 port */
phyN = <1>;
phy0 {
phy_data_page0_size = <16>;
phy_data_page0_addr = /bits/ 8
<0xE0 0xE1 0xE2 0xE3 0xE4 0xE5 0xE6 0xE7 0xF0 0xF1
0xF2 0xF3 0xF4 0xF5 0xF6 0xF7>;
phy_data_page0_A00 = /bits/ 8
<0xE0 0x30 0x79 0x8D 0x6A 0x65 0x01 0x71 0xFC 0x8C
0x00 0x11 0x9B 0x00 0x00 0x0A>;
phy_data_page0_B00 = /bits/ 8
<0x18 0x30 0x79 0x8D 0x6A 0x65 0x01 0x71 0xFC 0x8C
0x00 0x11 0x9B 0x00 0x00 0x32>;
phy_data_page1_size = <8>;
phy_data_page1_addr = /bits/ 8
<0xE0 0xE1 0xE2 0xE3 0xE4 0xE5 0xE6 0xE7>;
phy_data_page1_A00 = /bits/ 8
<0x25 0xEF 0x60 0x44 0x00 0x0F 0x18 0xE3>;
phy_data_page2_size = <1>;
phy_data_page2_addr = /bits/ 8
<0xE0>;
phy_data_page2_A00 = /bits/ 8
<0x01>;
do_toggle;
check_efuse;
//use_default_parameter;
is_double_sensitivity_mode;
ldo_page0_e4_compensate = <(-2)>;
};
};
dwc3_u3drd: rtk_dwc3_u3drd@98013E00 {
compatible = "realtek,dwc3";
reg = <0x98013E00 0x200>;
#address-cells = <1>;
#size-cells = <1>;
ranges;
delay_probe_work; //To delay probe work
ordered_probe; // ordered probe in delay work
drd_mode;
status = "disabled";
dwc3_u3drd@981f0000 {
compatible = "synopsys,dwc3";
reg = <0x98050000 0x9000>;
interrupts = <0 94 4>;
snps,fixed_dwc3_globals_regs_start = <0x8100>;
usb-phy = <&dwc3_u3drd_usb2phy &dwc3_u3drd_usb3phy>;
dr_mode = "peripheral"; /*only host*/
snps,dis_u2_susphy_quirk; // Disable u2phy suspend for drd
snps,parkmode-disable-ss-quirk; // disable usb3.0 park mode
status = "disabled";
};
};
rtk_type_c: rtk_type_c@98007220 {
compatible = "realtek,dwc3-type_c";
reg = <0x98007220 0x20>;
interrupts = <0 60 4>;
//debug; /*to enable debug log*/
delay_probe_work; /*To delay probe work*/
ordered_probe; /*ordered probe in delay work*/
dwc3_rtk = <&dwc3_u3drd>;
boot_check_time = <(-1)>; /*ms (At boot Device switch Host time)*/
pinctrl-names = "default";
pinctrl-0 = <&usb_cc1_pins>, <&usb_cc2_pins>;
nvmem-cells = <&otp_usb_cal>;
nvmem-cell-names = "usb-cal";
status = "disabled";
default_revision = <0xA00>;
A00 {
cc_dfp_mode = "dfp_3_0"; /*dfp_3_0, dfp_1_5, dfp_usb*/
cc1_rp_4p7k_code = <0x9>;
cc1_rp_36k_code = <0xE>;
cc1_rp_12k_code = <0x9>;
cc1_rd_code = <0x9>;
cc1_vref_ufp = /bits/ 8
<0x7 0x6 0x3>; /*<1p23v,0p66v,0p2v>*/
cc1_vref_dfp_usb = /bits/ 8
<0x7 0x3 0x0>; /*<0_1p6v,0p2v,unused>*/
cc1_vref_dfp_1_5 = /bits/ 8
<0x4 0x2 0x3>; /*<1_1p6v,0p4v,0p2v>*/
cc1_vref_dfp_3_0 = /bits/ 8
<0x3 0x7 0x3>; /*<2p6v,0p8v,0p2v>*/
cc2_rp_4p7k_code = <0x8>;
cc2_rp_36k_code = <0xE>;
cc2_rp_12k_code = <0x9>;
cc2_rd_code = <0x9>;
cc2_vref_ufp = /bits/ 8
<0x7 0x6 0x3>; /*<1p23v,0p66v,0p2v>*/
cc2_vref_dfp_usb = /bits/ 8
<0x7 0x3 0x0>; /*<0_1p6v,0p2v,unused>*/
cc2_vref_dfp_1_5 = /bits/ 8
<0x6 0x3 0x3>; /*<1_1p6v,0p4v,0p2v>*/
cc2_vref_dfp_3_0 = /bits/ 8
<0x3 0x7 0x3>; /*<2p6v,0p8v,0p2v>*/
};
};
};

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,133 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd1619b-bleedingedge.dtsi"
/ {
compatible = "realtek,bleeding-edge", "realtek,rtd1619b";
model = "Realtek Bleeding Edge EVB (1GB spi)";
memory@4000 {
device_type = "memory";
reg = <0x00040000 0x3ffc0000>; /* 1 GiB */
};
chosen {
bootargs = "earlycon=uart8250,mmio32,0x98007800 console=ttyS0,460800 uio_pdrv_genirq.of_id=generic-uio init=/etc/init root=/dev/mtdblock3 rootwait loglevel=8 mtdparts=RtkSFC:256k(u-boot-env),1280k(u-boot)ro,4736k(firmware),9600k(rootfs)";
};
};
&pcie1 {
status = "disabled";
};
&sata_phy {
status = "okay";
};
&sata_phy0 {
status = "okay";
};
&ahci_sata {
status = "okay";
};
&sata_port0 {
status = "okay";
};
&protected_mem {
status = "disabled";
};
&rpc_comm {
status = "disabled";
};
&rpc_ringbuf {
status = "disabled";
};
&video_fw_ve3 {
status = "disabled";
};
&audio_heap {
status = "disabled";
};
&media_heap {
status = "disabled";
};
&cma_resrved_1 {
status = "disabled";
};
&cma_resrved_2 {
status = "disabled";
};
&cma_resrved_3 {
status = "disabled";
};
&cma_resrved_4 {
status = "disabled";
};
&cma_resrved_5 {
status = "disabled";
};
&cma_resrved_6 {
status = "disabled";
};
&cma_resrved_7 {
status = "disabled";
};
&cma_resrved_8 {
status = "disabled";
};
&cma_resrved_9 {
status = "disabled";
};
&rtk_ion {
status = "disabled";
};
&tee {
status = "disabled";
};
&hifi {
status = "disabled";
};
&rpc {
status = "disabled";
};
&rtk_fw_pm {
status = "disabled";
};
&reserved_memory {
ramoops@22000000 {
compatible = "ramoops";
reg = <0x22000000 0x00200000>;
console-size = <0x00100000>;
record-size = <0x00004000>;
ftrace-size = <0x00004000>;
};
};

View File

@ -0,0 +1,113 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd1619b-bleedingedge.dtsi"
/ {
compatible = "realtek,bleeding-edge", "realtek,rtd1619b";
model = "Realtek Bleeding Edge EVB (2GB)";
memory@4000 {
device_type = "memory";
reg = <0x00004000 0x3fffc000>; /* 1 GiB */
};
};
&pcie1 {
status = "disabled";
};
&sata_phy {
status = "okay";
};
&sata_phy0 {
status = "okay";
};
&ahci_sata {
status = "okay";
};
&sata_port0 {
status = "okay";
};
&audio_heap {
compatible = "audio_heap";
reg = <0x04400000 0xc0000>;
};
&media_heap {
compatible = "media_heap";
reg = <0x04e00000 0x02000000>;
};
&cma_resrved_0 {
status = "disabled";
};
&cma_resrved_1 {
status = "disabled";
};
&cma_resrved_2 {
size = <0x400000>;
status = "disabled";
};
&cma_resrved_3 {
size = <0xa000000>;
};
&cma_resrved_4 {
status = "disabled";
};
&cma_resrved_5 {
size = <0x800000>;
};
&cma_resrved_6 {
size = <0x1c00000>;
};
&cma_resrved_7 {
size = <0x400000>;
};
&cma_resrved_8 {
size = <0x6000000>;
status = "disabled";
};
&cma_resrved_9 {
size = <0x4000000>;
status = "disabled";
};
&rtk_ion {
rtk,ion-heap@7 {
rtk,memory-reserve = <0x04e00000 0x02000000 0x0000008e
0x00C40000 0x003C4000 0x000004ec>;
};
rtk,ion-heap@8 {
rtk,memory-reserve = <0x04400000 0x000c0000 0x0000008e>;
};
};
&reserved_memory {
ramoops@22000000 {
compatible = "ramoops";
reg = <0x22000000 0x00200000>;
console-size = <0x00100000>;
record-size = <0x00004000>;
ftrace-size = <0x00004000>;
};
};

View File

@ -0,0 +1,133 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd1619b-bleedingedge.dtsi"
/ {
compatible = "realtek,bleeding-edge", "realtek,rtd1619b";
model = "Realtek Bleeding Edge EVB (2GB spi)";
memory@4000 {
device_type = "memory";
reg = <0x00040000 0x7ffc0000>; /* 2 GiB */
};
chosen {
bootargs = "earlycon=uart8250,mmio32,0x98007800 console=ttyS0,460800 uio_pdrv_genirq.of_id=generic-uio init=/etc/init root=/dev/mtdblock3 rootwait loglevel=8 mtdparts=RtkSFC:256k(u-boot-env),1280k(u-boot)ro,10752k(firmware),3072k(rootfs)";
};
};
&pcie1 {
status = "disabled";
};
&sata_phy {
status = "okay";
};
&sata_phy0 {
status = "okay";
};
&ahci_sata {
status = "okay";
};
&sata_port0 {
status = "okay";
};
&protected_mem {
status = "disabled";
};
&rpc_comm {
status = "disabled";
};
&rpc_ringbuf {
status = "disabled";
};
&video_fw_ve3 {
status = "disabled";
};
&audio_heap {
status = "disabled";
};
&media_heap {
status = "disabled";
};
&cma_resrved_1 {
status = "disabled";
};
&cma_resrved_2 {
status = "disabled";
};
&cma_resrved_3 {
status = "disabled";
};
&cma_resrved_4 {
status = "disabled";
};
&cma_resrved_5 {
status = "disabled";
};
&cma_resrved_6 {
status = "disabled";
};
&cma_resrved_7 {
status = "disabled";
};
&cma_resrved_8 {
status = "disabled";
};
&cma_resrved_9 {
status = "disabled";
};
&rtk_ion {
status = "disabled";
};
&tee {
status = "disabled";
};
&hifi {
status = "disabled";
};
&rpc {
status = "disabled";
};
&rtk_fw_pm {
status = "disabled";
};
&reserved_memory {
ramoops@22000000 {
compatible = "ramoops";
reg = <0x22000000 0x00200000>;
console-size = <0x00100000>;
record-size = <0x00004000>;
ftrace-size = <0x00004000>;
};
};

View File

@ -0,0 +1,52 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd1619b-bleedingedge.dtsi"
/ {
compatible = "realtek,bleeding-edge", "realtek,rtd1619b";
model = "Realtek Bleeding Edge EVB (2GB)";
memory@4000 {
device_type = "memory";
reg = <0x00004000 0x7fffc000>; /* 2 GB */
};
chosen {
bootargs = "earlycon=uart8250,mmio32,0x98007800 console=ttyS0,460800 init=/init loop.max_part=7 androidboot.storage=emmc androidboot.hardware=stark";
};
};
&pcie1 {
status = "disabled";
};
&sata_phy {
status = "okay";
};
&sata_phy0 {
status = "okay";
};
&ahci_sata {
status = "okay";
};
&sata_port0 {
status = "okay";
};
&reserved_memory {
ramoops@22000000 {
compatible = "ramoops";
reg = <0x22000000 0x00200000>;
console-size = <0x00100000>;
record-size = <0x00004000>;
ftrace-size = <0x00004000>;
};
};

View File

@ -0,0 +1,26 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2020-2021 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd1619b-bleedingedge.dtsi"
/ {
compatible = "realtek,bleeding-edge", "realtek,rtd1619b";
model = "Realtek Bleeding Edge EVB (4GB)";
memory@4000 {
device_type = "memory";
reg = <0x00004000 0x7fffc000>,
<0x80020000 0x080e0000>,
<0x8a100000 0x0defc000>,
<0x98200000 0x00df0000>,
<0x99000000 0x66000000>;
};
};
&cma_resrved_4 {
alloc-ranges=<0x00000000 0x60000000>;
};

View File

@ -0,0 +1,533 @@
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
/*
* Copyright (c) 2020 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include <dt-bindings/regulator/anpec,apw888x.h>
#include <dt-bindings/soc/realtek,pm.h>
#include <dt-bindings/thermal/thermal.h>
#include "rtd16xxb.dtsi"
/ {
chosen {
stdout-path = "serial0:460800n8";
};
aliases {
serial0 = &uart0;
serial1 = &uart1;
serial2 = &uart2;
rtc0 = &sw_rtc;
};
sw_rtc: sw-rtc {
compatible = "realtek,emulated-rtc";
};
};
&cp {
status = "okay";
};
&cpu0 {
clocks = <&cc RTD1619B_CRT_PLL_SCPU>;
cpu-supply = <&cpu_supp>;
operating-points-v2 = <&cpu_opps>;
#cooling-cells = <2>;
};
&cpu1 {
clocks = <&cc RTD1619B_CRT_PLL_SCPU>;
cpu-supply = <&cpu_supp>;
operating-points-v2 = <&cpu_opps>;
#cooling-cells = <2>;
};
&cpu2 {
clocks = <&cc RTD1619B_CRT_PLL_SCPU>;
cpu-supply = <&cpu_supp>;
operating-points-v2 = <&cpu_opps>;
#cooling-cells = <2>;
};
&cpu3 {
clocks = <&cc RTD1619B_CRT_PLL_SCPU>;
cpu-supply = <&cpu_supp>;
operating-points-v2 = <&cpu_opps>;
#cooling-cells = <2>;
};
&cpu_dvfs {
fss,opp-updated = <0>;
fss,volt-correct = <25000>;
fss,volt-step = <25000>;
fss,volt-min = <775000>;
fss,volt-max = <1050000>;
bsv,opp-updated = <0>;
bsv,volt-correct = <150000 175000>;
bsv,volt-step = <25000>;
bsv,volt-min = <800000>;
bsv,volt-max = <1050000>;
cpu_opps: cpu-opp-table {
compatible = "operating-points-v2";
opp-shared;
opp1000: opp-1000mhz {
opp-hz = /bits/ 64 <1000000000>;
opp-microvolt = <800000>;
opp-microvolt-bsv = <0>;
opp-microvolt-fss = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp1100: opp-1100mhz {
opp-hz = /bits/ 64 <1100000000>;
opp-microvolt = <1050000>;
opp-microvolt-fss = <0>;
opp-microvolt-bsv = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp1200: opp-1200mhz {
opp-hz = /bits/ 64 <1200000000>;
opp-microvolt = <1050000>;
opp-microvolt-fss = <0>;
opp-microvolt-bsv = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp1300: opp-1300mhz {
opp-hz = /bits/ 64 <1300000000>;
opp-microvolt = <1050000>;
opp-microvolt-fss = <0>;
opp-microvolt-bsv = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp1400: opp-1400mhz {
opp-hz = /bits/ 64 <1400000000>;
opp-microvolt = <1050000>;
opp-microvolt-fss = <0>;
opp-microvolt-bsv = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp1500: opp-1500mhz {
opp-hz = /bits/ 64 <1500000000>;
opp-microvolt = <1050000>;
opp-microvolt-fss = <0>;
opp-microvolt-bsv = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp1600: opp-1600mhz {
opp-hz = /bits/ 64 <1600000000>;
opp-microvolt = <1050000>;
opp-microvolt-fss = <0>;
opp-microvolt-bsv = <0>;
clock-latency-ns = <150000>;
status = "okay";
};
opp1700: opp-1700mhz {
opp-hz = /bits/ 64 <1700000000>;
opp-microvolt = <1050000>;
opp-microvolt-fss = <0>;
opp-microvolt-bsv = <0>;
clock-latency-ns = <150000>;
opp-suspend;
status = "okay";
};
};
};
&cpu_thermal {
trips {
cpu_alert0: cpu-alert0 {
temperature = <90000>;
hysteresis = <0>;
type = "passive";
};
cpu_alert1: cpu-alert1 {
temperature = <105000>;
hysteresis = <0>;
type = "passive";
};
};
cooling-maps {
cpu-map0 {
trip = <&cpu_alert0>;
cooling-device = <&cpu0 2 3>;
contribution = <70>;
};
cpu-map1 {
trip = <&cpu_alert1>;
cooling-device = <&cpu0 4 THERMAL_NO_LIMIT>;
contribution = <70>;
};
};
};
&cpu_tm {
status = "okay";
};
&emmc {
status = "okay";
};
&gpio {
status = "okay";
};
&hse {
status = "okay";
};
&i2c_0 {
clock-frequency = <3400000>;
pinctrl-0 = <&i2c_pins_0_HS>;
status = "okay";
apw7899: apw7899@12 {
compatible = "anpec,apw7899";
reg = <0x12>;
regulators {
compatible = "anpec,apw8886-regulator";
vd33_supp: dc1 {
regulator-name = "vd33";
regulator-min-microvolt = <2200000>;
regulator-max-microvolt = <3777500>;
regulator-boot-on;
regulator-always-on;
regulator-initial-mode = <APW888X_DC_MODE_AUTO>;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <3300000>;
};
};
core_supp: dc2 {
regulator-name = "core";
regulator-min-microvolt = <550000>;
regulator-max-microvolt = <1337500>;
regulator-boot-on;
regulator-always-on;
regulator-initial-mode = <APW888X_DC_MODE_AUTO>;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-microvolt = <800000>;
};
};
cpu_supp: dc3 {
regulator-name = "cpudvs";
regulator-min-microvolt = <550000>;
regulator-max-microvolt = <1337500>;
regulator-boot-on;
regulator-always-on;
regulator-initial-mode = <APW888X_DC_MODE_AUTO>;
regulator-ramp-delay = <625>;
regulator-state-mem {
regulator-off-in-suspend;
};
};
vd18_supp: dc4 {
regulator-name = "vd18";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <2060000>;
regulator-boot-on;
regulator-always-on;
regulator-initial-mode = <APW888X_DC_MODE_AUTO>;
regulator-state-mem {
regulator-on-in-suspend;
};
};
ddr_supp: dc5 {
regulator-name = "ddr";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-boot-on;
regulator-always-on;
regulator-initial-mode = <APW888X_DC_MODE_AUTO>;
regulator-state-mem {
regulator-on-in-suspend;
};
regulator-state-shutdown {
regulator-off-in-suspend;
};
};
vd25_supp: ldo1 {
regulator-name = "vd25";
regulator-min-microvolt = <1780000>;
regulator-max-microvolt = <3020000>;
regulator-boot-on;
regulator-always-on;
regulator-initial-mode = <APW888X_LDO_MODE_NORMAL>;
regulator-state-mem {
regulator-on-in-suspend;
};
};
vfb5 {
regulator-name = "vfb5";
regulator-min-microvolt = <512500>;
regulator-max-microvolt = <700000>;
regulator-boot-on;
regulator-always-on;
regulator-state-mem {
regulator-on-in-suspend;
};
};
};
};
};
&i2c_1 {
status = "okay";
};
&i2c_3 {
status = "okay";
};
&i2c_4 {
status = "okay";
};
&i2c_5 {
status = "okay";
};
&iso {
rtc-reload@64c {
compatible = "realtek,rtc-reload";
reg = <0x64c 0x4>;
status = "okay";
};
};
&jpeg {
status = "okay";
};
&nic {
status = "okay";
};
&rfkill {
rfkill-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
status = "okay";
};
&pcie1 {
status = "okay";
};
&pcie1_phy {
status = "okay";
};
&pcie2 {
status = "okay";
};
&pcie2_phy {
status = "okay";
};
&pwm {
status = "disabled";
};
&reboot_mode {
status = "okay";
};
&rng {
status = "okay";
};
&lsadc {
status = "okay";
};
&rtk_fw_pm {
status = "okay";
};
&rtk_pm {
wakeup-flags = <NORMAL_MODE>;
wakeup-gpio-list = <2 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_LOW>,
<4 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_LOW>,
<26 GPIO_WAKEUP_ENABLE GPIO_WAKEUP_ACTIVE_LOW>;
wakeup-timer = <0>;
status = "okay";
};
&sb2_inv {
status = "okay";
};
&sd {
status = "okay";
};
&sdio {
bus-width = <4>;
non-removable;
cap-sd-highspeed;
cap-mmc-highspeed;
sd-uhs-sdr12;
sd-uhs-sdr25;
sd-uhs-sdr50;
sd-uhs-sdr104;
keep-power-in-suspend;
enable-sdio-wakeup;
no-sd;
no-mmc;
status = "okay";
};
&u2drd_usb2phy {
status = "okay";
};
&u2drd {
status = "okay";
};
&u2host_usb2phy {
status = "okay";
};
&u2host {
status = "okay";
};
&u3drd_usb2phy {
status = "okay";
};
&u3drd_usb3phy {
status = "okay";
};
&u3drd {
status = "okay";
};
&rtk_type_c {
status = "okay";
dwc3_rtk = <&u3drd>;
};
/* debug console (J1) */
&uart0 {
status = "okay";
};
/* M.2 slot (CON2) */
&uart1 {
status = "okay";
};
&uart2 {
status = "okay";
};
&usb_manager {
status = "okay";
gpio0 {
realtek,power-gpio = <&gpio 48 GPIO_ACTIVE_HIGH>;
power_low_active;
};
gpio1 {
realtek,power-gpio = <&gpio 49 GPIO_ACTIVE_HIGH>;
power_low_active;
};
rtk_usb {
/*
type_c {
realtek,plug_side_switch-gpio = <&gpio 53 GPIO_ACTIVE_HIGH>;
};
*/
};
};
&vcpu {
status = "okay";
};
&vcpu_ve3 {
status = "disabled";
};
&ve1 {
status = "okay";
};
&watchdog {
status = "okay";
};
&watchdog5 {
status = "okay";
};
&sata_phy {
status = "disabled";
};
&sata_phy0 {
tx-swing = <(-2)>, <(1)>, <(0)>; /* tx swing adjust sample : <gen1>, <gen2>, <gen3> */
/delete-property/ tx-swing;
tx-emphasis = <3>, <(-2)>, <(-3)>; /* tx emphasis adjust sample : <gen1>, <gen2>, <gen3> */
/delete-property/ tx-emphasis;
status = "disabled";
};
&sata_phy1 {
status = "disabled";
};
&ahci_sata {
status = "disabled";
};
&sata_port0 {
status = "disabled";
};
&sata_port1 {
status = "disabled";
};

View File

@ -0,0 +1,94 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2019-2021 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd16xxb-rescue.dtsi"
/ {
model = "Realtek RTD1619B Rescue for Pure NAS";
memory@40000 {
device_type = "memory";
reg = <0x00040000 0x3ffc0000>; /* 1 GiB */
};
};
&protected_mem {
status = "disabled";
};
&rpc_comm {
status = "disabled";
};
&rpc_ringbuf {
status = "disabled";
};
&video_fw_ve3 {
status = "disabled";
};
&audio_heap {
status = "disabled";
};
&media_heap {
status = "disabled";
};
&cma_resrved_1 {
status = "disabled";
};
&cma_resrved_2 {
status = "disabled";
};
&cma_resrved_4 {
status = "disabled";
};
&cma_resrved_5 {
status = "disabled";
};
&cma_resrved_6 {
status = "disabled";
};
&cma_resrved_7 {
status = "disabled";
};
&cma_resrved_8 {
status = "disabled";
};
&cma_resrved_9 {
status = "disabled";
};
&rtk_ion {
status = "disabled";
};
&tee {
status = "disabled";
};
&hifi {
status = "disabled";
};
&rpc {
status = "disabled";
};
&rtk_fw_pm {
status = "disabled";
};

View File

@ -0,0 +1,18 @@
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2019-2021 Realtek Semiconductor Corp.
*/
/dts-v1/;
#include "rtd16xxb-rescue.dtsi"
/ {
model = "Realtek RTD1619B Rescue";
memory@40000 {
device_type = "memory";
reg = <0x00040000 0x3ffc0000>; /* 1 GiB */
};
};

View File

@ -0,0 +1,53 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright (C) 2020 Realtek Semiconductor Corporation
*/
&efuse {
otp_chip_id: chip-id@3cc {
reg = <0x3cc 0x10>;
};
otp_secure_chip_en: secure-chip-en@3fd {
reg = <0x3fd 0x1>;
bits = <2 3>;
};
otp_bist_rst_ctrl: bist-rst-ctrl@406 {
reg = <0x406 0x1>;
bits = <5 2>;
};
otp_uuid: uuid@478 {
reg = <0x478 0xc>;
};
otp_iddq: iddq@4f8 {
reg = <0x4f8 0x2>;
};
otp_etn_rc_r_amp_cal: etn_rc_r_amp_cal@504 {
reg = <0x504 0x8>;
};
otp_usb_cal: usb-cal@528 {
reg = <0x528 0xa>;
bits = <0 77>;
};
otp_usb_port0_dc_cal: usb-port0-dc-cal@534 {
reg = <0x534 0x1>;
bits = <0 4>;
};
otp_usb_port1_dc_cal: usb-port1-dc-cal@534 {
reg = <0x534 0x1>;
bits = <4 4>;
};
otp_usb_port2_dc_cal: usb-port2-dc-cal@535 {
reg = <0x535 0x1>;
bits = <0 4>;
};
otp_sata_cal: sata-cal@a14 {
reg = <0xa14 0x4>;
};
otp_bsv: bsv@adc {
reg = <0xadc 0x4>;
};
otp_usb_u3_tx_lfps_swing_trim: usb_u3_tx_lfps_swing_trim@A18 {
reg = <0xA18 0x1>;
bits = <0 4>;
};
};

View File

@ -0,0 +1,46 @@
// SPDX-License-Identifier: GPL-2.0 OR MIT
/*
* Realtek RTD16xxb SoC family
*
* Copyright (c) 2019-2021 Realtek Semiconductor Corp.
*/
&nic {
wake-mask0 = [3f 30 80 c0 3f 10 80 ff ff 1f 00 00 00 00 00 00];
wake-crc0 = <0x8d25>;
wake-pattern0 = [01 00 5e 00 00 fb 08 00 11 e0 00 00 fb 14 e9 14
e9 00 5f 67 6f 6f 67 6c 65 63 61 73 74 04 5f 74
63 70 05 6c 6f 63 61 6c];
wake-offset0 = <0x0>;
wake-mask1 = [3f 30 80 c0 3f 10 00 00 c0 ff ff 0f 00 00 00 00];
wake-crc1 = <0x8d25>;
wake-pattern1 = [01 00 5e 00 00 fb 08 00 11 e0 00 00 fb 14 e9 14
e9 00 5f 67 6f 6f 67 6c 65 63 61 73 74 04 5f 74
63 70 05 6c 6f 63 61 6c];
wake-offset1 = <0x0>;
wake-mask2 = [3f 30 80 c0 3f 10 00 00 00 00 00 00 80 ff ff 1f];
wake-crc2 = <0x8d25>;
wake-pattern2 = [01 00 5e 00 00 fb 08 00 11 e0 00 00 fb 14 e9 14
e9 00 5f 67 6f 6f 67 6c 65 63 61 73 74 04 5f 74
63 70 05 6c 6f 63 61 6c];
wake-offset2 = <0x0>;
wake-mask3 = [3f 30 10 00 c0 ff ff 03 01 f8 ff ff 01 00 00 00];
wake-crc3 = <0x11da>;
wake-pattern3 = [33 33 00 00 00 fb 86 dd 11 ff 02 00 00 00 00 00
00 00 00 00 00 00 00 00 fb 14 e9 14 e9 00 5f 67
6f 6f 67 6c 65 63 61 73 74 04 5f 74 63 70 05 6c
6f 63 61 6c];
wake-offset3 = <0x0>;
wake-mask4 = [3f 30 10 00 c0 ff ff 03 01 00 00 fc ff ff 00 00];
wake-crc4 = <0x11da>;
wake-pattern4 = [33 33 00 00 00 fb 86 dd 11 ff 02 00 00 00 00 00
00 00 00 00 00 00 00 00 fb 14 e9 14 e9 00 5f 67
6f 6f 67 6c 65 63 61 73 74 04 5f 74 63 70 05 6c
6f 63 61 6c];
wake-offset4 = <0x0>;
wake-mask5 = [3f 30 10 00 c0 ff ff 03 01 00 00 00 00 00 00 f8];
wake-crc5 = <0x15f8>;
wake-pattern5 = [33 33 00 00 00 fb 86 dd 11 ff 02 00 00 00 00 00
00 00 00 00 00 00 00 00 fb 14 e9 14 e9 00 5f 67
6f 6f 67];
wake-offset5 = <0x0>;
};

Some files were not shown because too many files have changed in this diff Show More