"And you shall keep this ordinance in its season" (Exodus 13:10). Why is this said? Because Scripture says, "And it shall be for a sign upon your hand" (Exodus 13:9), I might understand that minors too are included. And there is reason to argue so: since the mezuzah is a positive commandment and tefillin is a positive commandment, if you have learned about the mezuzah that it applies to minors and adults, perhaps tefillin too applies to minors and adults. Therefore Scripture teaches, "And you shall keep this ordinance"; I have spoken only of one who knows how to guard his tefillin. From here the sages said: every minor who knows how to guard his tefillin, his father makes him tefillin. "And you shall keep this ordinance" (Exodus 13:10). This is the commandment of tefillin. Or is it nothing but the ordinance of all the commandments? You say: about what is the passage speaking? About tefillin.
A Child Who Can Guard His Tefillin Is Given Them
Yalkut Shimoni on Torah 222:4
וְשָׁמַרְתָּ אֶת הַחֻקָּה הַזֹּאת לְמוֹעֲדָהּ. לָמָּה נֶאֱמַר, לְפִי שֶׁהוּא אוֹמֵר וְהָיָה לְךָ לְאוֹת עַל יָדְךָ, שׁוֹמֵעַ אֲנִי אַף הַקְּטַנִּים בְּמַשְׁמָע, וְהַדִּין נוֹתֵן, הוֹאִיל וּמְזוּזָה מִצְוַת עֲשֵׂה וּתְפִלִּין מִצְוַת עֲשֵׂה, אִם לָמַדְתָּ עַל מְזוּזָה שֶׁהִיא נוֹהֶגֶת בַּקְּטַנִּים וּבַגְּדוֹלִים, יָכוֹל אַף תְּפִלִּין בַּקְּטַנִּים וּבַגְּדוֹלִין, תַּלְמוּד לוֹמַר וְשָׁמַרְתָּ אֶת הַחֻקָּה הַזֹּאת, לֹא אָמַרְתִּי אֶלָּא בְּמִי שֶׁהוּא יוֹדֵעַ לִשְׁמֹר תְּפִלָּיו. מִכָּאן אָמְרוּ חֲכָמִים, כָּל קָטָן שֶׁהוּא יוֹדֵעַ לִשְׁמֹר תְּפִלָּיו הֲרֵי זֶה אָבִיו עוֹשֶה לוֹ תְּפִלִּין. וְשָׁמַרְתָּ אֶת הַחֻקָּה הַזֹּאת. זוּ מִצְוַת תְּפִלִּין. אוֹ אֵינוֹ אֶלָּא חֻקַּת כָּל הַמִּצְוֹת. אָמַרְתָּ בְּמִי הָעִנְיָן מְדַבֵּר, בִּתְפִלִּין.